Skip to content

Instantly share code, notes, and snippets.

@wlib
Last active June 11, 2019 11:52
Show Gist options
  • Save wlib/6ce9bc9c5827eda469fd2b67b54fbcaf to your computer and use it in GitHub Desktop.
Save wlib/6ce9bc9c5827eda469fd2b67b54fbcaf to your computer and use it in GitHub Desktop.
Does a youtube video have a scrambled signature or not?
function parse(query) {
const allpairs = query.split("&");
const out = {};
for (let i = 0; i < allpairs.length; i++) {
let pair = allpairs[i].split("=");
let key = pair[0];
let val = pair[1];
out[key] = val;
}
return out;
}
function hasScrambledSignature() {
const info = ytplayer.config.args.adaptive_fmts.split(",");
const stream = parse( info[0] );
if (stream.s) {
return true;
}
else {
return false;
}
}
console.log( hasScrambledSignature() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment