mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 16:32:51 +01: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
|
known_idx = idx - 1
|
||||||
raise ExtractorError('breaking out of outer loop')
|
raise ExtractorError('breaking out of outer loop')
|
||||||
|
|
||||||
last_segment_url = urljoin(fragment_base_url, 'sq/%d' % idx)
|
|
||||||
frag_duration = last_fragment['duration']
|
frag_duration = last_fragment['duration']
|
||||||
frag_start = last_fragment['start'] - (last_seq - idx) * frag_duration
|
frag_start = last_fragment['start'] - (last_seq - idx) * frag_duration
|
||||||
frag_end = frag_start + frag_duration
|
frag_end = frag_start + frag_duration
|
||||||
|
|
||||||
if frag_start >= section_start and frag_end <= section_end:
|
if frag_start >= section_start and frag_end <= section_end:
|
||||||
|
last_segment_url = urljoin(fragment_base_url, f'sq/{idx}')
|
||||||
|
|
||||||
yield {
|
yield {
|
||||||
'url': last_segment_url,
|
'url': last_segment_url,
|
||||||
'duration': frag_duration,
|
'duration': frag_duration,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user