Skip to content

Change method search fb_dtsg #552

@hatienl0i2612

Description

@hatienl0i2612

Description of the problem

The new facebook has a completely new interface, so your use of bs4 to search for fb_dtsg in this new interface is not satisfactory, I recommend using regex to search for fg_dtsg, this code is compatible with the interface. New and old interface

Code to reproduce

in def _from_session in _session.py should change

fb_dtsg_element = re.match(r'\"name\".+?\"fb_dtsg\".+?\"value\".+?\"(?P<fb_dtsg>.+?)\"',r.text)

if fb_dtsg_element:
    fb_dtsg = fb_dtsg_element.group("fb_dtsg")
else:
      # Fall back to searching with a regex
    res = FB_DTSG_REGEX.search(r.text)
    if not res:
        raise _exception.NotLoggedIn("Could not find fb_dtsg")
        fb_dtsg = res.group(1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions