aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/external.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-02-05 10:48:13 -0500
committerJesús <heckyel@hyperbola.info>2022-02-05 10:48:13 -0500
commitc4b763b19f54ed5dfc2fd408adb9ed74126f6740 (patch)
tree1bbf4450644370608f97bf6d4d7db818c5039f55 /yt_dlp/downloader/external.py
parent5aac4e0267e32d98eb68692afedafda3b41ea629 (diff)
parenta3125791c7a5cdf2c8c025b99788bf686edd1a8a (diff)
downloadhypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.lz
hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.xz
hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.zip
updated from upstream | 05/02/2022 at 10:48
Diffstat (limited to 'yt_dlp/downloader/external.py')
-rw-r--r--yt_dlp/downloader/external.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py
index 17be3c46f..f4fdcf120 100644
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -17,11 +17,13 @@ from ..utils import (
cli_valueless_option,
cli_bool_option,
_configuration_args,
+ determine_ext,
encodeFilename,
encodeArgument,
handle_youtubedl_headers,
check_executable,
Popen,
+ remove_end,
)
@@ -304,7 +306,7 @@ class HttpieFD(ExternalFD):
@classmethod
def available(cls, path=None):
- return ExternalFD.available(cls, path or 'http')
+ return super().available(path or 'http')
def _make_cmd(self, tmpfilename, info_dict):
cmd = ['http', '--download', '--output', tmpfilename, info_dict['url']]
@@ -463,6 +465,15 @@ class FFmpegFD(ExternalFD):
args += ['-f', 'flv']
elif ext == 'mp4' and tmpfilename == '-':
args += ['-f', 'mpegts']
+ elif ext == 'unknown_video':
+ ext = determine_ext(remove_end(tmpfilename, '.part'))
+ if ext == 'unknown_video':
+ self.report_warning(
+ 'The video format is unknown and cannot be downloaded by ffmpeg. '
+ 'Explicitly set the extension in the filename to attempt download in that format')
+ else:
+ self.report_warning(f'The video format is unknown. Trying to download as {ext} according to the filename')
+ args += ['-f', EXT_TO_OUT_FORMATS.get(ext, ext)]
else:
args += ['-f', EXT_TO_OUT_FORMATS.get(ext, ext)]