From 2404fc148eaaaf99933a2a927df33414dfcc1917 Mon Sep 17 00:00:00 2001 From: Lauren Liberda Date: Sun, 28 Mar 2021 22:01:33 +0200 Subject: [PATCH] --ie-key cli option --- haruhi_dl/HaruhiDL.py | 3 +++ haruhi_dl/__init__.py | 1 + haruhi_dl/options.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/haruhi_dl/HaruhiDL.py b/haruhi_dl/HaruhiDL.py index f8cc174b5..f51686cb3 100755 --- a/haruhi_dl/HaruhiDL.py +++ b/haruhi_dl/HaruhiDL.py @@ -787,6 +787,9 @@ class HaruhiDL(object): if not ie_key and force_generic_extractor: ie_key = 'Generic' + if not ie_key: + ie_key = self.params.get('ie_key') + if ie_key: ies = [self.get_info_extractor(ie_key)] else: diff --git a/haruhi_dl/__init__.py b/haruhi_dl/__init__.py index e6e275bab..3c9ce1fcb 100644 --- a/haruhi_dl/__init__.py +++ b/haruhi_dl/__init__.py @@ -348,6 +348,7 @@ def _real_main(argv=None): 'restrictfilenames': opts.restrictfilenames, 'ignoreerrors': opts.ignoreerrors, 'force_generic_extractor': opts.force_generic_extractor, + 'ie_key': opts.ie_key, 'ratelimit': opts.ratelimit, 'nooverwrites': opts.nooverwrites, 'retries': opts.retries, diff --git a/haruhi_dl/options.py b/haruhi_dl/options.py index 72b1deeef..a7c712aa1 100644 --- a/haruhi_dl/options.py +++ b/haruhi_dl/options.py @@ -165,6 +165,10 @@ def parseOpts(overrideArguments=None): '--force-generic-extractor', action='store_true', dest='force_generic_extractor', default=False, help='Force extraction to use the generic extractor') + general.add_option( + '--ie-key', + action='store', dest='ie_key', default=None, + help='Use the specified extractor (for performance improvements on some automated commands)') general.add_option( '--default-search', dest='default_search', metavar='PREFIX',