[generic] Abort if user passes in URL "url" (#2942)

This commit is contained in:
Philipp Hagemeister 2014-05-19 17:10:11 +02:00
parent 89bb8e97ee
commit 0e67ab0d8e

View File

@ -363,8 +363,13 @@ def _real_extract(self, url):
return self.url_result('http://' + url)
else:
if default_search == 'auto_warning':
self._downloader.report_warning(
'Falling back to youtube search for %s . Set --default-search to "auto" to suppress this warning.' % url)
if re.match(r'^(?:url|URL)$', url):
raise ExtractorError(
'Invalid URL: %r . Call youtube-dl like this: youtube-dl -v "https://www.youtube.com/watch?v=BaW_jenozKc" ' % url,
expected=True)
else:
self._downloader.report_warning(
'Falling back to youtube search for %s . Set --default-search to "auto" to suppress this warning.' % url)
return self.url_result('ytsearch:' + url)
else:
assert ':' in default_search