Fix: dont reject downloads if they provide a info.url only.

This commit is contained in:
arabcoders 2025-11-22 15:30:14 +03:00
parent 4d22e345e5
commit b3ee857ceb
2 changed files with 4 additions and 2 deletions

View file

@ -287,7 +287,8 @@ class Download:
f"Live stream detected for '{self.info.title}', The following opts '{deletedOpts=}' have been deleted."
)
if isinstance(self.info_dict, dict) and len(self.info_dict.get("formats", [])) < 1:
hasFormats: bool = len(self.info_dict.get("formats", [])) > 0 or self.info_dict.get("url")
if isinstance(self.info_dict, dict) and not hasFormats:
msg: str = f"Failed to extract any formats for '{self.info.url}'."
if filtered_logs := extract_ytdlp_logs(self.logs):
msg += " " + ", ".join(filtered_logs)

View file

@ -513,6 +513,7 @@ class DownloadQueue(metaclass=Singleton):
nTitle: str | None = None
nMessage: str | None = None
nStore: str = "queue"
hasFormats: bool = len(entry.get("formats", [])) > 0 or entry.get("url")
text_logs: str = ""
if filtered_logs := extract_ytdlp_logs(logs):
@ -534,7 +535,7 @@ class DownloadQueue(metaclass=Singleton):
)
itemDownload: Download = self.done.put(dlInfo)
elif len(entry.get("formats", [])) < 1:
elif not hasFormats:
ava: str = entry.get("availability", "public")
nTitle = "Download Error"
nMessage: str = f"No formats for '{dl.title}'."