Traceback (most recent call last):
File "xxxx.py", line 38, in <module>
print(account.id())
^^^^^^^^^^
File "XXXX/twitter/account.py", line 832, in id
return int(re.findall('"u=(\d+)"', self.session.cookies.get('twid'))[0])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
This PR fixes this issue by changing the regex pattern if session._init_with_cookies is set.
Currently,
Account.id
returns an error if we’re using cookies identification method:This PR fixes this issue by changing the regex pattern if session._init_with_cookies is set.