Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Download Instagram Videos
// node instagram-dl.js BnmcJ-tnAey
const rest = require('restler')
const fs = require('fs')
const request = require('request')
rest.get(`${process.argv.slice(2)[0]}/?__a=1`).on('complete', function(data) {
var videoUrl = data.graphql.shortcode_media.video_url
var videoFilename = videoUrl.split("/")[videoUrl.split("/").length - 1]
.then(() => new Promise((resolve, revoke) => {
let writeStream = fs.createWriteStream(`videos/${videoFilename}`)
writeStream.on('finish', resolve)
writeStream.on('error', revoke)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.