Download YouTube playlist a set of MP3s


python3 -m pip install pytube
sudo apt-get install rename


Save the following lines as a file, eg Don’t forget to set your own playlists

from pytube import Playlist

links = ["",

for link in links:
    playlist = Playlist("" + link.split("&")[1])
    for video in playlist.videos:
        print("Downloading: ", video.title,"from", video.watch_url)

Make sure your script is formatted with indents as the image below:

Then run:

  1. python . This step save the audio of youtube video as mp4 file.
  2. rename "s/mp4$/mp3/" *.mp4. This step replace the suffix mp4 with mp3

Leave a Reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.