Twitter: getting a tweet video URL
Posted by jpluimers on 2024/09/09
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/Archive] Jane Manchun Wong on Twitter: “And exactly, to keep track of who used your video/photos without quote-retweeting, you could do a search on Twitter with: your tweet url + `
/video/1` And you should see a whole list of people who pulled that trick” - [Wayback/Archive] Jane Manchun Wong on Twitter: “I was just feeling like getting this out of my head. This could’ve been done using another bookmarklet, but it will be a lot tricker (because it involves with reverse proxy)”
- [Wayback/Archive] Jane Manchun Wong on Twitter: “In addition, I tested this trick with three types of media (photo, GIF and video). I deleted the tweets that contained the “original content”, which causes the tweets that pulled the `
/video/1` or `/photo/1` trick to break and the media is no longer accessible”

–jeroen
Rate this:
Share this:
- Share on Mastodon (Opens in new window) Mastodon
- Share on Bluesky (Opens in new window) Bluesky
- Share on Tumblr
- Share on Reddit (Opens in new window) Reddit
- Share on Threads (Opens in new window) Threads
- Tweet
- Share on Telegram (Opens in new window) Telegram
- Share on Nextdoor (Opens in new window) Nextdoor
- Share on WhatsApp (Opens in new window) WhatsApp
- Print (Opens in new window) Print
- Email a link to a friend (Opens in new window) Email
Related
This entry was posted on 2024/09/09 at 12:00 and is filed under Bookmarklet, Development, Power User, Python, Scripting, SocialMedia, Software Development, Web Browsers, YouTube, youtube-dl. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
This site uses Akismet to reduce spam. Learn how your comment data is processed.






Leave a comment