Twitter: getting a tweet video URL
Update: 2024-09-09
Description
For my link archive (as I wish this could be part of a Bookmarklet): the --get-url option of youtube-dl gets you the video URL of a Tweet
# youtube-dl --get-url https://twitter.com/Gert_van_Dijk/status/1548997307017871362
https://video.twimg.com/ext_tw_video/1548997270577840133/pu/vid/320x320/C20GFtInFGjBiY9k.mp4?tag=12
Via:
- [Wayback/Archive] superuser.com how to get twitter video url – Google Search
- [Wayback/Archive] How to get a direct link to a twitter video? – Super User
- Edit: Now i did a bit of research. If you dont want to use an external service you can use the Chrome Debugger.
- This no longer works, the website now only fetches an
.m3u8playlist, and then fetches the chunks of the video separately as MPEG transport stream files (.tsextension). - If you have youtube-dl installed, you can do it like so:
youtube-dl --get-url <link to media page>
Thanks [Wayback/Archive] User Alex O, [Wayback/Archive] Tobi-IT and [Wayback/Archive] Person and [Wayback/Archive] 5th.
I think this is the relevant code I want to check out later: [Wayback/Archive] youtube-dl/twitter.py at master · ytdl-org/youtube-dl
Note there are already bookmarklets going the other way around: from media (video/gif/photo) to original Tweet:
- [Wayback/Archive] twitter bookmarklet get video url – Google Search
- [Wayback/Archive] Jane Manchun Wong on Twitter: “People use other people’s video in their tweets by including the “video link” of that tweet. This tricks Twitter into rendering the video link as a link preview, which comes with the video player This is exactly how the bookmarklet works – directly opening the video link” / Twitter
- [Wayback/Archive] Jane Manchun Wong on Twitter: “I wrote a bookmarklet that redirects you to the original tweet of the video that someone else used in their tweet I wish Twitter could make it easier to track it down though
(m=>{m&&(window.location=m.slice(-1)[0])})(document.title.match(/(\bhttps?:\/\/t\.co\/[\w\-\.as]+)/g))“ - [Wayback/Archive] Jane Manchun Wong on Twitter: “This bookmarklet also works for GIFs that’s been re-posted using the same trick
I cleaned up some typo in and here’s an improved version. Same functionality, just lighter:(m=>{m&&(window.location=m.slice(-1)[0])})(document.title.match(/(\bhttps?:\/\/t\.co\/[\w\-\.]+)/g))“ - [Wayback/Archive] Moshe Isaacian
on Twitter: “@wongmjane Thanks for sharing. I used this tool to turn it to a 1-click bookmarklet: mrcoles.com/bookmarklet“
- [Wayback/Archive] Jane Manchun Wong on Twitter: “I wrote a bookmarklet that redirects you to the original tweet of the video that someone else used in their tweet I wish Twitter could make it easier to track it down though
- [Wayback/Archive] Jane Manchun Wong on Twitter: “This trick is sort of in a grey area, because the person who pulled this trick did not download and re-upload the content They just used someone else’s uploaded content on Twitter w/o linking back to their tweet. This is great if you want to capture all of the creator’s metrics”
- [Wayback/Archive] Jane Manchun Wong on Twitter: “Basically, if you see someone else’s video but want to make sure you get all the clicks and the content creator gets none, instead of including link to the tweet, you append `
/photo/1` (for photos and GIFs) or `/video/1` (for videos) and Twitter will sort that out” - [Wayback/<a href="https://archive.ph/2022.02.22-120219/https://twitter.com
Comments
In Channel



