]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/markiza.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..compat
import compat_str
15 class MarkizaIE(InfoExtractor
):
16 _VALID_URL
= r
'https?://(?:www\.)?videoarchiv\.markiza\.sk/(?:video/(?:[^/]+/)*|embed/)(?P<id>\d+)(?:[_/]|$)'
18 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/84723_oteckovia-109',
19 'md5': 'ada4e9fad038abeed971843aa028c7b0',
23 'title': 'Oteckovia 109',
24 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
25 'thumbnail': r
're:^https?://.*\.jpg$',
29 'url': 'http://videoarchiv.markiza.sk/video/televizne-noviny/televizne-noviny/85430_televizne-noviny',
32 'title': 'Televízne noviny',
36 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/84723',
37 'only_matching': True,
39 'url': 'http://videoarchiv.markiza.sk/video/84723',
40 'only_matching': True,
42 'url': 'http://videoarchiv.markiza.sk/video/filmy/85190_kamenak',
43 'only_matching': True,
45 'url': 'http://videoarchiv.markiza.sk/video/reflex/zo-zakulisia/84651_pribeh-alzbetky',
46 'only_matching': True,
48 'url': 'http://videoarchiv.markiza.sk/embed/85295',
49 'only_matching': True,
52 def _real_extract(self
, url
):
53 video_id
= self
._match
_id
(url
)
55 data
= self
._download
_json
(
56 'http://videoarchiv.markiza.sk/json/video_jwplayer7.json',
57 video_id
, query
={'id': video_id
})
59 info
= self
._parse
_jwplayer
_data
(data
, m3u8_id
='hls', mpd_id
='dash')
61 if info
.get('_type') == 'playlist':
65 data
, lambda x
: x
['details']['name'], compat_str
),
68 info
['duration'] = parse_duration(
69 try_get(data
, lambda x
: x
['details']['duration'], compat_str
))
73 class MarkizaPageIE(InfoExtractor
):
74 _VALID_URL
= r
'https?://(?:www\.)?(?:(?:[^/]+\.)?markiza|tvnoviny)\.sk/(?:[^/]+/)*(?P<id>\d+)_'
76 'url': 'http://www.markiza.sk/soubiz/zahranicny/1923705_oteckovia-maju-svoj-den-ti-slavni-nie-su-o-nic-menej-rozkosni',
77 'md5': 'ada4e9fad038abeed971843aa028c7b0',
81 'title': 'Oteckovia 110',
82 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
83 'thumbnail': r
're:^https?://.*\.jpg$',
87 'skip_download': True,
90 'url': 'http://dajto.markiza.sk/filmy-a-serialy/1774695_frajeri-vo-vegas',
91 'only_matching': True,
93 'url': 'http://superstar.markiza.sk/aktualne/1923870_to-je-ale-telo-spevacka-ukazala-sexy-postavicku-v-bikinach',
94 'only_matching': True,
96 'url': 'http://hybsa.markiza.sk/aktualne/1923790_uzasna-atmosfera-na-hybsa-v-poprade-superstaristi-si-prve-koncerty-pred-davom-ludi-poriadne-uzili',
97 'only_matching': True,
99 'url': 'http://doma.markiza.sk/filmy/1885250_moja-vysnivana-svadba',
100 'only_matching': True,
102 'url': 'http://www.tvnoviny.sk/domace/1923887_po-smrti-manzela-ju-cakalo-poriadne-prekvapenie',
103 'only_matching': True,
107 def suitable(cls
, url
):
108 return False if MarkizaIE
.suitable(url
) else super(MarkizaPageIE
, cls
).suitable(url
)
110 def _real_extract(self
, url
):
111 playlist_id
= self
._match
_id
(url
)
113 webpage
= self
._download
_webpage
(url
, playlist_id
)
116 self
.url_result('http://videoarchiv.markiza.sk/video/%s' % video_id
)
117 for video_id
in orderedSet(re
.findall(
118 r
'(?:initPlayer_|data-entity=["\']|
id=["\']player_)(\d+)',
121 return self.playlist_result(entries, playlist_id)