This is how to download paywalled and domain-restricted videos from vimeo. A lot of them actually use private hashes to restrict access to a selected customer group that access those videos via a website.
Disclaimer
Do not download copyrighted material unless you are the copyright holder or have some sort of permission to do so. This article is for testing purposes only, e.g. to see how easy it is to get your paywalled videos out there! I am using the term “downloading paywalled videos from vimeo” merely to make this article more searchable and accessible, so that publishers looking for such issues may find it.
Extracting the link of a paywalled video.
In Firefox browser, it’s fairly straight-forward to find the link of an embedded vimeo video, if the sharing options are disabled in the player. Use Developer Tools to scan the code for URLs looking like this:
https://player.vimeo.com/video/<VIDEO_ID>?h=<PRIVATE_HASH>
Or even easier: Right-click the video to find the “This Frame” menu point. It will direct you to the action “Show Only This Frame” which is the fastest way to manually open the direct video link.
Scrape available formats for download
This link can then be scanned for available formats in yt-dlp (make sure you have the most recent updated version, because platforms implement new anti-scraping and anti-download tools constantly) using
yt-dlp -F "https://player.vimeo.com/video/<VIDEO_ID>?h=<PRIVATE_HASH>"
Annotation: The option -F
is an abbreviation for --list-formats
This will yield a table including all the formats available to download.
[info] Available formats for :
ID EXT RESOLUTION FPS │ FILESIZE TBR PROTO │ VCODEC VBR ACODEC MORE INFO
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hls-akfire_interconnect_quic-audio-high-English mp4 audio only │ m3u8 │ audio only unknown [en] English
hls-fastly_skyfire-audio-high-English mp4 audio only │ m3u8 │ audio only unknown [en] English
hls-akfire_interconnect_quic-299 mp4 426x240 30 │ ~113.88MiB 299k m3u8 │ avc1.640015 299k video only
hls-fastly_skyfire-299 mp4 426x240 30 │ ~113.88MiB 299k m3u8 │ avc1.640015 299k video only
hls-akfire_interconnect_quic-387 mp4 640x360 30 │ ~147.40MiB 387k m3u8 │ avc1.64001E 387k video only
hls-fastly_skyfire-387 mp4 640x360 30 │ ~147.40MiB 387k m3u8 │ avc1.64001E 387k video only
hls-akfire_interconnect_quic-572 mp4 960x540 30 │ ~217.86MiB 572k m3u8 │ avc1.64001F 572k video only
hls-fastly_skyfire-572 mp4 960x540 30 │ ~217.86MiB 572k m3u8 │ avc1.64001F 572k video only
hls-akfire_interconnect_quic-818 mp4 1280x720 60 │ ~311.55MiB 818k m3u8 │ avc1.640020 818k video only
hls-fastly_skyfire-818 mp4 1280x720 60 │ ~311.55MiB 818k m3u8 │ avc1.640020 818k video only
hls-akfire_interconnect_quic-1518 mp4 1920x1080 60 │ ~578.17MiB 1518k m3u8 │ avc1.64002A 1518k video only
hls-fastly_skyfire-1518 mp4 1920x1080 60 │ ~578.17MiB 1518k m3u8 │ avc1.64002A 1518k video only
hls-akfire_interconnect_quic-2481 mp4 2560x1440 60 │ ~944.95MiB 2481k m3u8 │ avc1.640033 2481k video only
hls-fastly_skyfire-2481 mp4 2560x1440 60 │ ~944.95MiB 2481k m3u8 │ avc1.640033 2481k video only
hls-akfire_interconnect_quic-7803 mp4 3840x2160 60 │ ~ 2.90GiB 7803k m3u8 │ avc1.640034 7803k video only
hls-fastly_skyfire-7803 mp4 3840x2160 60 │ ~ 2.90GiB 7803k m3u8 │ avc1.640034 7803k video only
You can of course automate and parse this using a bash script to extract the resolution you want.
In the case of this example, you can see that there are “video only” and “audio only” options, but no “video + audio”. The video and audio channels can quickly be merged after downloading automatically in yt-dlp. Just copy-paste (or automated copy-paste) the available formats.
E.g. "hls-fastly_skyfire-audio-high-English"
and "hls-fastly_skyfire-1518"
for 1920×1080 mp4 video for this example.
The different formats here are redundancies to allow fallback replay of the video which vimeo hosts to make sure that replay isn’t laggy or something I believe, as in: they’re just different CDNs (Content Delivery Networks, aka different servers) serving the same files. Don’t worry about it, just pick whichever is quickest to copy.
Remix audio and video to generate an mp4 copy of the stream
You have to copy and concatenate these strings with a “+” in quotes to pass them as remixing options to yt-dlp, such as:
yt-dlp -f "<AUDIO>+<VIDEO>" <VIDEO_LINK>
e.g.
yt-dlp -f "hls-fastly_skyfire-audio-high-English+hls-fastly_skyfire-1518" https://player.vimeo.com/video/<VIDEO_ID>?h=<PRIVATE_HASH>
Make sure you do this in the working directory to download directly to where you want to have the output and avoid lengthy commands including paths (I hate that. We don’t do that. We do working dir where I’m at cause we’re ANSI-C boomers! If you don’t like that, go cry.)
Automate the process
Because I know you’re lazy, here is an automation script to download the resolution you like and the audio and remix:
#!/bin/bash
URL="$1"
RES="$2"
VID=$(yt-dlp -F "$URL" | awk -v r="x$RES" '$0 ~ r && /video only/ {print $1; exit}')
AUD=$(yt-dlp -F "$URL" | grep 'audio only' | awk '{print $1}' | head -n1)
[[ $VID && $AUD ]] && yt-dlp -f "$AUD+$VID" "$URL"
Call this script using:
./vimeo.sh "https://player.vimeo.com/video/<VIDEO_ID>?h=<PRIVATE_HASH>" 1080
Cave: Of course this is a minimal example. If you make a mistake it crashes / doesn’t work. Remember: This is a blog. It’s totally free. You’re not paying me. Therefore, go and suck it, learn how to code yourself instead of googling stuff, then do better on your own blog which you pay hosting fees for and then come back to lecture me. If you want to support my work, check out my ko-fi page.
By the way, you can also download thumbnails using the command:
yt-dlp --get-thumbnail "https://player.vimeo.com/video/<VIDEO_ID>?h=<PRIVATE_HASH>"
No Comments