diff --git a/spotdl/download/downloader.py b/spotdl/download/downloader.py index 3f5a4aa5f..9a482d1ac 100644 --- a/spotdl/download/downloader.py +++ b/spotdl/download/downloader.py @@ -164,6 +164,8 @@ async def download_song(self, song_object: SongObject) -> None: if self.arguments["output_format"] == "m4a": ytdl_format = "bestaudio[ext=m4a]" + elif self.arguments["output_format"] == "opus": + ytdl_format = "bestaudio[ext=webm]" else: ytdl_format = "bestaudio" diff --git a/spotdl/search/song_gatherer.py b/spotdl/search/song_gatherer.py index e2c6ec889..4a7fb0e91 100644 --- a/spotdl/search/song_gatherer.py +++ b/spotdl/search/song_gatherer.py @@ -241,7 +241,7 @@ def get_song(track): ) except (LookupError, ValueError): return None, None - else: + except OSError: if generate_m3u: file_path = ( str( @@ -268,8 +268,10 @@ def get_song(track): else "mp3" ) - return song, f"{file_path}\n" + return None, f"{file_path}\n" + return None, None + else: return song, None with concurrent.futures.ThreadPoolExecutor(max_workers=threads) as executor: