1 from __future__ import unicode_literals
5 from .common import InfoExtractor
6 from ..utils import ExtractorError
9 class CommonMistakesIE(InfoExtractor):
10 IE_DESC = False # Do not list
17 'only_matching': True,
20 'only_matching': True,
23 def _real_extract(self, url):
25 'You\'ve asked youtube-dl to download the URL "%s". '
26 'That doesn\'t make any sense. '
27 'Simply remove the parameter in your command or configuration.'
29 if not self._downloader.params.get('verbose'):
30 msg += ' Add -v to the command line to see what arguments and configuration youtube-dl got.'
31 raise ExtractorError(msg, expected=True)
34 class UnicodeBOMIE(InfoExtractor):
36 _VALID_URL = r'(?P<bom>\ufeff)(?P<id>.*)$'
38 # Disable test for python 3.2 since BOM is broken in re in this version
39 # (see https://github.com/ytdl-org/youtube-dl/issues/9751)
40 _TESTS = [] if (3, 0) < sys.version_info <= (3, 3) else [{
41 'url': '\ufeffhttp://www.youtube.com/watch?v=BaW_jenozKc',
42 'only_matching': True,
45 def _real_extract(self, url):
46 real_url = self._match_id(url)
48 'Your URL starts with a Byte Order Mark (BOM). '
49 'Removing the BOM and looking for "%s" ...' % real_url)
50 return self.url_result(real_url)