How to download a Twitter video from a DM
Recently, Twitter rolled out a new design for the majority of their users. The new design features re-arranged buttons and a sidebar on the left. Also, the new design made it harder for some folks to download a video from DMs. In this post we will review a relatively simple trick that will allow you to download any video from a Twitter DM.
Twitter is a popular social network which allows posting short messages. The length of the post is only
140 280 characters, excluding links and images. Twitter is used by millions of people, including celebrities and public figures to share what's on their mind, useful information and announcements, and various personal events. Twitter supports private messaging, user mentions, emojis and hotkeys. Besides the web site, users are able to use it via a number of Twitter clients available for all major platforms.
To be able to download a video from a DM, you need a browser with Developer Tools integrated. Luckily, all modern browsers comes with such an option. I will use Google Chrome, which allows opening Developer Tools with the Ctrl + Shift + I hotkey.
Another thing we need is
youtube-dl, a cross-platform command line tool that allows downloading and converting videos on the fly from various web sources, including Twitter. In fact, the list of supported services by the app is really HUGE.
Grab youtube-dl and its dependencies from HERE. If you are a Linux user, there's a great chance that you already have it available in the package repository.
The youtube-dl app is a portable tool that doesn't require installation. Just download it to a convenient location. I will place the it under C:\apps\youtube-dl\youtube-dl.exe. Don't forget to install Microsoft Visual C++ 2010 Redistributable Package (x86) as mentioned on the download page.
Yet another tool is required to assist youtube-dl. To merge the downloaded video fragments (Twitter splits videos into pieces for faster streaming), it needs FFmpeg. Windows builds can be obtained HERE.
I suggest you to download 32-bit static build of FFMpeg binaries. Here is the actual direct link at the moment of writing.
Extract the contents of the bin folder to the c:\apps\youtube-dl folder to get all the ffmpeg windows binaries stored under the same folder.
Now, let's grab some video from Twitter DMs.
To Download a Video From Direct Message on Twitter,
- Open a command prompt in the folder where you have youtube-dl and leave it open.
- Open Twitter in Google Chrome and sign-in to your account.
- Switch to Direct Messages and open the conversation you want to download a video from.
- Press CTRL+SHIFT+I to open Developer Tools in Chrome and switch to the Network tab.
.m3u8in the Filter box.
- In the list below, right-click on the row in the Name column, and select Copy link address. Start from the last row (see below).
- Switch back to the command prompt. Type
youtube-dl <past the copied link address here>.
- Hit the Enter key and wait. Youtube-dl will download the video and save it as MP4 to its folder (C:\apps\youtube-dl in my case).
- Now, copy the link address for the next m3u8 entry, and download the video.
- Repeat the steps for other m3u8 links. This will give you all possible resolutions of the video available on Twitter.
You are done! The biggest file usually retains the highest quality available. Check out all the files and pick the one which plays best for you.
Note: From our observation, the last m3u8 link in the list points to the stream of highest quality. So, if you start with the last line, there is a chance that you will get the best video quality available directly.
Thanks to Roman Linev for his assistance and suggestions.
Articles of interest: