Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change method search fb_dtsg #552

Open
hatienl0i2612 opened this issue Apr 16, 2020 · 1 comment
Open

Change method search fb_dtsg #552

hatienl0i2612 opened this issue Apr 16, 2020 · 1 comment
Labels

Comments

@hatienl0i2612
Copy link

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)
@madsmtm
Copy link
Member

madsmtm commented May 6, 2020

Related to #546

I'll have a look at it, thanks for the suggestion 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants