Added Radio Bullshit Jingles to yt_sync.py

This commit is contained in:
Aethor 2021-06-12 12:46:44 +02:00
parent 5737277256
commit e4f0fba223

View File

@ -1,3 +1,4 @@
#!/usr/bin/python3
import os import os
import youtube_dl import youtube_dl
@ -6,17 +7,26 @@ if __name__ == "__main__":
script_dir = os.path.dirname(os.path.abspath(__file__)) script_dir = os.path.dirname(os.path.abspath(__file__))
ydl = youtube_dl.YoutubeDL( # Radio Bullshit
{ ## parameters for Radio Bullshit playlist
"format": "bestaudio/best", ydl_parameters = {
"postprocessors": [ "format": "bestaudio/best",
{"key": "FFmpegExtractAudio", "preferredcodec": "vorbis"} "postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "vorbis"}],
], "outtmpl": f"{script_dir}/songs/%(title)s.ogg",
"outtmpl": f"{script_dir}/songs/%(title)s.ogg", "ignoreerrors": True,
"ignoreerrors": True, "restrictfilenames": True,
"restrictfilenames": True, }
} ## download
) ydl = youtube_dl.YoutubeDL(ydl_parameters)
playlist_infos = ydl.extract_info( ydl.extract_info(
"https://www.youtube.com/playlist?list=PLQC73oq6JtgyYNOeifrJXXzZ1-F0Kgmbg", "https://www.youtube.com/playlist?list=PLQC73oq6JtgyYNOeifrJXXzZ1-F0Kgmbg",
) )
# Radio Bullshit Jingles
## change output path for Radio Bullshit jingles
ydl_parameters["outtmpl"] = f"{script_dir}/jingles/%(title)s.ogg"
## download
ydl = youtube_dl.YoutubeDL(ydl_parameters)
ydl.extract_info(
"https://www.youtube.com/playlist?list=PLQC73oq6JtgzX8zbHtP5qXKiH6cuanFWi"
)