sazumiviki-api
Advanced tools
Comparing version 1.0.7 to 1.0.8
const axios = require('axios'); | ||
async function sswebA(url = '', full = false, type = 'desktop') { | ||
type = type.toLowerCase(); | ||
if (!['desktop', 'tablet', 'phone'].includes(type)) type = 'desktop'; | ||
let form = new URLSearchParams(); | ||
form.append('url', url); | ||
form.append('device', type); | ||
if (!!full) form.append('full', 'on'); | ||
form.append('cacheLimit', 0); | ||
type = type.toLowerCase(); | ||
if (!['desktop', 'tablet', 'phone'].includes(type)) type = 'desktop'; | ||
let form = new URLSearchParams(); | ||
form.append('url', url); | ||
form.append('device', type); | ||
if (!!full) form.append('full', 'on'); | ||
form.append('cacheLimit', 0); | ||
try { | ||
let res = await axios({ | ||
url: 'https://www.screenshotmachine.com/capture.php', | ||
method: 'post', | ||
data: form | ||
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' | ||
url: 'https://www.screenshotmachine.com/' + res.data.link, | ||
headers: { | ||
'cookie': cookies.join('') | ||
}, | ||
responseType: 'arraybuffer' | ||
}); | ||
return Buffer.from(buffer.data); | ||
} catch (error) { | ||
throw new Error('Terjadi kesalahan saat mengambil tangkapan layar: ' + error.message); | ||
} | ||
} | ||
module.exports = sswebA; |
const sswebA = require('./api/ssweb'); | ||
const facebook = require('./api/fbdl'); | ||
const igStalk = require('./api/igStalk') | ||
module.exports = { | ||
sswebA, | ||
facebook, | ||
sswebA, | ||
igStalk, | ||
facebook, | ||
}; |
{ | ||
"name": "sazumiviki-api", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "sazumiviki-api adalah salah satu modul yang membuat kode Anda bekerja dengan mudah, sehingga Anda dapat menghasilkan apa yang Anda inginkan dengan mudah", | ||
@@ -5,0 +5,0 @@ "main": "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
6182
85