Skip to content

Instantly share code, notes, and snippets.

@dandyraka
Created September 28, 2021 10:00
Show Gist options
  • Save dandyraka/1c1b9d461f80c46641ed031f64655ae2 to your computer and use it in GitHub Desktop.
Save dandyraka/1c1b9d461f80c46641ed031f64655ae2 to your computer and use it in GitHub Desktop.
const fetch = require('node-fetch');
const originalUrl = "https://www.facebook.com/buzzfeedtasty/videos/558134848844881/";
const url = new URL(originalUrl);
const mobileUrl = `https://m.facebook.com${url.pathname}`;
fetch(mobileUrl)
.then(async res => {
const response = await res.text();
const find = response.match(/>{(.*?)}</);
const json = JSON.parse(`{${find[1]}}`);
console.log(json.thumbnailUrl);
console.log(json.contentUrl);
console.log(json.videoQuality);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment