aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/external.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-07-31 16:21:01 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-08-01 12:38:05 +0530
commitdbf5416a20b8a4ff301ef6c641f516fa20a546cb (patch)
tree959c28dd0afea7a2571066765eeb744b5d0a826e /yt_dlp/downloader/external.py
parentd74a58a186603670f0f8acbc07a54f6381ca267f (diff)
downloadhypervideo-pre-dbf5416a20b8a4ff301ef6c641f516fa20a546cb.tar.lz
hypervideo-pre-dbf5416a20b8a4ff301ef6c641f516fa20a546cb.tar.xz
hypervideo-pre-dbf5416a20b8a4ff301ef6c641f516fa20a546cb.zip
[cleanup] Refactor some code
Diffstat (limited to 'yt_dlp/downloader/external.py')
-rw-r--r--yt_dlp/downloader/external.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py
index d0ee745b3..b2a605458 100644
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -345,12 +345,22 @@ class FFmpegFD(ExternalFD):
@classmethod
def available(cls, path=None):
# TODO: Fix path for ffmpeg
+ # Fixme: This may be wrong when --ffmpeg-location is used
return FFmpegPostProcessor().available
def on_process_started(self, proc, stdin):
""" Override this in subclasses """
pass
+ @classmethod
+ def can_merge_formats(cls, info_dict, params={}):
+ return (
+ info_dict.get('requested_formats')
+ and info_dict.get('protocol')
+ and not params.get('allow_unplayable_formats')
+ and 'no-direct-merge' not in params.get('compat_opts', [])
+ and cls.can_download(info_dict))
+
def _call_downloader(self, tmpfilename, info_dict):
urls = [f['url'] for f in info_dict.get('requested_formats', [])] or [info_dict['url']]
ffpp = FFmpegPostProcessor(downloader=self)