Open aluhrs13 opened 3 years ago
Hi, yeah sorry about it -- the library I'm using seems unmaintained, so it's been broken for me as well :( Related issues are probably:
https://github.com/fbchat-dev/fbchat/issues/598 https://github.com/fbchat-dev/fbchat/issues/638
I might try to monkey-patch one of the hacks suggested there, but seems that they don't work for everyone
I added a warning about this to readme as well.
@karlicoss There are two updates that got the thing to run for me:
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
@kennethbruskiewicz thanks for the follow up! How did you overwrite the revision?
I can't find the line revision = int(r.text.split('"client_revision":', 1)[1].split(",", 1)[0])
which they reference here https://github.com/fbchat-dev/fbchat/issues/656#issue-1076365878
It appears I'm using an older version with your project. The latest version renamed the file _state
to _session
.
The only line I'm seeing that might be equivalent to revision
like the one above, is here: https://github.com/fbchat-dev/fbchat/blob/master/fbchat/_session.py#L431
Found a well-working fork: https://github.com/MS-Jahan/fbchat (using this tool: https://github.com/techgaun/active-forks) A link to it in the readme might come in handy.
Using a local install of the above fork worked for me
or it did, but then it started crashing with the following
[D 221201 13:48:30 export:154] thread Blake Elias: fetched 0 starting from 1664084457391 (total 18)
--- Logging error ---
Traceback (most recent call last):
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/logzero/__init__.py", line 215, in format
message = record.getMessage()
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 368, in getMessage
msg = msg % self.args
File "<attrs generated repr fbchat._user.User>", line 13, in __repr__
return f'{self.__class__.__qualname__.rsplit(">.", 1)[-1]}(uid={self.uid!r}, type={self.type!r}, photo={self.photo!r}, name={self.name!r}, last_message_timestamp={self.last_message_timestamp!r}, message_count={self.message_count!r}, plan={self.plan!r}, url={self.url!r}, first_name={self.first_name!r}, last_name={self.last_name!r}, is_friend={self.is_friend!r}, gender={self.gender!r}, affinity={self.affinity!r}, nickname={self.nickname!r}, own_nickname={self.own_nickname!r}, color={self.color!r}, emoji={self.emoji!r})'
AttributeError: 'User' object has no attribute 'type'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 1100, in emit
msg = self.format(record)
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 943, in format
return fmt.format(record)
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/logzero/__init__.py", line 236, in format
record.message = "Bad message (%r): %r" % (e, record.__dict__)
File "<attrs generated repr fbchat._user.User>", line 13, in __repr__
return f'{self.__class__.__qualname__.rsplit(">.", 1)[-1]}(uid={self.uid!r}, type={self.type!r}, photo={self.photo!r}, name={self.name!r}, last_message_timestamp={self.last_message_timestamp!r}, message_count={self.message_count!r}, plan={self.plan!r}, url={self.url!r}, first_name={self.first_name!r}, last_name={self.last_name!r}, is_friend={self.is_friend!r}, gender={self.gender!r}, affinity={self.affinity!r}, nickname={self.nickname!r}, own_nickname={self.own_nickname!r}, color={self.color!r}, emoji={self.emoji!r})'
AttributeError: 'User' object has no attribute 'type'
Call stack:
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/fbmessengerexport/export.py", line 362, in <module>
main()
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/fbmessengerexport/export.py", line 285, in main
run(cookies=params['cookies'], db=db)
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/fbmessengerexport/export.py", line 263, in run
errors = list(process_all(client=client, db=edb))
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/fbmessengerexport/export.py", line 227, in process_all
yield from error(r)
File "/Users/vlad/Library/Python/3.10/lib/python/site-packages/fbmessengerexport/export.py", line 219, in error
logger.error('While processing thread %s', thread)
Unable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.
[E 221201 13:48:31 export:220] GraphQL error #None: A server error field_exception occured. Check server logs for details. / None
NoneType: None
but that seems like a different problem 🤔
I can't seem to get it to work at all :(, could this be because I'm on Windows or some other user error?
Doing login
Trying with --cookies
Trying with cookies in --secrets