Wget download files in subdirectories - confirm. All
Using Wget for recursive downloads
2015-05-31 (Sunday) | 300 words (~2 minutes reading)
I discovered the VimCasts website recently and have been watching a few of their videos. Due to my unreliable internet connection, I prefer to download whole video files and then watch them (this also allows watching them on portable devices).
VimCasts allow directory listing on their storage server, which I believe is permission to bulk download their content. The only issue is that each episode is stored in its own subdirectory and in two formats. I don’t want the folder structure and I only want one of the formats.
At first I tried using a couple of different browser extensions that are supposed to automate this, before I realised that Linux command line tools must be able to do this.
The first attempt just used the recursive feature of :
Unfortunately that also traverses up the directory structure and gets out of control, but that’s fixed with:
This is better, and we end up with a clone of the subdirectories and their contents. I only want the ogv files, though, which is also possible with wget:
Finally, I don’t particularly want the folder structure, just the files. That can also be covered with wget’s options, so the final command that does exactly what I want is:
That goes off and downloads all OGV files in subdirectories, flattening the folder structure and giving very readable output as it does it.
Another joy of using Linux.
-