priyansh-ig-downloader 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +49 -0
- package/package.json +1 -1
package/dist/bundle.js
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
3
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["insta-package"] = factory());
|
5
|
+
})(this, (function () { 'use strict';
|
6
|
+
|
7
|
+
const CryptoJS = require('crypto-js');
|
8
|
+
function encrypt (input) {
|
9
|
+
const key = CryptoJS.enc.Utf8.parse('qwertyuioplkjhgf');
|
10
|
+
const iv = CryptoJS.lib.WordArray.random(16); // IV length is 16 bytes
|
11
|
+
|
12
|
+
const encrypted = CryptoJS.AES.encrypt(input, key, {
|
13
|
+
iv: iv,
|
14
|
+
mode: CryptoJS.mode.ECB,
|
15
|
+
padding: CryptoJS.pad.Pkcs7,
|
16
|
+
});
|
17
|
+
|
18
|
+
// Convert the encrypted bytes to a hex string
|
19
|
+
const encryptedHex = encrypted.ciphertext.toString(CryptoJS.enc.Hex);
|
20
|
+
return encryptedHex;
|
21
|
+
}
|
22
|
+
|
23
|
+
async function main (url) {
|
24
|
+
|
25
|
+
return new Promise(async (resolve, reject) => {
|
26
|
+
try {
|
27
|
+
const base_url = "https://backend.instavideosave.com/allinone";
|
28
|
+
const headers = {
|
29
|
+
'url': encrypt(url)
|
30
|
+
};
|
31
|
+
const response = await fetch(base_url, {
|
32
|
+
method: "GET",
|
33
|
+
headers,
|
34
|
+
});
|
35
|
+
const data = await response.json();
|
36
|
+
|
37
|
+
if (!data) reject({ result: null });
|
38
|
+
delete data.fetch;
|
39
|
+
resolve(data);
|
40
|
+
} catch (err) {
|
41
|
+
reject(err);
|
42
|
+
}
|
43
|
+
})
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
return main;
|
48
|
+
|
49
|
+
}));
|