Add util to change video range flag losslessly

This is useful for some services. Some times there's a random stream with the wrong video range.
This commit is contained in:
rlaphoenix
2023-02-06 23:47:37 +00:00
parent 8c66e57175
commit 00f85f7206
3 changed files with 72 additions and 3 deletions

View File

@@ -240,7 +240,7 @@ class Track:
with open(save_path, "wb") as f:
for file in sorted(segments_dir.iterdir()):
data = file.read_bytes()
# Apple TV+ needs this done to fix audio decryption
# fix audio decryption
data = re.sub(b"(tfhd\x00\x02\x00\x1a\x00\x00\x00\x01\x00\x00\x00)\x02", b"\\g<1>\x01", data)
f.write(data)
file.unlink() # delete, we don't need it anymore