fbchat-dev / fbchat-dev/fbchat

Change method search fb_dtsg

Open
#552 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

## 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
```py
fb_dtsg_element = re.match(r'\"name\".+?\"fb_dtsg\".+?\"value\".+?\"(?P.+?)\"',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)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.