diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-02-08 19:20:11 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-02-08 19:20:23 +0100 |
commit | 9766538124384b75c6b6cdfd8cb03ddce30136dc (patch) | |
tree | d56ae6dec3de43a0b14cd7a6a6ea14005aa430ad /youtube_dl/extractor/youtube.py | |
parent | 98dbee86815cad4d1fe1befab328033a16c56df6 (diff) |
[jadorecettepub] Add extractor (Fixes #2148)
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 765c690f1..e038c7752 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1085,8 +1085,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): self._downloader.report_warning(err_msg) return {} - def _extract_id(self, url): - mobj = re.match(self._VALID_URL, url, re.VERBOSE) + @classmethod + def extract_id(cls, url): + mobj = re.match(cls._VALID_URL, url, re.VERBOSE) if mobj is None: raise ExtractorError(u'Invalid URL: %s' % url) video_id = mobj.group(2) @@ -1115,7 +1116,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): mobj = re.search(self._NEXT_URL_RE, url) if mobj: url = 'https://www.youtube.com/' + compat_urllib_parse.unquote(mobj.group(1)).lstrip('/') - video_id = self._extract_id(url) + video_id = self.extract_id(url) # Get video webpage url = 'https://www.youtube.com/watch?v=%s&gl=US&hl=en&has_verified=1' % video_id |