]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dreisat.py
debian/control: Remove mplayer2 from recommends. (Closes: #841187)
[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'(?:https?://)?(?: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': 'SCHWEIZWEIT',
21 'uploader_id': '100000210',
22 'upload_date': '20140913'
23 },
24 'params': {
25 'skip_download': True, # m3u8 downloads
26 }
27 },
28 {
29 'url': 'http://www.3sat.de/mediathek/mediathek.php?mode=play&obj=51066',
30 'only_matching': True,
31 },
32 ]
33
34 def _real_extract(self, url):
35 mobj = re.match(self._VALID_URL, url)
36 video_id = mobj.group('id')
37 details_url = 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id=%s' % video_id
38 return self.extract_from_xml_url(video_id, details_url)