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