mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-19 14:49:15 +00:00
Create last_segment_url only if necessary
This commit is contained in:
parent
fba1c397b1
commit
e42e25619f
|
@ -2853,12 +2853,13 @@ def _extract_sequence_from_mpd(refresh_sequence, immediate):
|
|||
known_idx = idx - 1
|
||||
raise ExtractorError('breaking out of outer loop')
|
||||
|
||||
last_segment_url = urljoin(fragment_base_url, 'sq/%d' % idx)
|
||||
frag_duration = last_fragment['duration']
|
||||
frag_start = last_fragment['start'] - (last_seq - idx) * frag_duration
|
||||
frag_end = frag_start + frag_duration
|
||||
|
||||
if frag_start >= section_start and frag_end <= section_end:
|
||||
last_segment_url = urljoin(fragment_base_url, f'sq/{idx}')
|
||||
|
||||
yield {
|
||||
'url': last_segment_url,
|
||||
'duration': frag_duration,
|
||||
|
|
Loading…
Reference in a new issue