mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-29 21:52:54 +00:00
[generic] Allow --default-search without colon
This commit is contained in:
parent
4661e243f8
commit
f2f2c0c2c6
2 changed files with 2 additions and 3 deletions
|
@ -255,8 +255,6 @@ def _real_main(argv=None):
|
||||||
date = DateRange.day(opts.date)
|
date = DateRange.day(opts.date)
|
||||||
else:
|
else:
|
||||||
date = DateRange(opts.dateafter, opts.datebefore)
|
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
|
# Do not download videos when there are audio-only formats
|
||||||
if opts.extractaudio and not opts.keepvideo and opts.format is None:
|
if opts.extractaudio and not opts.keepvideo and opts.format is None:
|
||||||
|
|
|
@ -487,7 +487,8 @@ class GenericIE(InfoExtractor):
|
||||||
'Set --default-search "ytsearch" (or run youtube-dl "ytsearch:%s" ) to search YouTube'
|
'Set --default-search "ytsearch" (or run youtube-dl "ytsearch:%s" ) to search YouTube'
|
||||||
) % (url, url), expected=True)
|
) % (url, url), expected=True)
|
||||||
else:
|
else:
|
||||||
assert ':' in default_search
|
if ':' not in default_search:
|
||||||
|
default_search += ':'
|
||||||
return self.url_result(default_search + url)
|
return self.url_result(default_search + url)
|
||||||
|
|
||||||
url, smuggled_data = unsmuggle_url(url)
|
url, smuggled_data = unsmuggle_url(url)
|
||||||
|
|
Loading…
Reference in a new issue