1

Twitter has an option to right-click on a video and "copy video address" but this button seems to be broken as it doesn't copy anything to the clipboard, even after I disable Ghostery/adblock. I wanted to find the link directly in the html source but I can't seem to do so. Does anyone know how to do this? A previous post from a while ago suggested looking for "video_url" but that keyword doesn't seem to be anywhere in the source

Tommy K
  • 119
  • 1
  • 3

2 Answers2

4

I could not quite track how exactly it's done but youtube-dl can do it. Run it with -v or -g to see the final video URL:

C:\Work>C:\Python27\Scripts\youtube-dl.exe -v https://twitter.com/starwars/status/665052190608723968
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://twitter.com/starwars/status/665052190608723968']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.12.17
[debug] Python version 2.7.12 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
[twitter] 665052190608723968: Downloading webpage
[twitter:card] 665052190608723968: Downloading webpage
[twitter:card] 665052190608723968: Downloading guest token
[twitter:card] 665052190608723968: Downloading JSON metadata
[twitter:card] 665052190608723968: Downloading XML
[debug] Default format spec: best/bestvideo+bestaudio
[debug] Invoking downloader on u'https://video.twimg.com/amplify_video/731129743244828672/vid/1280x720/PbHOy05lC7qXGG8B.mp4'
[download] Destination: Star Wars - A new beginning is coming December 18. Watch the official 60 second #TV spot for #StarWars - #TheForceAwak
ens.-665052190608723968.mp4
[download] 100% of 10.06MiB in 00:00

Code for this extractor can be found in youtube-dl/youtube_dl/extractor/twitter.py in the source repository.

Igor Skochinsky
  • 36,553
  • 7
  • 65
  • 115
0

For me this worked:

Copy link to tweet from share Original https://twitter.com/melcasebee/status/1492241106364477445?s=20&t=_yuwSCDzUXbN61Mw5XI0VA

and delete at end of long status number starting at the "?"

Video only: https://twitter.com/melcasebee/status/1492241106364477445

  • 1
    This is not the direct link to the video. The link to video have to end with the name of file (e.g . blabla.mp4). – MarianD Feb 18 '22 at 00:30