Last active
June 11, 2019 11:52
-
-
Save wlib/6ce9bc9c5827eda469fd2b67b54fbcaf to your computer and use it in GitHub Desktop.
Does a youtube video have a scrambled signature or not?
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
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