2015-03-08 11:54:01 +00:00
|
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GazetaIE(InfoExtractor):
|
2024-03-09 00:02:45 +00:00
|
|
|
|
_WORKING = False
|
2016-04-16 08:48:47 +00:00
|
|
|
|
_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)'
|
2015-03-08 13:17:54 +00:00
|
|
|
|
_TESTS = [{
|
2015-03-08 11:54:01 +00:00
|
|
|
|
'url': 'http://www.gazeta.ru/video/main/zadaite_vopros_vladislavu_yurevichu.shtml',
|
|
|
|
|
'md5': 'd49c9bdc6e5a7888f27475dc215ee789',
|
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': '205566',
|
|
|
|
|
'ext': 'mp4',
|
|
|
|
|
'title': '«70–80 процентов гражданских в Донецке на грани голода»',
|
|
|
|
|
'description': 'md5:38617526050bd17b234728e7f9620a71',
|
2017-01-02 12:08:07 +00:00
|
|
|
|
'thumbnail': r're:^https?://.*\.jpg',
|
2015-03-08 11:54:01 +00:00
|
|
|
|
},
|
2016-04-16 08:48:47 +00:00
|
|
|
|
'skip': 'video not found',
|
2015-03-08 13:17:54 +00:00
|
|
|
|
}, {
|
|
|
|
|
'url': 'http://www.gazeta.ru/lifestyle/video/2015/03/08/master-klass_krasivoi_byt._delaem_vesennii_makiyazh.shtml',
|
|
|
|
|
'only_matching': True,
|
2016-04-16 08:48:47 +00:00
|
|
|
|
}, {
|
|
|
|
|
'url': 'http://www.gazeta.ru/video/main/main/2015/06/22/platit_ili_ne_platit_po_isku_yukosa.shtml',
|
2016-04-22 13:32:38 +00:00
|
|
|
|
'md5': '37f19f78355eb2f4256ee1688359f24c',
|
2016-04-16 08:48:47 +00:00
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': '252048',
|
|
|
|
|
'ext': 'mp4',
|
|
|
|
|
'title': '"Если по иску ЮКОСа придется платить, это будет большой удар по бюджету"',
|
|
|
|
|
},
|
|
|
|
|
'add_ie': ['EaglePlatform'],
|
2015-03-08 13:17:54 +00:00
|
|
|
|
}]
|
2015-03-08 11:54:01 +00:00
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2021-08-19 01:41:24 +00:00
|
|
|
|
mobj = self._match_valid_url(url)
|
2015-03-08 11:54:01 +00:00
|
|
|
|
|
|
|
|
|
display_id = mobj.group('id')
|
2024-06-11 23:09:58 +00:00
|
|
|
|
embed_url = '{}?p=embed'.format(mobj.group('url'))
|
2015-03-08 11:54:01 +00:00
|
|
|
|
embed_page = self._download_webpage(
|
|
|
|
|
embed_url, display_id, 'Downloading embed page')
|
|
|
|
|
|
|
|
|
|
video_id = self._search_regex(
|
|
|
|
|
r'<div[^>]*?class="eagleplayer"[^>]*?data-id="([^"]+)"', embed_page, 'video id')
|
|
|
|
|
|
|
|
|
|
return self.url_result(
|
2024-06-11 23:09:58 +00:00
|
|
|
|
f'eagleplatform:gazeta.media.eagleplatform.com:{video_id}', 'EaglePlatform')
|