Skip to content

Instantly share code, notes, and snippets.

@Shrekie
Last active April 20, 2018 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shrekie/9a0b715484dc696b8361b5930e263603 to your computer and use it in GitHub Desktop.
Save Shrekie/9a0b715484dc696b8361b5930e263603 to your computer and use it in GitHub Desktop.
Youtube get_video_info stream URL node url_encoded_fmt_stream_map
const ytdl = require('youtube-dl');
var link = req.body.YTURL;
ytdl.exec(link, ['-f best', '-s', '-g'], {}, function(err, output) {
if (err) throw err;
res.json(output[0]);
});
@Shrekie
Copy link
Author

Shrekie commented Apr 20, 2018

youtube-dl has some overhead but i cant get this to work consistently without it.

Please if someone has code for node to grab the stream URL please help out, the problem is mostly the fact that some youtube videos require you to update a signature as well which is another request and the documentation on this is scarce.

You can try to dig through source code of downloaders but I'm having a hard time figuring it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment