iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
123 stars 17 forks source link

generate_session now fails #16

Closed codilau closed 11 months ago

codilau commented 11 months ago

This is not a guest_session

Traceback (most recent call last):
  File ".../python3.10/site-packages/tweeterpy/request_util.py", line 22, in make_request
    if "json" in response.headers["Content-Type"]:
  File ".../python3.10/site-packages/requests/structures.py", line 52, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'content-type'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../test_twitterPy.py", line 20, in <module>
    twitter_api = TweeterPy()
  File ".../python3.10/site-packages/tweeterpy/tweeterpy.py", line 19, in __init__
    self.generate_session()
  File ".../python3.10/site-packages/tweeterpy/tweeterpy.py", line 128, in generate_session
    make_request(Path.BASE_URL, session=self.session)
  File ".../python3.10/site-packages/tweeterpy/request_util.py", line 35, in make_request
    if api_limit_stats.get('rate_limit_exhausted'):
AttributeError: 'NoneType' object has no attribute 'get'

UPDATE: It has recovered, but it's a bad sign that something is about to change.

iSarabjitDhiman commented 11 months ago

So it's working now ? Yeah this might be a sign that twitter is about to make changes, or maybe it was some issues with request headers. As I noticed the script was unable to get a response. Keep me updated if you notice anything weird. Thanks

Edit : Lets close the issue for now as it is resolved.