使用 tweepy v2 访问推文图片的 url 的优雅方式是什么?Twitter 发布了他们的 API 的 v2,并且 tweepy 调整了他们的 python 模块(tweepy v2)。
比方说,我有一个用 tweepy 创建的推文数据框,包含推文 ID 等。此示例推文有一行: https ://twitter.com/federalreserve/status/1501967052080394240
图片保存在不同的 url 下,tweepy v2 上的文档确实揭示了是否有办法访问它。 https://pbs.twimg.com/media/FNgO9vNXIAYy2LK?format=png&name=900x900
读了以为通过获取到的requests jsontweepy.Client(bearer_token, return_type = requests.Response)没有持有需要的链接。
我已经在客户端中使用以下参数:
client.get_liked_tweets(user_id,
tweet_fields = ['created_at', 'text', 'id', 'attachments', 'author_id', 'entities'],
media_fields=['preview_image_url', 'url'],
user_fields=['username'],
expansions=['attachments.media_keys', 'author_id']
)
Run Code Online (Sandbox Code Playgroud)
获取或生成推文图片的链接的方法是什么?最好通过 tweepy v2 本身?
先感谢您。