1 from .common
import InfoExtractor
8 class RadioZetPodcastIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
11 'url': 'https://player.radiozet.pl/Podcasty/Nie-Ma-Za-Co/O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
12 'md5': 'e03665c316b4fbc5f6a8f232948bbba3',
15 'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
16 'title': 'O przedmiotach szkolnych, które przydają się w życiu',
17 'description': 'md5:fa72bed49da334b09e5b2f79851f185c',
18 'release_timestamp': 1592985480,
20 'thumbnail': r
're:^https?://.*\.png$',
22 'series': 'Nie Ma Za Co',
23 'creator': 'Katarzyna Pakosińska',
27 def _call_api(self
, podcast_id
, display_id
):
28 return self
._download
_json
(
29 f
'https://player.radiozet.pl/api/podcasts/getPodcast/(node)/{podcast_id}/(station)/radiozet',
32 def _real_extract(self
, url
):
33 display_id
= self
._match
_id
(url
)
34 webpage
= self
._download
_webpage
(url
, display_id
)
35 podcast_id
= self
._html
_search
_regex
(r
'<div.*?\sid="player".*?\sdata-id=[\'"]([^\'"]+)[\'"]',
36 webpage, 'podcast id')
37 data = self._call_api(podcast_id, display_id)['data'][0]
41 'display_id': display_id,
42 'title': strip_or_none(data.get('title')),
43 'description': strip_or_none(traverse_obj(data, ('program', 'desc'))),
44 'release_timestamp': data.get('published_date'),
45 'url': traverse_obj(data, ('player', 'stream')),
46 'thumbnail': traverse_obj(data, ('program', 'image', 'original')),
47 'duration': traverse_obj(data, ('player', 'duration')),
48 'series': strip_or_none(traverse_obj(data, ('program', 'title'))),
49 'creator': strip_or_none(traverse_obj(data, ('presenter', 0, 'title'))),