forked from DRMTalks/devine
Flush file buffers when merging DASH or HLS segments
This commit is contained in:
parent
1259a26b14
commit
8de3a95c6b
|
@ -483,6 +483,7 @@ class DASH:
|
||||||
segment_data = try_ensure_utf8(segment_data)
|
segment_data = try_ensure_utf8(segment_data)
|
||||||
segment_data = html.unescape(segment_data.decode("utf8")).encode("utf8")
|
segment_data = html.unescape(segment_data.decode("utf8")).encode("utf8")
|
||||||
f.write(segment_data)
|
f.write(segment_data)
|
||||||
|
f.flush()
|
||||||
segment_file.unlink()
|
segment_file.unlink()
|
||||||
progress(advance=1)
|
progress(advance=1)
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,7 @@ class HLS:
|
||||||
x.write(map_data[1])
|
x.write(map_data[1])
|
||||||
for file in via:
|
for file in via:
|
||||||
x.write(file.read_bytes())
|
x.write(file.read_bytes())
|
||||||
|
x.flush()
|
||||||
if delete:
|
if delete:
|
||||||
file.unlink()
|
file.unlink()
|
||||||
|
|
||||||
|
@ -485,6 +486,7 @@ class HLS:
|
||||||
continue
|
continue
|
||||||
discontinuity_data = discontinuity_file.read_bytes()
|
discontinuity_data = discontinuity_file.read_bytes()
|
||||||
f.write(discontinuity_data)
|
f.write(discontinuity_data)
|
||||||
|
f.flush()
|
||||||
shutil.rmtree(save_dir)
|
shutil.rmtree(save_dir)
|
||||||
|
|
||||||
progress(downloaded="Downloaded")
|
progress(downloaded="Downloaded")
|
||||||
|
|
Loading…
Reference in New Issue