Downloading Videos from Vimeo

Daniel Ellis Research
2 min readMar 10

You have a lecture series hosted on Vimeo, but are travelling to an area of poor internet — so what do you do?

Use your programming knowledge to download all the videos in advance of course!

Photo by Dan Cristian Pădureț on Unsplash

Be it a flight, or you just want the videos for reference, there are many occasions where programatically downloading everything can be of use. This page describes how to do just that.

1. Get a list of your video urls

The first step is to extract a list of all urls we intend to use. For instance to get all the ‘next up’ videos in a page we may use the following javascript snippet within the console:

[...document.querySelectorAll('a[class="iris_link iris_link--gray-1"]')].map(d=>[d.href,d.innerText])

We can then take this list and paste it into a text file.

2. Using the Vimeo downloader.

We begin by installing it with

pip install vimeo_downloader

Next we load it into python and read our video:

from vimeo_downloader import Vimeo
url = "https://vimeo.com/261491481"
id = int(url.split('/')[-1])
v = Vimeo.from_video_id(video_id=str(id))

Here we see that the video id is the numeric string following the direct url. From here we can access the video name with

v.metadata.title

or explore the various available streams with

v.streams

As each stream is of a different quality, we may cycle through all of them and select only that which we are interested in:

for s in v.streams:
if s.quality == '720p':
// download here
break

To download we use:

s.download(download_directory='download_dir', filename=v.metadata.title)

3. Putting it all together

Finally since we are able to download multiple videos asynchronously, we can use the ptqdm library to run each url in parallel — giving us the following code:

from vimeo_downloader import Vimeo
from p_tqdm import p_map

# quality we want to download
quality = '360p'

data = eval(open('collection.txt').read())


def dvid(url):
id = int(url.split('/')[-1])

# get video info
v = Vimeo.from_video_id(video_id=str(id))

for s in v.streams:
if s.quality == quality:
s.download(download_directory='downloads', filename=v.metadata.title)
return None

# parallel process
p_map(dvid,data)

(If you found this useful, please click the ‘clap’ button. And remember you can click it more than once! Maybe even 50 times?)

Daniel Ellis Research

Research Software Engineer specialising in High-Performance Computing and Data Visualisation. — PhD in Atmospheric Chemistry and Masters in Theoretical Physics.