Reduced disk space usage of native hls downloader
This commit is contained in:
parent
181f814e57
commit
ed2e1e9a87
@ -99,14 +99,14 @@ class NativeHlsFD(FragmentFD):
|
|||||||
success = ctx['dl'].download(frag_filename, {'url': frag_url})
|
success = ctx['dl'].download(frag_filename, {'url': frag_url})
|
||||||
if not success:
|
if not success:
|
||||||
return False
|
return False
|
||||||
down, frag_sanitized = sanitize_open(frag_filename, 'rb')
|
frags_filenames.append(frag_sanitized)
|
||||||
|
|
||||||
|
for frag_file in frags_filenames:
|
||||||
|
down, frag_sanitized = sanitize_open(frag_file, 'rb')
|
||||||
ctx['dest_stream'].write(down.read())
|
ctx['dest_stream'].write(down.read())
|
||||||
down.close()
|
down.close()
|
||||||
frags_filenames.append(frag_sanitized)
|
os.remove(encodeFilename(frag_file))
|
||||||
|
|
||||||
self._finish_frag_download(ctx)
|
self._finish_frag_download(ctx)
|
||||||
|
|
||||||
for frag_file in frags_filenames:
|
|
||||||
os.remove(encodeFilename(frag_file))
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user