yt-dlp using to download mp3 or make playlist folders automatically

By logderman | foreverhereintheEther | 11 May 2023


#useaVMforeachthingtotestsoftware #vmisolation #browserisolation #considerusinganexternalharddrivetosaveinternalstorageforthessd #overusinghashtagandimproperly #suckyjokes #iliketurtles

to install use this: official website https://github.com/yt-dlp/yt-dlp/wiki/Installation

for unix
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp # Make executable

for python3 scripts
python3 -m pip install -U yt-dlp
#to get pip debian: sudo apt install python3-pip

yt-dlp from commandline to download playlists of a youtube channel and auto making playlist folders. couldnt figure out how to make it get mp3 only, this will download the videos and make playlist folders automatically and ignore errors.

1. yt-dlp -i -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "youtubepagewithplaylistsvisible.com"

2. for mp3 only (couldnt get playlist creation) of a whole youtube channel on the videos tab, i used a python script. it also ignores errors so you can not worry about restarting if there is an error.
"""
import yt_dlp
import os

def download_audio(link):
    with yt_dlp.YoutubeDL({'ignoreerrors':True, 'extract_audio': True, 'format': 'bestaudio', 'outtmpl': '%(title)s.mp3'}) as video:
        info_dict = video.extract_info(link, download = True)
        video_title = info_dict['title']
        print(video_title)
        video.download(link)
        print("Successfully Downloaded")

url = input("hey paste link here doo doo head: ")
download_audio(url)
"""

 

#iliketurtles

#githubistheb0m

 

 

https://www.publish0x.com?a=3YaOPqMLbx

How do you rate this article?

1

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.