From 6aab1b4d7e44da64d5adb9bd8e883e3e05171bcc Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Wed, 6 Nov 2024 19:06:16 +1300 Subject: [PATCH] Fix FormatInitializationMetadata duration fields --- yt_dlp_plugins/extractor/_ytse/downloader/sabr.py | 2 +- .../extractor/_ytse/protos/_format_initialization_metadata.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp_plugins/extractor/_ytse/downloader/sabr.py b/yt_dlp_plugins/extractor/_ytse/downloader/sabr.py index 9613236..64ed8d7 100644 --- a/yt_dlp_plugins/extractor/_ytse/downloader/sabr.py +++ b/yt_dlp_plugins/extractor/_ytse/downloader/sabr.py @@ -324,7 +324,7 @@ def process_format_initialization_metadata(self, part: UMPPart): initialized_format = InitializedFormat( format_id=fmt_init_metadata.format_id, - total_duration_ms=fmt_init_metadata.duration_ms, + total_duration_ms=int((fmt_init_metadata.duration / fmt_init_metadata.duration_timescale) * 1000), end_time_ms=fmt_init_metadata.end_time_ms, mime_type=fmt_init_metadata.mime_type, buffered_range=BufferedRange( diff --git a/yt_dlp_plugins/extractor/_ytse/protos/_format_initialization_metadata.py b/yt_dlp_plugins/extractor/_ytse/protos/_format_initialization_metadata.py index 6998368..ff8731d 100644 --- a/yt_dlp_plugins/extractor/_ytse/protos/_format_initialization_metadata.py +++ b/yt_dlp_plugins/extractor/_ytse/protos/_format_initialization_metadata.py @@ -77,5 +77,5 @@ class FormatInitializationMetadata: init_range: typing.Optional[InitRange] = protobug.field(6, default=None) index_range: typing.Optional[IndexRange] = protobug.field(7, default=None) format: typing.Optional[Format] = protobug.field(8, default=None) - duration_ms: typing.Optional[protobug.Int32] = protobug.field(9, default=None) - field10: typing.Optional[protobug.Int32] = protobug.field(10, default=None) \ No newline at end of file + duration: typing.Optional[protobug.Int32] = protobug.field(9, default=None) + duration_timescale: typing.Optional[protobug.Int32] = protobug.field(10, default=None) \ No newline at end of file