first commit
This commit is contained in:
22
yt_sync.py
Normal file
22
yt_sync.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import os
|
||||
import youtube_dl
|
||||
|
||||
|
||||
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(
|
||||
"https://www.youtube.com/playlist?list=PLQC73oq6JtgyYNOeifrJXXzZ1-F0Kgmbg",
|
||||
)
|
||||
Reference in New Issue
Block a user