Fix: dont reject downloads if they provide a info.url only.
This commit is contained in:
parent
4d22e345e5
commit
b3ee857ceb
2 changed files with 4 additions and 2 deletions
|
|
@ -287,7 +287,8 @@ class Download:
|
||||||
f"Live stream detected for '{self.info.title}', The following opts '{deletedOpts=}' have been deleted."
|
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}'."
|
msg: str = f"Failed to extract any formats for '{self.info.url}'."
|
||||||
if filtered_logs := extract_ytdlp_logs(self.logs):
|
if filtered_logs := extract_ytdlp_logs(self.logs):
|
||||||
msg += " " + ", ".join(filtered_logs)
|
msg += " " + ", ".join(filtered_logs)
|
||||||
|
|
|
||||||
|
|
@ -513,6 +513,7 @@ class DownloadQueue(metaclass=Singleton):
|
||||||
nTitle: str | None = None
|
nTitle: str | None = None
|
||||||
nMessage: str | None = None
|
nMessage: str | None = None
|
||||||
nStore: str = "queue"
|
nStore: str = "queue"
|
||||||
|
hasFormats: bool = len(entry.get("formats", [])) > 0 or entry.get("url")
|
||||||
|
|
||||||
text_logs: str = ""
|
text_logs: str = ""
|
||||||
if filtered_logs := extract_ytdlp_logs(logs):
|
if filtered_logs := extract_ytdlp_logs(logs):
|
||||||
|
|
@ -534,7 +535,7 @@ class DownloadQueue(metaclass=Singleton):
|
||||||
)
|
)
|
||||||
|
|
||||||
itemDownload: Download = self.done.put(dlInfo)
|
itemDownload: Download = self.done.put(dlInfo)
|
||||||
elif len(entry.get("formats", [])) < 1:
|
elif not hasFormats:
|
||||||
ava: str = entry.get("availability", "public")
|
ava: str = entry.get("availability", "public")
|
||||||
nTitle = "Download Error"
|
nTitle = "Download Error"
|
||||||
nMessage: str = f"No formats for '{dl.title}'."
|
nMessage: str = f"No formats for '{dl.title}'."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue