I'm trying to download a series of podcast episodes using cURL. I know how to use a range of numbers to download several files matching a pattern, but what I can't figure out is how to have multiple ranges within a single URL.
http://www.example.com/01_episode_1.mp3 http://www.example.com/02_episode_2.mp3 http://www.example.com/03_episode_3.mp3 ... http://www.example.com/52_episode_52.mp3
If I use
curl -O http://www.example.com/[01-52]_episode_[1-52].mp3
I get files like this:
01_episode_1.mp3 01_episode_2.mp3 01_episode_3.mp3 ... 01_episode_52.mp3 02_episode_1.mp3 02_episode_2.mp3 02_episode_3.mp3 ... 02_episode_52.mp3 03_episode_1.mp3 03_episode_2.mp3 03_episode_3.mp3 ... 03_episode_52.mp3 etc...
But most of them are obviously not going to be valid files.
How can I use cURL to grab the files I want? Or maybe I'm trying to use the wrong tool for the job?
This is on OS X 10.10.3 and whatever version of cURL is installed by default on that platform.