I am wanting to download all .mp4 files from a single URL. I have seen examples of how to download a file with urllib, but the examples look something like:
urllib.request.urlretrieve('http://example.com/big.zip', 'file/on/disk.zip')
In these examples they specify the exact file to download, big.zip, but I don't know the name of every file in the directory on the site, I only know the file extensions.
I would like to be able to put in something like this for the website:
urllib.request.urlretrieve('http://example.com/videos/', 'file/on/disk')
And then download all of the .mp4 files. I believe I can use .endswith
to sort the specific file extensions.
I am still new to using urllib and I have never used BeautifulSoup, but I've seen it used in several examples, so I don't even know if this can be done.
Downloading files from multiple websites.