sazumiviki-api
Advanced tools
Comparing version 1.0.3 to 1.0.4
const axios = require('axios'); | ||
const cheerio = require('cheerio'); | ||
async function fbdl(url) { | ||
async function facebook(url) { | ||
try { | ||
@@ -44,3 +44,3 @@ const { data } = await axios.post('https://getmyfb.com/process', new URLSearchParams({ | ||
if (urls.length === 0) { | ||
throw new Error('Erorr'); | ||
throw new Error('No se encontraron enlaces de descarga'); | ||
} | ||
@@ -57,2 +57,2 @@ | ||
module.exports = fbdl; | ||
module.exports = facebook; |
@@ -11,33 +11,18 @@ const axios = require('axios'); | ||
form.append('cacheLimit', 0); | ||
try { | ||
const resp = await axios('https://www.screenshotmachine.com/capture.php', { | ||
method: 'post', | ||
data: form, | ||
headers: { | ||
'origin': 'https://www.screenshotmachine.com', | ||
'referer': 'https://www.screenshotmachine.com/', | ||
'sec-fetch-dest': 'empty', | ||
'sec-fetch-mode': 'cors', | ||
'sec-fetch-site': 'same-origin', | ||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.52', | ||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', | ||
'Cookie': '' | ||
} | ||
}); | ||
const cookies = resp.headers['set-cookie']; | ||
const buffer = await axios(`https://www.screenshotmachine.com/${resp.data.link}`, { | ||
headers: { | ||
'cookie': cookies.join('') | ||
}, | ||
responseType: 'arraybuffer' | ||
}); | ||
return Buffer.from(buffer.data); | ||
} catch (error) { | ||
throw new Error(`Error while capturing screenshot: ${error.message}`); | ||
} | ||
let res = await axios({ | ||
url: 'https://www.screenshotmachine.com/capture.php', | ||
method: 'post', | ||
data: form | ||
}); | ||
let cookies = res.headers['set-cookie']; | ||
let buffer = await axios({ | ||
url: 'https://www.screenshotmachine.com/' + res.data.link, | ||
headers: { | ||
'cookie': cookies.join('') | ||
}, | ||
responseType: 'arraybuffer' | ||
}); | ||
return Buffer.from(buffer.data); | ||
} | ||
module.exports = sswebA; |
{ | ||
"name": "sazumiviki-api", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "sazumiviki-api adalah salah satu modul yang membuat kode Anda bekerja dengan mudah, sehingga Anda dapat menghasilkan apa yang Anda inginkan dengan mudah", | ||
@@ -33,3 +33,4 @@ "main": "index.js", | ||
}, | ||
"type": "commonjs" | ||
"main": "index.js", | ||
"module": "index.js" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4106
99