3 from .common
import InfoExtractor
4 from ..utils
import int_or_none
7 class PodomaticIE(InfoExtractor
):
13 (?P<channel>[^.]+)\.podomatic\.com/entry|
14 (?:www\.)?podomatic\.com/podcasts/(?P<channel_2>[^/]+)/episodes
20 'url': 'http://scienceteachingtips.podomatic.com/entry/2009-01-02T16_03_35-08_00',
21 'md5': '84bb855fcf3429e6bf72460e1eed782d',
23 'id': '2009-01-02T16_03_35-08_00',
25 'uploader': 'Science Teaching Tips',
26 'uploader_id': 'scienceteachingtips',
27 'title': '64. When the Moon Hits Your Eye',
31 'url': 'http://ostbahnhof.podomatic.com/entry/2013-11-15T16_31_21-08_00',
32 'md5': 'd2cf443931b6148e27638650e2638297',
34 'id': '2013-11-15T16_31_21-08_00',
36 'uploader': 'Ostbahnhof / Techno Mix',
37 'uploader_id': 'ostbahnhof',
38 'title': 'Einunddreizig',
42 'url': 'https://www.podomatic.com/podcasts/scienceteachingtips/episodes/2009-01-02T16_03_35-08_00',
43 'only_matching': True,
46 def _real_extract(self
, url
):
47 mobj
= self
._match
_valid
_url
(url
)
48 video_id
= mobj
.group('id')
49 channel
= mobj
.group('channel') or mobj
.group('channel_2')
51 json_url
= ('{}://{}.podomatic.com/entry/embed_params/{}?permalink=true&rtmp=0'.format(
52 mobj
.group('proto'), channel
, video_id
))
53 data_json
= self
._download
_webpage
(
54 json_url
, video_id
, 'Downloading video info')
55 data
= json
.loads(data_json
)
57 video_url
= data
['downloadLink']
59 video_url
= '{}/{}'.format(data
['streamer'].replace('rtmp', 'http'), data
['mediaLocation'])
60 uploader
= data
['podcast']
62 thumbnail
= data
['imageLocation']
63 duration
= int_or_none(data
.get('length'), 1000)
70 'uploader_id': channel
,
71 'thumbnail': thumbnail
,