From 1efe3b811ae3552a526162d2f85e5b8b13972910 Mon Sep 17 00:00:00 2001 From: ispedals Date: Wed, 24 Oct 2018 22:22:32 -0400 Subject: [PATCH] [bild] don't assume embed url(closes #17876) If the url provided is not the embed url, try to find the embed url on the page --- youtube_dl/extractor/bild.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/bild.py b/youtube_dl/extractor/bild.py index b8dfbd42b..696507a73 100644 --- a/youtube_dl/extractor/bild.py +++ b/youtube_dl/extractor/bild.py @@ -3,8 +3,10 @@ from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( + base_url, int_or_none, unescapeHTML, + urljoin, ) @@ -27,8 +29,16 @@ class BildIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - video_data = self._download_json( - url.split('.bild.html')[0] + ',view=json.bild.html', video_id) + # if we didn't get a direct link to the video, try to find it on the page + if 'bild.de/video/clip/' not in url: + json_url = self._search_regex( + r'data-video-json="(.*?)"', + self._download_webpage(url, video_id), video_id) + video_data = self._download_json( + urljoin(base_url(url), json_url), video_id) + else: + video_data = self._download_json( + url.split('.bild.html')[0] + ',view=json.bild.html', video_id) return { 'id': video_id,