mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-25 01:01:39 +00:00
[downloader/f4m] build_fragments_list: Support videos with more than 1 segment
This commit is contained in:
parent
6f58db8982
commit
bf7fa94ec7
1 changed files with 4 additions and 5 deletions
|
@ -177,13 +177,12 @@ def build_fragments_list(boot_info):
|
||||||
""" Return a list of (segment, fragment) for each fragment in the video """
|
""" Return a list of (segment, fragment) for each fragment in the video """
|
||||||
res = []
|
res = []
|
||||||
segment_run_table = boot_info['segments'][0]
|
segment_run_table = boot_info['segments'][0]
|
||||||
# I've only found videos with one segment
|
|
||||||
segment_run_entry = segment_run_table['segment_run'][0]
|
|
||||||
n_frags = segment_run_entry[1]
|
|
||||||
fragment_run_entry_table = boot_info['fragments'][0]['fragments']
|
fragment_run_entry_table = boot_info['fragments'][0]['fragments']
|
||||||
first_frag_number = fragment_run_entry_table[0]['first']
|
first_frag_number = fragment_run_entry_table[0]['first']
|
||||||
for (i, frag_number) in zip(range(1, n_frags + 1), itertools.count(first_frag_number)):
|
fragments_counter = itertools.count(first_frag_number)
|
||||||
res.append((1, frag_number))
|
for segment, fragments_count in segment_run_table['segment_run']:
|
||||||
|
for _ in range(fragments_count):
|
||||||
|
res.append((segment, next(fragments_counter)))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue