[youtube] Warn if URL is most likely wrong (#969)
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 1 Jul 2013 00:29:29 +0000 (02:29 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 1 Jul 2013 00:29:29 +0000 (02:29 +0200)
youtube_dl/extractor/youtube.py

index 025afb3904ed62da925fb8d7b5db2501cd7b9805..109c8a93fa9ca7cb4caeca87462e1385a802bb69 100644 (file)
@@ -402,6 +402,9 @@ class YoutubeIE(InfoExtractor):
         return video_id
 
     def _real_extract(self, url):
+        if re.match(r'(?:https?://)?[^/]+/watch\?feature=[a-z_]+$', url):
+            self._downloader.report_warning(u'Did you forget to quote the URL? Remember that & is a meta-character in most shells, so you want to put the URL in quotes, like  youtube-dl \'http://www.youtube.com/watch?feature=foo&v=BaW_jenozKc\' (or simply  youtube-dl BaW_jenozKc  ).')
+
         # Extract original video URL from URL with redirection, like age verification, using next_url parameter
         mobj = re.search(self._NEXT_URL_RE, url)
         if mobj: