Spark-NF / twitter_media_downloader

Twitter media downloader.
Apache License 2.0
293 stars 52 forks source link

TweepError: Twitter error response: status code = 403. Related to the new API access tiers? #40

Open UNAVS opened 1 year ago

UNAVS commented 1 year ago

I got this error here:

Resolving: 0 tweets [00:00, ? tweets/s]Traceback (most recent call last):
  File "C:\Users\ThinkPad\Downloads\twitter_media_downloader-master\twitter_media_downloader.py", line 38, in <module>
    medias = get_medias(AUTH, user_id, ARGS.retweets, ARGS.image_size, ARGS.since, ARGS.since_id, ARGS.until, ARGS.until_id, ARGS.likes)
  File "C:\Users\ThinkPad\Downloads\twitter_media_downloader-master\src\parser.py", line 104, in get_medias
    for tweet in tweepy.Cursor(capi, id=user_id, include_rts=include_retweets, include_entities=True, tweet_mode='extended', since_id=since_id, max_id=until_id).items():
  File "D:\Python\lib\site-packages\tweepy\cursor.py", line 49, in __next__
    return self.next()
  File "D:\Python\lib\site-packages\tweepy\cursor.py", line 197, in next
    self.current_page = self.page_iterator.next()
  File "D:\Python\lib\site-packages\tweepy\cursor.py", line 108, in next
    data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs)
  File "D:\Python\lib\site-packages\tweepy\binder.py", line 250, in _call
    return method.execute()
  File "D:\Python\lib\site-packages\tweepy\binder.py", line 234, in execute
    raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: Twitter error response: status code = 403
Resolving: 0 tweets [00:00, ? tweets/s]

After searching for a bit, someone said I might need Twitter API Elevated Access to stop the error. However, today's Twitter API access tiers no longer provide Elevated Access and only offers Free, Basic, and Enterprise tiers. Is it true that the error 403 was caused by these access tiers? Any solution?

kmoonn commented 4 weeks ago

Yes, retrieving Tweets is not available with Free access. https://twittercommunity.com/t/announcing-new-access-tiers-for-the-twitter-api/188728 https://twittercommunity.com/t/deprecation-of-legacy-access-tiers-in-the-twitter-api/196162 https://developer.twitter.com/en