4 from .common import InfoExtractor
7 class PodomaticIE(InfoExtractor):
9 _VALID_URL = r'^(?P<proto>https?)://(?P<channel>[^.]+)\.podomatic\.com/entry/(?P<id>[^?]+)'
12 u"url": u"http://scienceteachingtips.podomatic.com/entry/2009-01-02T16_03_35-08_00",
13 u"file": u"2009-01-02T16_03_35-08_00.mp3",
14 u"md5": u"84bb855fcf3429e6bf72460e1eed782d",
16 u"uploader": u"Science Teaching Tips",
17 u"uploader_id": u"scienceteachingtips",
18 u"title": u"64. When the Moon Hits Your Eye",
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
25 video_id = mobj.group('id')
26 channel = mobj.group('channel')
28 json_url = (('%s://%s.podomatic.com/entry/embed_params/%s' +
29 '?permalink=true&rtmp=0') %
30 (mobj.group('proto'), channel, video_id))
31 data_json = self._download_webpage(
32 json_url, video_id, note=u'Downloading video info')
33 data = json.loads(data_json)
35 video_url = data['downloadLink']
36 uploader = data['podcast']
38 thumbnail = data['imageLocation']
39 duration = int(data['length'] / 1000.0)
46 'uploader_id': channel,
47 'thumbnail': thumbnail,