Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
build: take end on consideration
Browse files Browse the repository at this point in the history
Added support for end range header that extends the partial file request support. Useful for proxying a stream to a native html5 media element for seek-ability.

original PR: #195
  • Loading branch information
Kikobeats committed May 22, 2019
1 parent 8111957 commit 66e1324
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function processData (data, options, stream) {
data.http_headers
)

if (options && options.start > 0) {
headers.Range = 'bytes=' + options.start + '-'
if (options && options.start > 0 && options.end > 0) {
headers.Range = 'bytes=' + options.start + '-' + options.end
}

const req = request({ url: item.url, headers: headers, ecdhCurve: 'auto' })
Expand Down

0 comments on commit 66e1324

Please sign in to comment.