]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/podomatic.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..utils
import int_or_none
9 class PodomaticIE(InfoExtractor
):
14 (?P<channel>[^.]+)\.podomatic\.com/entry|
15 (?:www\.)?podomatic\.com/podcasts/(?P<channel_2>[^/]+)/episodes
21 'url': 'http://scienceteachingtips.podomatic.com/entry/2009-01-02T16_03_35-08_00',
22 'md5': '84bb855fcf3429e6bf72460e1eed782d',
24 'id': '2009-01-02T16_03_35-08_00',
26 'uploader': 'Science Teaching Tips',
27 'uploader_id': 'scienceteachingtips',
28 'title': '64. When the Moon Hits Your Eye',
32 'url': 'http://ostbahnhof.podomatic.com/entry/2013-11-15T16_31_21-08_00',
33 'md5': 'd2cf443931b6148e27638650e2638297',
35 'id': '2013-11-15T16_31_21-08_00',
37 'uploader': 'Ostbahnhof / Techno Mix',
38 'uploader_id': 'ostbahnhof',
39 'title': 'Einunddreizig',
43 'url': 'https://www.podomatic.com/podcasts/scienceteachingtips/episodes/2009-01-02T16_03_35-08_00',
44 'only_matching': True,
47 def _real_extract(self
, url
):
48 mobj
= self
._match
_valid
_url
(url
)
49 video_id
= mobj
.group('id')
50 channel
= mobj
.group('channel') or mobj
.group('channel_2')
52 json_url
= (('%s://%s.podomatic.com/entry/embed_params/%s'
53 + '?permalink=true&rtmp=0') %
54 (mobj
.group('proto'), channel
, video_id
))
55 data_json
= self
._download
_webpage
(
56 json_url
, video_id
, 'Downloading video info')
57 data
= json
.loads(data_json
)
59 video_url
= data
['downloadLink']
61 video_url
= '%s/%s' % (data
['streamer'].replace('rtmp', 'http'), data
['mediaLocation'])
62 uploader
= data
['podcast']
64 thumbnail
= data
['imageLocation']
65 duration
= int_or_none(data
.get('length'), 1000)
72 'uploader_id': channel
,
73 'thumbnail': thumbnail
,