Closed tewhalen closed 1 year ago
Hi, Thanks for reporting this! Nice find!
You're indeed correct, this video (seems to be published from Twitter Media Studio) unfortunately reports itself as a photo in the API (both in v1.1 and v2) and the "url
" points to the same tweet.
Your workaround seems like the best approach at getting at least some media in return.
And as far as affecting other media elements I think it's actually fine, the 'photo
' type usually doesn't include a "media_url
":
[
{
"type":"photo",
"height":1000,
"media_key":"3_1574898376952487965",
"url":"https://pbs.twimg.com/media/FdspusuXoB0wfEH.jpg",
"alt_text":"Alt text",
"width":680
}
]
And if they do, it's probably something funky like the example video you provided. In which case we'll prefer using "media_url
" over "url
" if it exists.
Do you want to create a merge request to the develop branch so you're properly credited for the change? Either that or if you don't have the time to do it, I could commit the change myself and credit you on the release changes as well if you prefer.
Thanks once again!
please commit it yourself, i'm not interested in credit
Sounds good, I'll get to it. Thanks for your contribution!
I ran across a tweet which caused the program to hang at "Processing tweets..." --
tweet # 1591637643376267265, which claims to contain a photo... but the "url" seems to point to a tweet (https://t.co/BMw6NhM0Ll), not to an image. I made a quick edit to
_download_media
that seemed to solve the problem by preferring a "media_url" if one is present, but not sure if it would screw up something else...