+
+
+class MyviEmbedIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?myvi\.tv/(?:[^?]+\?.*?\bv=|embed/)(?P<id>[\da-z]+)'
+ _TESTS = [{
+ 'url': 'https://www.myvi.tv/embed/ccdqic3wgkqwpb36x9sxg43t4r',
+ 'info_dict': {
+ 'id': 'b3ea0663-3234-469d-873e-7fecf36b31d1',
+ 'ext': 'mp4',
+ 'title': 'Твоя (original song).mp4',
+ 'thumbnail': r're:^https?://.*\.jpg$',
+ 'duration': 277,
+ },
+ 'params': {
+ 'skip_download': True,
+ },
+ }, {
+ 'url': 'https://www.myvi.tv/idmi6o?v=ccdqic3wgkqwpb36x9sxg43t4r#watch',
+ 'only_matching': True,
+ }]
+
+ @classmethod
+ def suitable(cls, url):
+ return False if MyviIE.suitable(url) else super(MyviEmbedIE, cls).suitable(url)
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+
+ webpage = self._download_webpage(
+ 'https://www.myvi.tv/embed/%s' % video_id, video_id)
+
+ myvi_id = self._search_regex(
+ r'CreatePlayer\s*\(\s*["\'].*?\bv=([\da-zA-Z_]+)',
+ webpage, 'video id')
+
+ return self.url_result('myvi:%s' % myvi_id, ie=MyviIE.ie_key())