Click here to Skip to main content
13,898,041 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 8 Nov 2018
Licenced CPOL

Downloading Podcasts from Changelog

, 8 Nov 2018
Rate this:
Please Sign up or sign in to vote.
Due to busy lives in the 21st century, finding time to learn about new topics and keeping up to date with technological trends becomes more and more difficult.

One great way to keep learning and improving without sacrificing time from other activities is to listen to some of the great podcasts out there.

If you are like me and enjoy listening to podcasts on your phone while you are offline, you will find that many sites don’t offer a direct download button, forcing you to look for the file manually. Recently, I encountered this problem with the podcasts on, so I decided to write a small console application that downloads the mp3s directly to my disk.


This will be a rather simple but hopefully still useful tutorial. To follow along, all you need is a Python IDE and basic Python skills. You can find the entire source code of the project on my Github page.

Preparing the Solution

Since we are going to write a rather small console application, I decided to keep everything in one file. To get started, create an empty file. To make it executable, you should add the standard Python shebang at the top of the file:



On the Changelog overview page, you will find several podcast categories to choose from. Once you open either category you are interested in and choose a podcast, you will be presented with some information about the podcast and an online player. To get to the actual mp3 file, you will have to right-click the Play button and open the link in a new tab. Take a look at the URL and you will see the file we want to download, for example, js-party-25 for the JS Party podcasts.

You can get the base URLs for the other podcasts in a similar manner, allowing us to initialize them in an array for all our podcasts:

base_urls = ['<id>/the-changelog-<id>.mp3',

Downloading Podcasts

Let’s get to the core of this program: The code to download the podcasts. All the magic will happen inside the following download_podcasts method:

def download_podcast(podcast_id):
    base_url = base_urls[podcast_id - 1]
    print("Enter one or more episodes to download:")
    episodes = (int(x) for x in input().split(','))
    target = '/home/philipp/Downloads/'

    for episode in episodes:
        download_url = base_url.replace('<id>', str(episode))
        print('Downloading episode {} to {}'.format(str(episode),target))
            urllib.request.urlretrieve(download_url, target + download_url.split('/')[-1])
            print('Download complete!')
            print('Could not download file: {}'.format(download_url))

The only parameter for our method is the podcast_id which tells the program which category of podcasts should be downloaded. Next, we ask the user to enter one or multiple episode numbers he/she wants to download and define the target folder for the mp3 files.

In the following for loop, we simply iterate through all selected episodes, replace the ‘id’ placeholder with the episode number, so we get a valid URL and finally download the file. Since we are using the urllib library, you will have to add an import statement at the top of the file:

import urllib.request

This is all we need to download podcasts from and store them as mp3 files. To call our new code, I implemented a simple console UI inside the main method:

def main():
    print('Which podcast would you like to download?')
    print('(1) - The Changelog')
    print('(2) - Go Time')
    print('(3) - Request for Commits')
    print('(4) - Founders Talk')
    print('(5) - Spotlight')
    print('(6) - JS Party')

    n = int(input())

This allows the user to select a podcast and then select episodes from within the download_podcast method. To run our new code upon execution of the file, simply add the following entry point to the program:

if __name__ == "__main__":


I hope you enjoyed this short article and see how easy it can be to write small utility tools to make our lives easier. Feel free to extend the code to download any other podcasts you like in a more convenient manner!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
Germany Germany
Hi there 🙂
My name is Philipp Engelmann, I work as a web developer at FIO SYSTEMS AG in Leipzig. I am interested in C#, Python, (REST-)API-Design, software architecture, algorithms and AI. Check out my blog at

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03 | 2.8.190306.1 | Last Updated 8 Nov 2018
Article Copyright 2018 by Philipp_Engelmann
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid