This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//the index range will be eg: 0-917 | |
// you can find the index range of a particular dash video insode the ytplayer.config | |
// https://github.com/fent/node-ytdl-core | |
function sidxFromInitRange(url, indexRange) { | |
return new Q(function(resolve, reject) { | |
var XMLHttpRequest = require('xhr2'); | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', url); | |
xhr.setRequestHeader("Range", "bytes=" + indexRange); | |
xhr.send(); |