diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-09-01 16:34:05 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-09-01 16:34:05 +0800 |
commit | cdc8d0c37325e83da0c08ee4d97d81040e10be91 (patch) | |
tree | 7f0cd0f36d8d7f85e2926e077307d74f6ae5baf3 | |
parent | 39955b0451098c6a79fc7b777a0674ee093ae0ff (diff) |
[odnoklassniki] Fix extraction and extend _VALID_URL (closes #6726)
-rw-r--r-- | youtube_dl/extractor/odnoklassniki.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/extractor/odnoklassniki.py b/youtube_dl/extractor/odnoklassniki.py index 003d27de7..f552e6f7e 100644 --- a/youtube_dl/extractor/odnoklassniki.py +++ b/youtube_dl/extractor/odnoklassniki.py @@ -12,7 +12,7 @@ from ..utils import ( class OdnoklassnikiIE(InfoExtractor): - _VALID_URL = r'https?://(?:odnoklassniki|ok)\.ru/(?:video|web-api/video/moviePlayer)/(?P<id>[\d-]+)' + _VALID_URL = r'https?://(?:www\.)?(?:odnoklassniki|ok)\.ru/(?:video|web-api/video/moviePlayer)/(?P<id>[\d-]+)' _TESTS = [{ # metadata in JSON 'url': 'http://ok.ru/video/20079905452', @@ -46,6 +46,9 @@ class OdnoklassnikiIE(InfoExtractor): }, { 'url': 'http://ok.ru/web-api/video/moviePlayer/20079905452', 'only_matching': True, + }, { + 'url': 'http://www.ok.ru/video/20648036891', + 'only_matching': True, }] def _real_extract(self, url): @@ -56,7 +59,7 @@ class OdnoklassnikiIE(InfoExtractor): player = self._parse_json( unescapeHTML(self._search_regex( - r'data-attributes="([^"]+)"', webpage, 'player')), + r'data-options="([^"]+)"', webpage, 'player')), video_id) flashvars = player['flashvars'] |