]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dreisat.py
028144f20b3458e61ed214703d5f6fd17ab79871
[youtubedl] / youtube_dl / extractor / dreisat.py
1 from __future__ import unicode_literals
2
3 import re
4
5 from .zdf import ZDFIE
6
7
8 class DreiSatIE(ZDFIE):
9 IE_NAME = '3sat'
10 _VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$'
11 _TESTS = [
12 {
13 'url': 'http://www.3sat.de/mediathek/index.php?mode=play&obj=45918',
14 'md5': 'be37228896d30a88f315b638900a026e',
15 'info_dict': {
16 'id': '45918',
17 'ext': 'mp4',
18 'title': 'Waidmannsheil',
19 'description': 'md5:cce00ca1d70e21425e72c86a98a56817',
20 'uploader': '3sat',
21 'upload_date': '20140913'
22 }
23 },
24 {
25 'url': 'http://www.3sat.de/mediathek/mediathek.php?mode=play&obj=51066',
26 'only_matching': True,
27 },
28 ]
29
30 def _real_extract(self, url):
31 mobj = re.match(self._VALID_URL, url)
32 video_id = mobj.group('id')
33 details_url = 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id=%s' % video_id
34 return self.extract_from_xml_url(video_id, details_url)