diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2015-01-23 17:22:45 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2015-01-23 17:22:45 +0100 |
commit | d229ee70da4fbfa25a02c75f02a8c39abadbe970 (patch) | |
tree | 54ffa4cd99473bb4eb15473643998b99e8d605b9 /youtube_dl/downloader/f4m.py | |
parent | 26e274666d285026dfb6033cdad74cc2a108e2bc (diff) | |
parent | ebd46aed5119899826629cf751ba5abe7a65d50b (diff) | |
download | youtube-dl-d229ee70da4fbfa25a02c75f02a8c39abadbe970.tar.xz |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'youtube_dl/downloader/f4m.py')
-rw-r--r-- | youtube_dl/downloader/f4m.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/youtube_dl/downloader/f4m.py b/youtube_dl/downloader/f4m.py index c460c167a..c68b2c303 100644 --- a/youtube_dl/downloader/f4m.py +++ b/youtube_dl/downloader/f4m.py @@ -177,13 +177,12 @@ def build_fragments_list(boot_info): """ Return a list of (segment, fragment) for each fragment in the video """ res = [] 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'] 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)): - res.append((1, frag_number)) + fragments_counter = itertools.count(first_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 |