priyansh-ig-downloader 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bundle.js +49 -0
  2. 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
+ }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "priyansh-ig-downloader",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "main": "dist/bundle.js",
6
6
  "scripts": {
7
7
  "build": "rollup --config",