radio-bullshit/yt_sync.py
2021-06-16 00:37:25 +02:00

33 lines
972 B
Python

#!/usr/bin/env python3
import youtube_dl
if __name__ == "__main__":
songs_folder = "/songs"
jingles_folder = "/jingles"
# Radio Bullshit
## parameters for Radio Bullshit playlist
ydl_parameters = {
"format": "bestaudio/best",
"postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "vorbis"}],
"outtmpl": f"{songs_folder}/%(title)s.godwin",
"ignoreerrors": True,
"restrictfilenames": True,
}
## download
ydl = youtube_dl.YoutubeDL(ydl_parameters)
ydl.extract_info(
"https://www.youtube.com/playlist?list=PLQC73oq6JtgyYNOeifrJXXzZ1-F0Kgmbg",
)
# Radio Bullshit Jingles
## change output path for Radio Bullshit jingles
ydl_parameters["outtmpl"] = f"{jingles_folder}/%(title)s.godwin"
## download
ydl = youtube_dl.YoutubeDL(ydl_parameters)
ydl.extract_info(
"https://www.youtube.com/playlist?list=PLQC73oq6JtgzX8zbHtP5qXKiH6cuanFWi"
)