what is an elegant way to access the urls of tweets pictures with tweepy v2? Twitter released a v2 of their API and tweepy adjusted their python module to it (tweepy v2).
Lets say for example I have a dataframe of tweets created with tweepy, holding tweet id and so on. There is a row with this example tweet: https://twitter.com/federalreserve/status/1501967052080394240
The picture is saved under a different url and the documentation on tweepy v2 does reveal if there is a way to access it. https://pbs.twimg.com/media/FNgO9vNXIAYy2LK?format=png&name=900x900
Reading thought the requests json obtained through tweepy.Client(bearer_token, return_type = requests.Response) did not hold the required links.
I am already using the following parameters in the client:
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']
)
What would be a way to obtain or generate the link to the picture of the tweet? Preferably through tweepy v2 itself?
Thank you in advance.