]> jfr.im git - yt-dlp.git/blame - youtube_dlc/extractor/bild.py
[skip travis] renaming
[yt-dlp.git] / youtube_dlc / extractor / bild.py
CommitLineData
5f6a1245 1# coding: utf-8
b5a14350
PH
2from __future__ import unicode_literals
3
4from .common import InfoExtractor
c09593c0 5from ..utils import (
bc08873c 6 int_or_none,
70cb4d51 7 unescapeHTML,
c09593c0 8)
b5a14350
PH
9
10
11class BildIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?bild\.de/(?:[^/]+/)+(?P<display_id>[^/]+)-(?P<id>\d+)(?:,auto=true)?\.bild\.html'
13 IE_DESC = 'Bild.de'
14 _TEST = {
15 'url': 'http://www.bild.de/video/clip/apple-ipad-air/das-koennen-die-neuen-ipads-38184146.bild.html',
16 'md5': 'dd495cbd99f2413502a1713a1156ac8a',
17 'info_dict': {
18 'id': '38184146',
19 'ext': 'mp4',
d8348c35
S
20 'title': 'Das können die neuen iPads',
21 'description': 'md5:a4058c4fa2a804ab59c00d7244bbf62f',
ec85ded8 22 'thumbnail': r're:^https?://.*\.jpg$',
b5a14350 23 'duration': 196,
b5a14350
PH
24 }
25 }
26
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
29
d8348c35
S
30 video_data = self._download_json(
31 url.split('.bild.html')[0] + ',view=json.bild.html', video_id)
b5a14350
PH
32
33 return {
34 'id': video_id,
d8348c35 35 'title': unescapeHTML(video_data['title']).strip(),
70cb4d51 36 'description': unescapeHTML(video_data.get('description')),
37 'url': video_data['clipList'][0]['srces'][0]['src'],
38 'thumbnail': video_data.get('poster'),
39 'duration': int_or_none(video_data.get('durationSec')),
b5a14350 40 }