Spark-NF / twitter_media_downloader

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

Can't get protected Tweets even if i have followed the acount. #15

Closed zby1234 closed 3 years ago

zby1234 commented 4 years ago

Can't get protected Tweets even if i have followed the acount.

https://help.twitter.com/en/safety-and-security/public-and-protected-tweets

Traceback (most recent call last): File "twitter_media_downloader.py", line 32, in medias = get_medias(auth, args.userid, args.retweets, args.image_size, args.since, args.since_id, args.until, args.until_id) File "/var/www/html/twitter_media_downloader/src/parser.py", line 80, in get_medias for tweet in tweepy.Cursor(api.user_timeline, id=user_id, include_rts=include_retweets, include_entities=True, tweet_mode='extended', since_id=since_id, max_id=until_id).items(): File "/usr/local/lib/python3.6/dist-packages/tweepy/cursor.py", line 49, in next return self.next() File "/usr/local/lib/python3.6/dist-packages/tweepy/cursor.py", line 197, in next self.current_page = self.page_iterator.next() File "/usr/local/lib/python3.6/dist-packages/tweepy/cursor.py", line 108, in next data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs) File "/usr/local/lib/python3.6/dist-packages/tweepy/binder.py", line 250, in _call return method.execute() File "/usr/local/lib/python3.6/dist-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 = 401

Spark-NF commented 3 years ago

Indeed, it would seem that a proper access token is required to access protected accounts. I just pushed a fix for that, sorry for the delay 👍