Today, kids, we are going to download iTunes U course almost exclusively from the command line.
The easiest way to do that is to use iTunes to download all that for you. Unfortunately, while I have iPod/iPad in my home ecosystem, I don’t have any Mac computers. Thus, I’m running iTunes in a virtual machine on Windows. Imagine my user experience from such combination. Pure pain and suffering.
There wouldn’t be this post if it was all smooth. For unknown reasons my iTunes doesn’t save downloaded video files. I can see it’s downloading them, I can see the temp file growing, but when it’s done, puff, I can’t find the file anywhere. Luckily, there is a solution. It is a pity but you still need iTunes for a couple of steps.
OK, let’s do it. Say, you found an interesting course on iTunes U:
Step 1. Subscribe to the course in iTunes
Step 2. Copy course url
Click on any item in the course materials list and select “Copy iTunes U URL”.
NB: There is iTunes U Course Manager web page and I presume you might get the feed URL there (though I really doubt you can). However, my country isn’t enjoying Apple’s favour.
Step 3. Download the feed
Step 4. Extract links and titles
The feed contains
feed/entry items in the format as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
It is very convenient to use xmlstartlet to extract titles and links from the feed. Note, however, that xmlstartlet is very picky to namespace (thanks to this answer). Extraction command will look as follows:
Step 5. Download the course
Now all that is left is to read titles and links and download them. I prefer to use aria2c