From 13d08e303e0d623eb1e4c88fdbf1ae71764be78c Mon Sep 17 00:00:00 2001 From: jakeogh Date: Sat, 19 Oct 2013 14:59:46 -0700 Subject: [PATCH] added --no-generic option to skip the generic information extractor. --- youtube_dl/__init__.py | 1 + youtube_dl/extractor/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index fce1adf0c..c7c748dfa 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -198,6 +198,7 @@ def parseOpts(overrideArguments=None): help='Output descriptions of all supported extractors', default=False) general.add_option('--proxy', dest='proxy', default=None, help='Use the specified HTTP/HTTPS proxy', metavar='URL') general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.') + general.add_option('--no-generic', action='store_true', dest='no_generic', default=False, help='Do not attempt to fall back on the generic information extractor.') general.add_option( '--cache-dir', dest='cachedir', default=get_cachedir(), metavar='DIR', help='Location in the filesystem where youtube-dl can store downloaded information permanently. By default $XDG_CACHE_HOME/youtube-dl or ~/.cache/youtube-dl .') diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index db69af361..01a9cea86 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -1,3 +1,4 @@ +import sys from .appletrailers import AppleTrailersIE from .addanime import AddAnimeIE from .archiveorg import ArchiveOrgIE @@ -170,7 +171,9 @@ _ALL_CLASSES = [ for name, klass in globals().items() if name.endswith('IE') and name != 'GenericIE' ] -_ALL_CLASSES.append(GenericIE) + +if '--no-generic' not in sys.argv: + _ALL_CLASSES.append(GenericIE) def gen_extractors():