Created
September 28, 2021 10:00
-
-
Save dandyraka/1c1b9d461f80c46641ed031f64655ae2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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