A python script to convert a YouTube playlist to an mp3 podcast. Utilises youtube-dl and ffmpeg.
Tested on MacOS using Homebrew to install youtube-dl and ffmpeg. Should work on Windows and Linux too.
Executables:
- youtube-dl
- ffmpeg
Python Modules:
- os
- subprocess
- json
- argparse
- tempfile
- pathlib
Switch | Usage | Default |
---|---|---|
-p |
URL of YouTube Podcast | N/A |
-t |
String to embed as the podcast title metadata | N/A |
-a |
String to embed as the podcast artist metadata | N/A |
-y |
Path to youtube-dl executable | youtube-dl (in path) |
-f |
Path to ffmpeg executable | ffmpeg (in path) |
-o |
Path to save finished audio files | User's home folder |
python playlist2podcast.py -p https://www.youtube.com/playlist?list=PL0CFk33kNHvSdeJm6HQtiJygOCV0o9JdK -t "Citation Needed" -a "The Technical Difficulties"
- Tracks are automatically numbered based on their position in the playlist.
- Artist, podcast title, track number, and video thumbnail are embedded into the finished mp3 file.
- track number and track title are set as the file name for easy organization.
- Automatic sanitization of non-valid characters from the file name.
- Creates directory structure for Podcast Author / Podcast title