mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[downloader/mhtml] Fix fragments with absolute urls (#3044)
Authored-by: coletdjnz
This commit is contained in:
parent
17322130a9
commit
b3edc8068e
3 changed files with 7 additions and 3 deletions
|
@ -166,7 +166,11 @@ def real_download(self, filename, info_dict):
|
||||||
if (i + 1) <= ctx['fragment_index']:
|
if (i + 1) <= ctx['fragment_index']:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
fragment_url = fragment.get('url')
|
||||||
|
if not fragment_url:
|
||||||
|
assert fragment_base_url
|
||||||
fragment_url = urljoin(fragment_base_url, fragment['path'])
|
fragment_url = urljoin(fragment_base_url, fragment['path'])
|
||||||
|
|
||||||
success, frag_content = self._download_fragment(ctx, fragment_url, info_dict)
|
success, frag_content = self._download_fragment(ctx, fragment_url, info_dict)
|
||||||
if not success:
|
if not success:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -187,7 +187,7 @@ def _extract_video(self, video_id, catalogue=None):
|
||||||
'protocol': 'mhtml',
|
'protocol': 'mhtml',
|
||||||
'url': 'about:invalid',
|
'url': 'about:invalid',
|
||||||
'fragments': [{
|
'fragments': [{
|
||||||
'path': sheet,
|
'url': sheet,
|
||||||
# XXX: not entirely accurate; each spritesheet seems to be
|
# XXX: not entirely accurate; each spritesheet seems to be
|
||||||
# a 10×10 grid of thumbnails corresponding to approximately
|
# a 10×10 grid of thumbnails corresponding to approximately
|
||||||
# 2 seconds of the video; the last spritesheet may be shorter
|
# 2 seconds of the video; the last spritesheet may be shorter
|
||||||
|
|
|
@ -3208,7 +3208,7 @@ def _extract_storyboard(self, player_responses, duration):
|
||||||
'width': width,
|
'width': width,
|
||||||
'height': height,
|
'height': height,
|
||||||
'fragments': [{
|
'fragments': [{
|
||||||
'path': url.replace('$M', str(j)),
|
'url': url.replace('$M', str(j)),
|
||||||
'duration': min(fragment_duration, duration - (j * fragment_duration)),
|
'duration': min(fragment_duration, duration - (j * fragment_duration)),
|
||||||
} for j in range(math.ceil(fragment_count))],
|
} for j in range(math.ceil(fragment_count))],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue