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

Commit

Permalink
As requested, I was trying to make the code as readable as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
logikaljay committed Sep 7, 2015
1 parent e9e540a commit 38884d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ var ytdl = module.exports = function(videoUrl, args, options) {
'Host': url.parse(item.url).hostname
};

if (typeof options.start !== 'undefined' && options.start > 0) {
if ((options || {}).start > 0) {
headers.Range = "bytes=" + options.start + "-";
};
}

var req = request({
url: item.url,
headers: headers
});

req.on('response', function(res) {
if (options.start > 0 && res.statusCode == 416) {
if ((options || {}).start > 0 && res.statusCode == 416) {
// the file that is being resumed is complete.
stream.emit('end');
return;
Expand Down

0 comments on commit 38884d1

Please sign in to comment.