【问题标题】:TweepError: [{'code': 144, 'message': 'No status found with that ID.'}]TweepError: [{'code': 144, 'message': 'No status found with that ID.'}]
【发布时间】:2020-05-31 21:25:40
【问题描述】:

嘿,我正在使用推文 ID 提取推文,但遇到此错误 TweepError: [{'code': 144, 'message': 'No status found with that ID.'}]。我尝试了许多其他推文 id,但错误是一样的。

我的代码:

id=591902698594701314
import tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

tweet = api.get_status(id)
print(tweet.text)

【问题讨论】:

    标签: python text tweets


    【解决方案1】:

    实现没问题,只是id无效。尝试不同的 id。

    【讨论】:

      【解决方案2】:

      我遇到了类似的错误:

      TwitterError: [{'code': 144, 'message': 'No status found with that ID.'}]
      

      当我运行此代码时,似乎许多 ID 都会为我返回它:

      import twitter
      api = twitter.Api(consumer_key, consumer_secret, access_token_key, access_token_secret)
      api.VerifyCredentials()
      tweet = api.GetStatus(tweet_ids[420])
      print(tweet)
      

      我相信它引发了这个错误,因为许多推文要么被用户删除,要么个人资料本身已被删除。

      【讨论】:

        【解决方案3】:

        这个错误TwitterError: [{'code': 144, 'message': 'No status found with that ID.'}]是因为json返回idid_str所以你必须使用id_str转发!

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2013-02-17
          • 2018-04-12
          • 1970-01-01
          • 2020-10-11
          • 2017-01-13
          • 2023-02-20
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多