diff --git a/main.py b/main.py index c381ad2..056e7da 100755 --- a/main.py +++ b/main.py @@ -464,17 +464,18 @@ async def process_radio_track(video_link, video_id, title): dl_cmd = [ "yt-dlp", "--extract-audio", - "--output", - f"{base_filepath}.%(ext)s", - video_link, + "--output", f"{base_filepath}.%(ext)s", + video_link ] - process = await asyncio.create_subprocess_exec( *dl_cmd, - stdout=asyncio.subprocess.DEVNULL, - stderr=asyncio.subprocess.DEVNULL, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE ) - await process.communicate() + stdout, stderr = await process.communicate() + if process.returncode != 0: + print(f"❌ yt-dlp crashed! Error:\n{stderr.decode().strip()}") + return # Check for the file using glob downloaded_files = glob.glob(f"{base_filepath}.*")