]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/tagesschau.py
1 # -*- coding: utf-8 -*-
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
9 class TagesschauIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?tagesschau\.de/multimedia/video/video(?P<id>-?[0-9]+)\.html'
13 'url': 'http://www.tagesschau.de/multimedia/video/video1399128.html',
14 'md5': 'bcdeac2194fb296d599ce7929dfa4009',
18 'title': 'Harald Range, Generalbundesanwalt, zu den Ermittlungen',
19 'description': 'md5:69da3c61275b426426d711bde96463ab',
20 'thumbnail': 're:^http:.*\.jpg$',
23 'url': 'http://www.tagesschau.de/multimedia/video/video-196.html',
24 'md5': '8aaa8bf3ae1ca2652309718c03019128',
28 'title': 'Ukraine-Konflikt: Klitschko in Kiew als Bürgermeister vereidigt',
29 'description': 'md5:f22e4af75821d174fa6c977349682691',
30 'thumbnail': 're:http://.*\.jpg',
35 's': {'width': 256, 'height': 144, 'quality': 1},
36 'm': {'width': 512, 'height': 288, 'quality': 2},
37 'l': {'width': 960, 'height': 544, 'quality': 3},
40 def _real_extract(self
, url
):
41 mobj
= re
.match(self
._VALID
_URL
, url
)
42 video_id
= mobj
.group('id')
44 if video_id
.startswith('-'):
45 display_id
= video_id
.strip('-')
49 webpage
= self
._download
_webpage
(url
, display_id
)
51 playerpage
= self
._download
_webpage
(
52 'http://www.tagesschau.de/multimedia/video/video%s~player_autoplay-true.html' % video_id
,
53 display_id
, 'Downloading player page')
56 r
'"(http://media.+?)", type:"video/(.+?)", quality:"(.+?)"',
60 for url
, ext
, res
in medias
:
62 'format_id': res
+ '_' + ext
,
66 f
.update(self
._FORMATS
.get(res
, {}))
69 self
._sort
_formats
(formats
)
71 thumbnail
= re
.findall(r
'"(/multimedia/.+?\.jpg)"', playerpage
)[-1]
75 'title': self
._og
_search
_title
(webpage
).strip(),
76 'thumbnail': 'http://www.tagesschau.de' + thumbnail
,
78 'description': self
._og
_search
_description
(webpage
).strip(),