]>
Commit | Line | Data |
---|---|---|
1132eae5 NJ |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class GazetaIE(InfoExtractor): | |
df773c3d | 5 | _WORKING = False |
759e37c9 | 6 | _VALID_URL = r'(?P<url>https?://(?:www\.)?gazeta\.ru/(?:[^/]+/)?video/(?:main/)*(?:\d{4}/\d{2}/\d{2}/)?(?P<id>[A-Za-z0-9-_.]+)\.s?html)' |
bdf6eee0 | 7 | _TESTS = [{ |
1132eae5 NJ |
8 | 'url': 'http://www.gazeta.ru/video/main/zadaite_vopros_vladislavu_yurevichu.shtml', |
9 | 'md5': 'd49c9bdc6e5a7888f27475dc215ee789', | |
10 | 'info_dict': { | |
11 | 'id': '205566', | |
12 | 'ext': 'mp4', | |
13 | 'title': '«70–80 процентов гражданских в Донецке на грани голода»', | |
14 | 'description': 'md5:38617526050bd17b234728e7f9620a71', | |
ec85ded8 | 15 | 'thumbnail': r're:^https?://.*\.jpg', |
1132eae5 | 16 | }, |
759e37c9 | 17 | 'skip': 'video not found', |
bdf6eee0 S |
18 | }, { |
19 | 'url': 'http://www.gazeta.ru/lifestyle/video/2015/03/08/master-klass_krasivoi_byt._delaem_vesennii_makiyazh.shtml', | |
20 | 'only_matching': True, | |
759e37c9 YCH |
21 | }, { |
22 | 'url': 'http://www.gazeta.ru/video/main/main/2015/06/22/platit_ili_ne_platit_po_isku_yukosa.shtml', | |
237a4110 | 23 | 'md5': '37f19f78355eb2f4256ee1688359f24c', |
759e37c9 YCH |
24 | 'info_dict': { |
25 | 'id': '252048', | |
26 | 'ext': 'mp4', | |
27 | 'title': '"Если по иску ЮКОСа придется платить, это будет большой удар по бюджету"', | |
28 | }, | |
759e37c9 | 29 | 'add_ie': ['EaglePlatform'], |
bdf6eee0 | 30 | }] |
1132eae5 NJ |
31 | |
32 | def _real_extract(self, url): | |
5ad28e7f | 33 | mobj = self._match_valid_url(url) |
1132eae5 NJ |
34 | |
35 | display_id = mobj.group('id') | |
add96eb9 | 36 | embed_url = '{}?p=embed'.format(mobj.group('url')) |
1132eae5 NJ |
37 | embed_page = self._download_webpage( |
38 | embed_url, display_id, 'Downloading embed page') | |
39 | ||
40 | video_id = self._search_regex( | |
41 | r'<div[^>]*?class="eagleplayer"[^>]*?data-id="([^"]+)"', embed_page, 'video id') | |
42 | ||
43 | return self.url_result( | |
add96eb9 | 44 | f'eagleplatform:gazeta.media.eagleplatform.com:{video_id}', 'EaglePlatform') |