priyansh-ig-downloader 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/bundle.js +5 -3
  2. package/package.json +3 -2
package/dist/bundle.js CHANGED
@@ -1,10 +1,12 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
3
  typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["insta-package"] = factory());
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["priyansh-ig-downloader"] = factory());
5
5
  })(this, (function () { 'use strict';
6
6
 
7
7
  const CryptoJS = require('crypto-js');
8
+ const fetch = require('node-fetch'); // Add this line to import fetch in Node.js
9
+
8
10
  function encrypt (input) {
9
11
  const key = CryptoJS.enc.Utf8.parse('qwertyuioplkjhgf');
10
12
  const iv = CryptoJS.lib.WordArray.random(16); // IV length is 16 bytes
@@ -28,7 +30,7 @@
28
30
  const headers = {
29
31
  'url': encrypt(url)
30
32
  };
31
- const response = await fetch(base_url, {
33
+ const response = await fetch(base_url, { // Using fetch from node-fetch
32
34
  method: "GET",
33
35
  headers,
34
36
  });
@@ -40,7 +42,7 @@
40
42
  } catch (err) {
41
43
  reject(err);
42
44
  }
43
- })
45
+ });
44
46
 
45
47
  }
46
48
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "priyansh-ig-downloader",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "main": "dist/bundle.js",
6
6
  "scripts": {
7
7
  "build": "rollup --config",
@@ -45,7 +45,8 @@
45
45
  },
46
46
  "homepage": "https://github.com/priyanshu192/priyansh-ig-downloader#readme",
47
47
  "dependencies": {
48
- "crypto-js": "^4.2.0"
48
+ "crypto-js": "^4.2.0",
49
+ "node-fetch": "^2.6.5"
49
50
  },
50
51
  "devDependencies": {
51
52
  "rollup": "^4.18.0"