From e4f0fba2239e309a89dc7a8385232189bc2c0795 Mon Sep 17 00:00:00 2001 From: Aethor Date: Sat, 12 Jun 2021 12:46:44 +0200 Subject: [PATCH] Added Radio Bullshit Jingles to yt_sync.py --- yt_sync.py | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/yt_sync.py b/yt_sync.py index 8d77be5..c97e6da 100644 --- a/yt_sync.py +++ b/yt_sync.py @@ -1,3 +1,4 @@ +#!/usr/bin/python3 import os import youtube_dl @@ -6,17 +7,26 @@ if __name__ == "__main__": script_dir = os.path.dirname(os.path.abspath(__file__)) - ydl = youtube_dl.YoutubeDL( - { - "format": "bestaudio/best", - "postprocessors": [ - {"key": "FFmpegExtractAudio", "preferredcodec": "vorbis"} - ], - "outtmpl": f"{script_dir}/songs/%(title)s.ogg", - "ignoreerrors": True, - "restrictfilenames": True, - } - ) - playlist_infos = ydl.extract_info( + # Radio Bullshit + ## parameters for Radio Bullshit playlist + ydl_parameters = { + "format": "bestaudio/best", + "postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "vorbis"}], + "outtmpl": f"{script_dir}/songs/%(title)s.ogg", + "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"{script_dir}/jingles/%(title)s.ogg" + ## download + ydl = youtube_dl.YoutubeDL(ydl_parameters) + ydl.extract_info( + "https://www.youtube.com/playlist?list=PLQC73oq6JtgzX8zbHtP5qXKiH6cuanFWi" + )