1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-03 23:43:21 -04:00

[fragment] Read downloaded fragments only when needed (#3069)

Authored by: Lesmiscore
This commit is contained in:
Lesmiscore (Naoya Ozaki)
2022-03-15 12:27:41 +09:00
committed by GitHub
parent d69e55c1d8
commit d71fd41249
4 changed files with 29 additions and 30 deletions

View File

@@ -171,9 +171,10 @@ body > figure > img {
assert fragment_base_url
fragment_url = urljoin(fragment_base_url, fragment['path'])
success, frag_content = self._download_fragment(ctx, fragment_url, info_dict)
success = self._download_fragment(ctx, fragment_url, info_dict)
if not success:
continue
frag_content = self._read_fragment(ctx)
mime_type = b'image/jpeg'
if frag_content.startswith(b'\x89PNG\r\n\x1a\n'):