1 from .common
import InfoExtractor
2 from ..utils
import js_to_json
5 class MegaphoneIE(InfoExtractor
):
6 IE_NAME
= 'megaphone.fm'
7 IE_DESC
= 'megaphone.fm embedded players'
8 _VALID_URL
= r
'https?://player\.megaphone\.fm/(?P<id>[A-Z0-9]+)'
9 _EMBED_REGEX
= [rf
'<iframe[^>]*?\ssrc=["\'](?P<url>{_VALID_URL})']
11 'url': 'https://player.megaphone.fm/GLT9749789991',
12 'md5': '4816a0de523eb3e972dc0dda2c191f96',
14 'id': 'GLT9749789991',
16 'title': '#97 What Kind Of Idiot Gets Phished?',
17 'thumbnail': r
're:^https://.*\.png.*$',
19 'creators': ['Reply All'],
23 def _real_extract(self
, url
):
24 video_id
= self
._match
_id
(url
)
25 webpage
= self
._download
_webpage
(url
, video_id
)
27 title
= self
._og
_search
_property
('audio:title', webpage
)
28 author
= self
._og
_search
_property
('audio:artist', webpage
)
29 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
31 episode_json
= self
._search
_regex
(r
'(?s)var\s+episode\s*=\s*(\{.+?\});', webpage
, 'episode JSON')
32 episode_data
= self
._parse
_json
(episode_json
, video_id
, js_to_json
)
33 video_url
= self
._proto
_relative
_url
(episode_data
['mediaUrl'], 'https:')
41 'thumbnail': thumbnail
,
43 'creators': [author
] if author
else None,
44 'duration': episode_data
['duration'],