5 from .common import InfoExtractor
12 class DreiSatIE(InfoExtractor):
14 _VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/index\.php\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$'
16 u"url": u"http://www.3sat.de/mediathek/index.php?obj=36983",
17 u'file': u'36983.webm',
18 u'md5': u'57c97d0469d71cf874f6815aa2b7c944',
20 u"title": u"Kaffeeland Schweiz",
21 u"description": u"Über 80 Kaffeeröstereien liefern in der Schweiz das Getränk, in das das Land so vernarrt ist: Mehr als 1000 Tassen trinkt ein Schweizer pro Jahr. SCHWEIZWEIT nimmt die Kaffeekultur unter die...",
23 u"upload_date": u"20130622"
28 def _real_extract(self, url):
29 mobj = re.match(self._VALID_URL, url)
30 video_id = mobj.group('id')
31 details_url = 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id=%s' % video_id
32 details_doc = self._download_xml(details_url, video_id, note=u'Downloading video details')
34 thumbnail_els = details_doc.findall('.//teaserimage')
36 'width': te.attrib['key'].partition('x')[0],
37 'height': te.attrib['key'].partition('x')[2],
39 } for te in thumbnail_els]
41 information_el = details_doc.find('.//information')
42 video_title = information_el.find('./title').text
43 video_description = information_el.find('./detail').text
45 details_el = details_doc.find('.//details')
46 video_uploader = details_el.find('./channel').text
47 upload_date = unified_strdate(details_el.find('./airtime').text)
49 format_els = details_doc.findall('.//formitaet')
51 'format_id': fe.attrib['basetype'],
52 'width': int(fe.find('./width').text),
53 'height': int(fe.find('./height').text),
54 'url': fe.find('./url').text,
55 'filesize': int(fe.find('./filesize').text),
56 'video_bitrate': int(fe.find('./videoBitrate').text),
57 } for fe in format_els
58 if not fe.find('./url').text.startswith('http://www.metafilegenerator.de/')]
60 self._sort_formats(formats)
67 'description': video_description,
68 'thumbnails': thumbnails,
69 'thumbnail': thumbnails[-1]['url'],
70 'uploader': video_uploader,
71 'upload_date': upload_date,