mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-23 16:36:48 +00:00
[generic] Abort if user passes in URL "url" (#2942)
This commit is contained in:
parent
89bb8e97ee
commit
0e67ab0d8e
@ -363,6 +363,11 @@ 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':
|
||||||
|
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(
|
self._downloader.report_warning(
|
||||||
'Falling back to youtube search for %s . Set --default-search to "auto" to suppress this warning.' % url)
|
'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)
|
||||||
|
Loading…
Reference in New Issue
Block a user