diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-09-22 04:16:50 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-09-22 04:19:45 +0530 |
commit | d9d8b857477d8797ab1b55a99684d6d71959c51b (patch) | |
tree | fed5da6ec25838aeafd13acb9256212ade853cad | |
parent | daf7ac2b92494bed6bc9fcada69fbb9b94b539bb (diff) | |
download | hypervideo-pre-d9d8b857477d8797ab1b55a99684d6d71959c51b.tar.lz hypervideo-pre-d9d8b857477d8797ab1b55a99684d6d71959c51b.tar.xz hypervideo-pre-d9d8b857477d8797ab1b55a99684d6d71959c51b.zip |
[fragment] Fix range header when using `-N` and media sequence (#1048)
Authored by: shirt
-rw-r--r-- | yt_dlp/downloader/fragment.py | 2 | ||||
-rw-r--r-- | yt_dlp/downloader/hls.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py index cd1e2350d..10ab90ba6 100644 --- a/yt_dlp/downloader/fragment.py +++ b/yt_dlp/downloader/fragment.py @@ -332,7 +332,7 @@ class FragmentFD(FileDownloader): def download_fragment(fragment, ctx): frag_index = ctx['fragment_index'] = fragment['frag_index'] - headers = info_dict.get('http_headers', {}) + headers = info_dict.get('http_headers', {}).copy() byte_range = fragment.get('byte_range') if byte_range: headers['Range'] = 'bytes=%d-%d' % (byte_range['start'], byte_range['end'] - 1) diff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.py index e0dc1def7..f343e1879 100644 --- a/yt_dlp/downloader/hls.py +++ b/yt_dlp/downloader/hls.py @@ -167,6 +167,7 @@ class HlsFD(FragmentFD): 'byte_range': byte_range, 'media_sequence': media_sequence, }) + media_sequence += 1 elif line.startswith('#EXT-X-MAP'): if format_index and discontinuity_count != format_index: @@ -191,6 +192,7 @@ class HlsFD(FragmentFD): 'byte_range': byte_range, 'media_sequence': media_sequence }) + media_sequence += 1 if map_info.get('BYTERANGE'): splitted_byte_range = map_info.get('BYTERANGE').split('@') |