Browse Source

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

master
Philipp Hagemeister 10 years ago
parent
commit
0e67ab0d8e
1 changed files with 7 additions and 2 deletions
  1. 9
      youtube_dl/extractor/generic.py

9
youtube_dl/extractor/generic.py

@ -363,8 +363,13 @@ class GenericIE(InfoExtractor):
return self.url_result('http://' + url) return self.url_result('http://' + url)
else: else:
if default_search == 'auto_warning': 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) return self.url_result('ytsearch:' + url)
else: else:
assert ':' in default_search assert ':' in default_search

Loading…
Cancel
Save