From ad3ebe9a777ac5e5115b5dd95ad765bc5bdabe42 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 4 Mar 2020 00:23:52 -0600 Subject: [PATCH] IT WORKS Now for ID3 --- badwitch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/badwitch.py b/badwitch.py index d0ab359..6b40430 100755 --- a/badwitch.py +++ b/badwitch.py @@ -64,10 +64,11 @@ class Library: destpath = (Path.home() / 'Music' / artist / album) Path(destpath).mkdir(parents=True, exist_ok=True) for song, songcontent in albumcontent.items(): + destfile = str(destpath / song) + '.%(ext)s' # See if we already have it matches = sorted(Path(destpath).glob(song + '.*')) if not matches == []: - logging.debug('Using cached song: ' + song) + logging.info('Already have song: ' + song) continue # Download the song ytdl_opts = { @@ -77,8 +78,9 @@ class Library: 'preferredcodec': 'opus', 'preferredquality': '192' }], - 'extract_audio': True, + 'quiet': True, 'playlist_items': 1, + 'outtmpl': destfile } with youtube_dl.YoutubeDL(ytdl_opts) as ydl: ydl.download([songcontent['source']])