3 from .common
import InfoExtractor
11 class MarkizaIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?videoarchiv\.markiza\.sk/(?:video/(?:[^/]+/)*|embed/)(?P<id>\d+)(?:[_/]|$)'
15 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/84723_oteckovia-109',
16 'md5': 'ada4e9fad038abeed971843aa028c7b0',
20 'title': 'Oteckovia 109',
21 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
22 'thumbnail': r
're:^https?://.*\.jpg$',
26 'url': 'http://videoarchiv.markiza.sk/video/televizne-noviny/televizne-noviny/85430_televizne-noviny',
29 'title': 'Televízne noviny',
33 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/84723',
34 'only_matching': True,
36 'url': 'http://videoarchiv.markiza.sk/video/84723',
37 'only_matching': True,
39 'url': 'http://videoarchiv.markiza.sk/video/filmy/85190_kamenak',
40 'only_matching': True,
42 'url': 'http://videoarchiv.markiza.sk/video/reflex/zo-zakulisia/84651_pribeh-alzbetky',
43 'only_matching': True,
45 'url': 'http://videoarchiv.markiza.sk/embed/85295',
46 'only_matching': True,
49 def _real_extract(self
, url
):
50 video_id
= self
._match
_id
(url
)
52 data
= self
._download
_json
(
53 'http://videoarchiv.markiza.sk/json/video_jwplayer7.json',
54 video_id
, query
={'id': video_id
})
56 info
= self
._parse
_jwplayer
_data
(data
, m3u8_id
='hls', mpd_id
='dash')
58 if info
.get('_type') == 'playlist':
62 data
, lambda x
: x
['details']['name'], str),
65 info
['duration'] = parse_duration(
66 try_get(data
, lambda x
: x
['details']['duration'], str))
70 class MarkizaPageIE(InfoExtractor
):
72 _VALID_URL
= r
'https?://(?:www\.)?(?:(?:[^/]+\.)?markiza|tvnoviny)\.sk/(?:[^/]+/)*(?P<id>\d+)_'
74 'url': 'http://www.markiza.sk/soubiz/zahranicny/1923705_oteckovia-maju-svoj-den-ti-slavni-nie-su-o-nic-menej-rozkosni',
75 'md5': 'ada4e9fad038abeed971843aa028c7b0',
79 'title': 'Oteckovia 110',
80 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
81 'thumbnail': r
're:^https?://.*\.jpg$',
85 'skip_download': True,
88 'url': 'http://dajto.markiza.sk/filmy-a-serialy/1774695_frajeri-vo-vegas',
89 'only_matching': True,
91 'url': 'http://superstar.markiza.sk/aktualne/1923870_to-je-ale-telo-spevacka-ukazala-sexy-postavicku-v-bikinach',
92 'only_matching': True,
94 'url': 'http://hybsa.markiza.sk/aktualne/1923790_uzasna-atmosfera-na-hybsa-v-poprade-superstaristi-si-prve-koncerty-pred-davom-ludi-poriadne-uzili',
95 'only_matching': True,
97 'url': 'http://doma.markiza.sk/filmy/1885250_moja-vysnivana-svadba',
98 'only_matching': True,
100 'url': 'http://www.tvnoviny.sk/domace/1923887_po-smrti-manzela-ju-cakalo-poriadne-prekvapenie',
101 'only_matching': True,
105 def suitable(cls
, url
):
106 return False if MarkizaIE
.suitable(url
) else super().suitable(url
)
108 def _real_extract(self
, url
):
109 playlist_id
= self
._match
_id
(url
)
111 webpage
= self
._download
_webpage
(
112 # Downloading for some hosts (e.g. dajto, doma) fails with 500
113 # although everything seems to be OK, so considering 500
114 # status code to be expected.
115 url
, playlist_id
, expected_status
=500)
118 self
.url_result(f
'http://videoarchiv.markiza.sk/video/{video_id}')
119 for video_id
in orderedSet(re
.findall(
120 r
'(?:initPlayer_|data-entity=["\']|
id=["\']player_)(\d+)',
123 return self.playlist_result(entries, playlist_id)