使用pythontwitter的twitterapi查询很少给出结果

2024-04-20 04:48:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用Python Twitter从tweet下载关于youTube视频的数据:https://github.com/bear/python-twitter/blob/master/doc/index.rst

def TW():
    return twitter.Api(consumer_key='X',consumer_secret='X',access_token_key='X-X',access_token_secret='X')

for i in TW().GetSearch(term='https://www.youtube.com/watch?v=ftP6Uh_jSUg', count=1000, include_entities=True):
    print('TWEET_URL','twitter.com/'+str(i.user.screen_name)+'/status/'+str(i.id),i.urls,'RETWEETS',i.retweet_count,'USER_MENTIONS',i.user_mentions,'TEXT',i.text,'USER_ID',i.user.id,'USER',i.user.screen_name)

当我使用GetSearch时,得到的结果很少。例如,我在前面的视频查询中只得到了这个。你知道吗

TWEET_URL twitter.com/Niza_Club/status/740770459030032384 [URL(URL=XX, ExpandedURL=https://youtu.be/ftP6Uh_jSUg)] RETWEETS 0 USER_MENTIONS [User(ID=10228272, ScreenName=YouTube)] TEXT Juniore - A la plage vía @YouTube USER_ID 20470260 USER Niza_Club

而在Twitter上手动完成的相同查询给了我15个结果,包括上个月的5个:https://twitter.com/search?q=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DftP6Uh_jSUg&src=typd

我怎样才能得到其他结果?有没有更好的工具使用twitterapi?一个没有它?你知道吗


Tags: keyhttpscomidurlsecret视频access