Add new Track Event, OnSegmentDownloaded

Like OnDownloaded but called every time a DASH or HLS segment is downloaded. The path to the downloaded segment file is passed to the callable.
This commit is contained in:
rlaphoenix
2024-02-10 18:10:09 +00:00
parent 87779f4e7d
commit cd194e3192
3 changed files with 8 additions and 0 deletions

View File

@@ -484,6 +484,9 @@ class HLS:
segmented=True
)
if callable(track.OnSegmentDownloaded):
track.OnSegmentDownloaded(out_path)
download_size = out_path.stat().st_size
# fix audio decryption on ATVP by fixing the sample description index