yt_sync.py now use global songs and jingles folders

This commit is contained in:
Aethor 2021-06-12 12:58:25 +02:00
parent e4f0fba223
commit 8153232f66
1 changed files with 4 additions and 3 deletions

View File

@ -5,14 +5,15 @@ import youtube_dl
if __name__ == "__main__":
script_dir = os.path.dirname(os.path.abspath(__file__))
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"{script_dir}/songs/%(title)s.ogg",
"outtmpl": f"{songs_folder}/%(title)s.ogg",
"ignoreerrors": True,
"restrictfilenames": True,
}
@ -24,7 +25,7 @@ if __name__ == "__main__":
# Radio Bullshit Jingles
## change output path for Radio Bullshit jingles
ydl_parameters["outtmpl"] = f"{script_dir}/jingles/%(title)s.ogg"
ydl_parameters["outtmpl"] = f"{jingles_folder}/%(title)s.ogg"
## download
ydl = youtube_dl.YoutubeDL(ydl_parameters)
ydl.extract_info(