aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-05-19 17:10:11 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-05-19 17:10:11 +0200
commit0e67ab0d8e6849e7f4c84894903941b677f56131 (patch)
treec22c90469b54626a7211a912725da5f795fc602b /youtube_dl
parent89bb8e97ee82263a0f31eb3ace696d2bf7540c31 (diff)
[generic] Abort if user passes in URL "url" (#2942)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/generic.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index 0e5cf0efb..38a357d3b 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -363,8 +363,13 @@ class GenericIE(InfoExtractor):
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