This commit is contained in:
parent
a1e9bb6330
commit
167389067d
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user