[downloader:ytdl] fix exception due to missing 'ext' (#5675)

pull/5712/head
Mike Fährmann 4 months ago
parent 5d3d03a1f1
commit 3ec7ee6baa
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -89,6 +89,11 @@ class YoutubeDLDownloader(DownloaderBase):
formats = info_dict.get("requested_formats")
if formats and not compatible_formats(formats):
info_dict["ext"] = "mkv"
elif "ext" not in info_dict:
try:
info_dict["ext"] = info_dict["formats"][0]["ext"]
except LookupError:
info_dict["ext"] = "mp4"
if self.outtmpl:
self._set_outtmpl(ytdl_instance, self.outtmpl)

Loading…
Cancel
Save