wolfyflutter

46. fbvdl wip

Aug 5th, 2025 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // base https://fdown.net/
  2.  
  3. const fbvdl = async (urlFesnuk) => {
  4.     const r = await fetch(`https://fdown.net/download.php`, {
  5.         headers: {
  6.             "content-type": "application/x-www-form-urlencoded",
  7.         },
  8.         body: new URLSearchParams({
  9.             URLz: urlFesnuk
  10.         }),
  11.         method : "post"
  12.     })
  13.     if (!r.ok) throw Error (`${r.status} ${r.statusText} ${(await r.text() || `(respond body kosong)`).substring(0,100)}`)
  14.     const html = await r.text()
  15.     const hd = html.match(/id="hdlink" href="(.+?)" download/)?.[1]?.replaceAll("&","&")
  16.     const sd = html.match(/id="sdlink" href="(.+?)" download/)?.[1]?.replaceAll("&","&")
  17.     if (!hd&&!sd) throw Error (`tidak ada video yang bisa di download`)
  18.     const result = {hd,sd}
  19.     return result
  20. }
  21.  
  22. // cara pakai
  23. fbvdl('https://web.facebook.com/watch?v=1018693590342239')
  24. .then(console.log)
  25. .catch(console.log)
  26.  
  27. /* outpput
  28. {
  29.   hd: 'https://video-lax3-2.xx.fbcdn......h_h264-basic-gen2_720p&dl=1',
  30.   sd: 'https://video-lax3-1.xx.fbcdn.net/o.....&bitrate=211631&tag=sve_sd&dl=1'
  31. }
  32. */
Tags: WIP
Advertisement
Add Comment
Please, Sign In to add comment