]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/myvi.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from .vimple
import SprutoBaseIE
10 class MyviIE(SprutoBaseIE
):
24 content/preloader\.swf\?.*\bid=
33 'url': 'http://myvi.ru/player/embed/html/oOy4euHA6LVwNNAjhD9_Jq5Ha2Qf0rtVMVFMAZav8wObeRTZaCATzucDQIDph8hQU0',
34 'md5': '571bbdfba9f9ed229dc6d34cc0f335bf',
36 'id': 'f16b2bbd-cde8-481c-a981-7cd48605df43',
38 'title': 'хозяин жизни',
39 'thumbnail': r
're:^https?://.*\.jpg$',
43 'url': 'http://myvi.ru/player/content/preloader.swf?id=oOy4euHA6LVwNNAjhD9_Jq5Ha2Qf0rtVMVFMAZav8wOYf1WFpPfc_bWTKGVf_Zafr0',
44 'only_matching': True,
46 'url': 'http://myvi.ru/player/api/Video/Get/oOy4euHA6LVwNNAjhD9_Jq5Ha2Qf0rtVMVFMAZav8wObeRTZaCATzucDQIDph8hQU0',
47 'only_matching': True,
49 'url': 'http://myvi.tv/embed/html/oTGTNWdyz4Zwy_u1nraolwZ1odenTd9WkTnRfIL9y8VOgHYqOHApE575x4_xxS9Vn0?ap=0',
50 'only_matching': True,
52 'url': 'http://myvi.ru/player/flash/ocp2qZrHI-eZnHKQBK4cZV60hslH8LALnk0uBfKsB-Q4WnY26SeGoYPi8HWHxu0O30',
53 'only_matching': True,
55 'url': 'https://www.myvi.ru/watch/YwbqszQynUaHPn_s82sx0Q2',
56 'only_matching': True,
58 'url': 'myvi:YwbqszQynUaHPn_s82sx0Q2',
59 'only_matching': True,
63 def _extract_url(cls
, webpage
):
65 r
'<iframe[^>]+?src=(["\'])(?P
<url
>(?
:https?
:)?
//myvi\
.(?
:ru
/player|tv
)/(?
:embed
/html|flash
)/[^
"]+)\1', webpage)
67 return mobj.group('url')
69 def _real_extract(self, url):
70 video_id = self._match_id(url)
72 spruto = self._download_json(
73 'http://myvi.ru/player/api/Video/Get/%s?sig' % video_id, video_id)['sprutoData']
75 return self._extract_spruto(spruto, video_id)
78 class MyviEmbedIE(InfoExtractor):
79 _VALID_URL = r'https?://(?:www\.)?myvi\.tv/(?:[^?]+\?.*?\bv=|embed/)(?P<id>[\da-z]+)'
81 'url': 'https://www.myvi.tv/embed/ccdqic3wgkqwpb36x9sxg43t4r',
83 'id': 'b3ea0663-3234-469d-873e-7fecf36b31d1',
85 'title': 'Твоя (original song).mp4',
86 'thumbnail': r're:^https?://.*\.jpg$',
90 'skip_download': True,
93 'url': 'https://www.myvi.tv/idmi6o?v=ccdqic3wgkqwpb36x9sxg43t4r#watch',
94 'only_matching': True,
98 def suitable(cls, url):
99 return False if MyviIE.suitable(url) else super(MyviEmbedIE, cls).suitable(url)
101 def _real_extract(self, url):
102 video_id = self._match_id(url)
104 webpage = self._download_webpage(
105 'https://www.myvi.tv/embed/%s' % video_id, video_id)
107 myvi_id = self._search_regex(
108 r'CreatePlayer\s*\(\s*["\'].*?
\bv
=([\da
-zA
-Z_
]+)',
111 return self.url_result('myvi
:%s' % myvi_id, ie=MyviIE.ie_key())