about summary refs log tree commit diff
path: root/youtube_dl/downloader
diff options
context:
space:
mode:
authorStefan Pöschel <basicmaster@users.noreply.github.com>2020-09-18 00:26:56 +0200
committerGitHub <noreply@github.com>2020-09-18 05:26:56 +0700
commit6e65a2a67e075ae8f3e4fe03c732d7772d36f5e1 (patch)
treee10798ae4286a4b27122e43ccdd40c0e6193eb66 /youtube_dl/downloader
parentf8c7bed133fe729a9e26f23e5685559e3fa12eb1 (diff)
downloadyoutube-dl-6e65a2a67e075ae8f3e4fe03c732d7772d36f5e1.tar.gz
youtube-dl-6e65a2a67e075ae8f3e4fe03c732d7772d36f5e1.tar.xz
youtube-dl-6e65a2a67e075ae8f3e4fe03c732d7772d36f5e1.zip
[downloader/hls] Fix incorrect end byte in Range HTTP header for media segments with EXT-X-BYTERANGE (#24512) (closes #14748)
The end of the byte range is the first byte that is NOT part of the to
be downloaded range. So don't include it into the requested HTTP
download range, as this additional byte leads to a broken TS packet and
subsequently to e.g. visible video corruption.

Fixes #14748.
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r--youtube_dl/downloader/hls.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py
index 84bc34928..0f2c06f40 100644
--- a/youtube_dl/downloader/hls.py
+++ b/youtube_dl/downloader/hls.py
@@ -141,7 +141,7 @@ class HlsFD(FragmentFD):
                     count = 0
                     headers = info_dict.get('http_headers', {})
                     if byte_range:
-                        headers['Range'] = 'bytes=%d-%d' % (byte_range['start'], byte_range['end'])
+                        headers['Range'] = 'bytes=%d-%d' % (byte_range['start'], byte_range['end'] - 1)
                     while count <= fragment_retries:
                         try:
                             success, frag_content = self._download_fragment(