diff --git a/bot/services/yt.py b/bot/services/yt.py index 0d2251d..55446aa 100644 --- a/bot/services/yt.py +++ b/bot/services/yt.py @@ -67,6 +67,7 @@ class YtService(_Service): try: info = track.extra_info if not info: + # fallback ke parent class kalo gak ada info super().download(track, file_path) return @@ -74,8 +75,11 @@ class YtService(_Service): ydl_opts["outtmpl"] = file_path.rsplit(".", 1)[0] + ".mp3" with YoutubeDL(ydl_opts) as ydl: - dl = get_suitable_downloader(info)(ydl, ydl_opts) - dl.download(file_path, info) + # Download langsung pakai URL dari info + url = info.get("webpage_url") + if not url: + raise errors.ServiceError("Missing webpage_url in track info") + ydl.download([url]) except Exception as e: logging.error(f"Download error: {str(e)}", exc_info=True)