Skip to content

Instantly share code, notes, and snippets.

@MaxXxiMast
Created June 14, 2017 12:29
Show Gist options
  • Save MaxXxiMast/20048d5ce06603e11158b4cb47d7f541 to your computer and use it in GitHub Desktop.
Save MaxXxiMast/20048d5ce06603e11158b4cb47d7f541 to your computer and use it in GitHub Desktop.
Getting Youtube Video URls
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