mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-23 00:54:31 +01:00
[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
This commit is contained in:
parent
b99b0bcfa0
commit
1efe3b811a
@ -3,8 +3,10 @@ from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
base_url,
|
||||
int_or_none,
|
||||
unescapeHTML,
|
||||
urljoin,
|
||||
)
|
||||
|
||||
|
||||
@ -27,6 +29,14 @@ class BildIE(InfoExtractor):
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
|
||||
# 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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user