From f2f2c0c2c642aecc1a8954ad3d8639425036e066 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Thu, 23 Oct 2014 21:13:45 +0200 Subject: [PATCH] [generic] Allow --default-search without colon --- youtube_dl/__init__.py | 2 -- youtube_dl/extractor/generic.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 7f2b4dfcc..a53f6a621 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -255,8 +255,6 @@ def _real_main(argv=None): date = DateRange.day(opts.date) else: date = DateRange(opts.dateafter, opts.datebefore) - if opts.default_search not in ('auto', 'auto_warning', 'error', 'fixup_error', None) and ':' not in opts.default_search: - parser.error(u'--default-search invalid; did you forget a colon (:) at the end?') # Do not download videos when there are audio-only formats if opts.extractaudio and not opts.keepvideo and opts.format is None: diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index e13816c66..9b6498894 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -487,7 +487,8 @@ class GenericIE(InfoExtractor): 'Set --default-search "ytsearch" (or run youtube-dl "ytsearch:%s" ) to search YouTube' ) % (url, url), expected=True) else: - assert ':' in default_search + if ':' not in default_search: + default_search += ':' return self.url_result(default_search + url) url, smuggled_data = unsmuggle_url(url)