Closed edikiuspro closed 3 years ago
Debug info: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): m.facebook.com:443 DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET / HTTP/1.1" 200 None DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /login.php?login_attempt=1 HTTP/1.1" 302 0 DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?refsrc=https%3A%2F%2Fwww.facebook.com%2F&_rdr HTTP/1.1" 302 0 DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /cookie/consent-page/?next_uri=https%3A%2F%2Fm.facebook.com%2Fhome.php%3Frefsrc%3Dhttps%253A%252F%252Fwww.facebook.com%252F&_rdr HTTP/1.1" 200 None DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "POST /cookie/consent/?next_uri=https%3A%2F%2Fm.facebook.com%2Fhome.php%3Frefsrc%3Dhttps%253A%252F%252Fwww.facebook.com%252F&sid=jlm4Zms4rW3SyGJsgSc0&m_basic_source_surface=COOKIE_CONSENT_PAGE HTTP/1.1" 302 0 DEBUG:urllib3.connectionpool:https://m.facebook.com:443 "GET /home.php?refsrc=https%3A%2F%2Fwww.facebook.com%2F&__ccr=FQQREREA.ARYhHxu2jHjH2--J36zxBLPTC9H0d0wQLpzU5g9zCq5yrOxY&_rdr HTTP/1.1" 200 None DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.facebook.com:443 DEBUG:urllib3.connectionpool:https://www.facebook.com:443 "GET / HTTP/1.1" 200 None
If you print(r.text) at line 182 of _state.py, you'll see there's the following:
["DTSGInitData",[],{"token":"<token>","async_get_token":"<async_token>"},<number>]
Maybe this info is what's needed?
If you print(r.text) at line 182 of _state.py, you'll see there's the following:
["DTSGInitData",[],{"token":"<token>","async_get_token":"<async_token>"},<number>]
Maybe this info is what's needed? i used print(r.text) and found new problem (https://user-images.githubusercontent.com/50236306/111641524-88692580-87fd-11eb-8b59-2e491e2b8356.png)
in _state.py replace FB_DTSG_REGEX:
FB_DTSG_REGEX = re.compile(r'"DTSGInitData",\[\],\{"token":"(.*?)"')
I can confirm that worked for me. Thanks @orzechszek!
If it works, please also update in v1 project - fbchat 1.9.7 available through pip.
Thank you very much @orzechszek
Traceback (most recent call last): File "C:\Users\Admin\Project\Voting.py", line 326, in
client=BotGrupowy("","")
File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\fbchat_client.py", line 103, in init
self.login(email, password, max_tries, user_agent=user_agent)
File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\fbchat_client.py", line 205, in login
self._state = State.login(
File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\fbchat_state.py", line 156, in login
return cls.from_session(session=session)
File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\fbchat_state.py", line 192, in from_session
fb_dtsg = FB_DTSG_REGEX.search(r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'