twitter-click-and-save icon indicating copy to clipboard operation
twitter-click-and-save copied to clipboard

Unable to download video if the video is in a QRT

Open biggestsonicfan opened this issue 3 years ago • 12 comments
trafficstars

Possibly a result of fixing #4, the media in the QRT of this tweet cannot be downloaded as a video. The image preview, however, downloads fine.

biggestsonicfan avatar Aug 25 '22 04:08 biggestsonicfan

Possibly a result of fixing #4

Possibly no, since in this strange case there is no link (an anchor element <a href="...">) to the embed tweet. So the UJS just uses the parent tweet ID (makes API call with "wrong" ID), so it works like before #4.


Well, however, it does not work also for

image In this case "Aug 19" text contains the URL.

UPD: It this case the video is a "broadcast". It's not a "normal" video.

AlttiRi avatar Aug 25 '22 04:08 AlttiRi

Okay, the normal video tweet reposts are still downloaded as earlier:

image


Your URL is strange since it does not contain the URL to the embed tweet in HTML, so I can't detect the target (correct) tweet ID.

Hm, why is this retweet so special?

However, if I open the embed tweet by the mouse click, it's just a normal video: image


https://twitter.com/SpaceX/status/1560707309361172480 is a "broadcast" and it can't be download as a usual video.


BTW, gallery-dl and other downloaders also do not support these URLs (as well as adv URLs).

For example, gallery-dl uses a GraphQL Twitter's API, however, even it do not download the URL.


It seems that I need to use an other API(s) for these rare cases.


UPD: It's not a usual retweet, but a "quoted answer": image

AlttiRi avatar Aug 25 '22 05:08 AlttiRi

Okay, I don't think that it's critical (the userscript still downloads the usual videos and images, in particular, within retweets), so I will try to fix your last two issues some time later.

It seems I just need to use https://twitter.com/i/api/graphql/7i51yEC2i_iurfMKZ8mcNw/TweetDetail endpoint. I'm so lazy to do it, but okay.


Also it seems "broadcast"s do not have a ".mp4" URL, only HLS chunks stream (".m3u8" URL). At least in the https://twitter.com/i/api/1.1/live_video_stream/status/ endpoint that Twitter uses.

image

AlttiRi avatar Aug 25 '22 05:08 AlttiRi

Okay, I don't think that it's critical

I completely agree, these are definitely non-critical things, but are just things I would like to bring to your attention to address functionality of the script. Especially if you were never made aware of them, as was the case with the adv tweet.

I greatly appreciate your time and effort in this script, as I avidly used to right-click tweets, but this has made my life much easier!

biggestsonicfan avatar Aug 25 '22 19:08 biggestsonicfan

In perhaps an ironic twist of fate, the ability to save that video is now no longer possible as it has been removed by a copyright takedown. If you have the source information you posted previously saved, you can use that to continue development, else this issue will have to be revisited once a similar tweet is found...

biggestsonicfan avatar Sep 08 '22 21:09 biggestsonicfan

Found a new video that won't download as QRT but downloads fine in the original.

biggestsonicfan avatar Sep 20 '22 07:09 biggestsonicfan

Should be fixed now.

No need to even use GraphQL API.

AlttiRi avatar Sep 28 '22 22:09 AlttiRi

Inverse just happened with the video as the QRT here.

biggestsonicfan avatar Oct 29 '22 21:10 biggestsonicfan

Seems to be fixed in https://github.com/AlttiRi/twitter-click-and-save/commit/06a13b2f2c6199b0938d81d16c4a8366dd9dc1e8.

AlttiRi avatar Oct 29 '22 22:10 AlttiRi

Seems to be fixed in 06a13b2.

I wish every git repo worked as hard and as fast as you :laughing:

biggestsonicfan avatar Oct 30 '22 00:10 biggestsonicfan

Fixed again. https://github.com/AlttiRi/twitter-click-and-save/commit/92de3f2c0e24dba63e147c9f3823786d5038d7c2 However, it's seems I need to put into the history both tweet IDs: of the original post and of the quoted post for the correct button color displaying.

AlttiRi avatar Jul 03 '23 14:07 AlttiRi

https://github.com/AlttiRi/twitter-click-and-save/commit/78164e00485cf0496e0202c58497384f9c2a7741

AlttiRi avatar Jul 07 '23 14:07 AlttiRi