mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 16:32:51 +01:00
Add fragment count
This commit is contained in:
parent
e40132da09
commit
0ed9a73a73
|
@ -2853,6 +2853,9 @@ def _extract_sequence_from_mpd(refresh_sequence, immediate):
|
||||||
if lack_early_segments:
|
if lack_early_segments:
|
||||||
known_idx = max(known_idx, last_seq - int(MAX_DURATION // last_fragment['duration']))
|
known_idx = max(known_idx, last_seq - int(MAX_DURATION // last_fragment['duration']))
|
||||||
|
|
||||||
|
fragment_count = last_seq - known_idx if section_end == math.inf else int(
|
||||||
|
(section_end - section_start) // last_fragment['duration'])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for idx in range(known_idx, last_seq):
|
for idx in range(known_idx, last_seq):
|
||||||
# do not update sequence here or you'll get skipped some part of it
|
# do not update sequence here or you'll get skipped some part of it
|
||||||
|
@ -2870,6 +2873,7 @@ def _extract_sequence_from_mpd(refresh_sequence, immediate):
|
||||||
|
|
||||||
yield {
|
yield {
|
||||||
'url': last_segment_url,
|
'url': last_segment_url,
|
||||||
|
'fragment_count': fragment_count,
|
||||||
'duration': frag_duration,
|
'duration': frag_duration,
|
||||||
'start': frag_start,
|
'start': frag_start,
|
||||||
'end': frag_end,
|
'end': frag_end,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user