I have a small utility that I use to download a MP3 from a website on a schedule and then builds/updates a podcast XML file which I've obviously added to iTunes.
The text processing that creates/updates the XML file is written in Python. I use wget inside a Windows .bat
file to download the actual MP3 however. I would prefer to have the entire utility written in Python though.
I struggled though to find a way to actually down load the file in Python, thus why I resorted to wget
.
So, how do I download the file using Python?
Source code can be:
I wrote the following, which works in vanilla Python 2 or Python 3.
Notes:
If you have wget installed, you can use parallel_sync.
pip install parallel_sync
Doc: https://pythonhosted.org/parallel_sync/pages/examples.html
This is pretty powerful. It can download files in parallel, retry upon failure , and it can even download files on a remote machine.