Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sazumiviki-api

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sazumiviki-api - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

3

api/fbdl.js
const axios = require('axios');
const cheerio = require('cheerio');

@@ -43,3 +44,3 @@ async function fbdl(url) {

if (urls.length === 0) {
throw new Error('No se encontraron enlaces de descarga');
throw new Error('Erorr');
}

@@ -46,0 +47,0 @@

@@ -11,12 +11,25 @@ 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': ''
}
});
try {
const resp = await axios.post('https://www.screenshotmachine.com/capture.php', form);
const cookies = resp.headers['set-cookie'];
const buffer = await axios({
url: 'https://www.screenshotmachine.com/' + resp.data.link,
const buffer = await axios(`https://www.screenshotmachine.com/${resp.data.link}`, {
headers: {
'cookie': cookies.join('')
},
responseType: 'arraybuffer'
responseType: 'arraybuffer'
});

@@ -26,3 +39,3 @@

} catch (error) {
throw new Error(`Error saat mengambil tangkapan layar: ${error.message}`);
throw new Error(`Error while capturing screenshot: ${error.message}`);
}

@@ -29,0 +42,0 @@ }

const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const fbdl = require('./api/fbdl');
const ssweb = require('./api/ssweb');
const app = express();
const PORT = 3000;
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.get('/api/fbdl', async (req, res) => {
const url = req.query.url;
try {
const { url } = req.query;
if (!url) {
throw new Error('URL harus disediakan');
}
const result = await fbdl(url);

@@ -27,10 +18,6 @@ res.json(result);

app.get('/api/ssweb', async (req, res) => {
const url = req.query.url;
try {
const { url } = req.query;
if (!url) {
throw new Error('URL harus disediakan');
}
const result = await ssweb(url);
res.send(result);
res.type('png').send(result);
} catch (error) {

@@ -41,4 +28,5 @@ res.status(500).json({ error: error.message });

const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server berjalan di http://localhost:${PORT}`);
console.log(`Server is running on port ${PORT}`);
});
{
"name": "sazumiviki-api",
"version": "1.0.2",
"version": "1.0.3",
"description": "sazumiviki-api adalah salah satu modul yang membuat kode Anda bekerja dengan mudah, sehingga Anda dapat menghasilkan apa yang Anda inginkan dengan mudah",

@@ -28,8 +28,8 @@ "main": "index.js",

"dependencies": {
"axios": "^1.4.0",
"axios": "^0.24.0",
"cheerio": "^1.0.0-rc.12",
"express": "^4.18.2",
"node-fetch": "^3.3.1"
"node-fetch": "^3.0.0"
},
"type": "commonjs"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc