Created
June 14, 2017 12:29
-
-
Save MaxXxiMast/20048d5ce06603e11158b4cb47d7f541 to your computer and use it in GitHub Desktop.
Getting Youtube Video URls
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
const videoUrls = ytplayer.config.args.url_encoded_fmt_stream_map | |
.split(',') | |
.map(item => item | |
.split('&') | |
.reduce((prev, curr) => (curr = curr.split('='), | |
Object.assign(prev, {[curr[0]]: decodeURIComponent(curr[1])}) | |
), {}) | |
) | |
.reduce((prev, curr) => Object.assign(prev, { | |
[curr.quality + ':' + curr.type.split(';')[0]]: curr | |
}), {}); | |
reference - https://gist.github.com/geuis/8b1b2ea57d7f9a9ae22f80d4fbf5b97f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment