priyansh-ig-downloader 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ name: "publish npm"
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ publish:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - name: checkout
10
+ uses: actions/checkout@v2
11
+ - name: node
12
+ uses: actions/setup-node@v2
13
+ with:
14
+ node-version: 14
15
+ registry-url: https://registry.npmjs.org
16
+ - name: publish
17
+ run: npm publish --access public
18
+ # working-directory: package.json
19
+ env:
20
+ NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ ## Instalation :
2
+ ```bash
3
+ > npm i --save priyansh-ig-downloader
4
+ ```
5
+
6
+ ## Example
7
+ ```js
8
+ const instagramGetUrl = require("instagram-url-direct")
9
+ async function downloadMedia() {
10
+ try {
11
+ const download = await instagramGetUrl("https://www.instagram.com/tv/CdmYaq3LAYo/");
12
+ console.log(download);
13
+ } catch (error) {
14
+ console.error(error);
15
+ }
16
+ }
17
+
18
+ downloadMedia();
19
+ ```
20
+ ## Output Example
21
+ ```
22
+ {
23
+ results_number : 1,
24
+ url_list : [
25
+ 'https://scontent.cdninstagram.com/v/t50.2886-16/281176759_330829732466343_6214175692160325206_n.mp4?_nc_ht=scontent.cdninstagram.com&_nc_cat=103&_nc_ohc=tsiSkUxDxfEAX-u8MmX&edm=AJBgZrYBAAAA&ccb=7-5&oe=62D43703&oh=00_AT-8ndeJFByZE0H6IqNwZasKMBfaqXRiwGoFL1tR_RSflA&_nc_sid=78c662'
26
+ ]
27
+ }
28
+ ```
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "priyansh-ig-downloader",
3
+ "version": "1.0.0",
4
+ "description": "Get direct url to download from Instagram media links",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "node src/test.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/priyanshu192/priyansh-ig-downloader.git"
12
+ },
13
+ "keywords": [
14
+ "instagram",
15
+ "downloader",
16
+ "media",
17
+ "link",
18
+ "photo",
19
+ "video",
20
+ "url",
21
+ "picture",
22
+ "image",
23
+ "download"
24
+ ],
25
+ "author": "victorsouzaleal <victorsouzaleal@gmail.com>",
26
+ "license": "MIT",
27
+ "bugs": {
28
+ "url": "https://github.com/priyanshu192/priyansh-ig-downloader/issues"
29
+ },
30
+ "homepage": "https://github.com/priyanshu192/priyansh-ig-downloader#readme",
31
+ "dependencies": {
32
+ "axios": "^1.6.8",
33
+ "cheerio": "^1.0.0-rc.12",
34
+ "qs": "^6.12.1"
35
+ }
36
+ }
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ const _0x37d7d4=_0x1531;(function(_0x371809,_0x364da3){const _0x2dce0a=_0x1531,_0x3e4b98=_0x371809();while(!![]){try{const _0x30bc69=parseInt(_0x2dce0a(0x14e))/0x1*(parseInt(_0x2dce0a(0x157))/0x2)+-parseInt(_0x2dce0a(0x146))/0x3*(-parseInt(_0x2dce0a(0x14d))/0x4)+-parseInt(_0x2dce0a(0x145))/0x5+-parseInt(_0x2dce0a(0x141))/0x6+-parseInt(_0x2dce0a(0x142))/0x7*(parseInt(_0x2dce0a(0x153))/0x8)+-parseInt(_0x2dce0a(0x149))/0x9*(parseInt(_0x2dce0a(0x140))/0xa)+-parseInt(_0x2dce0a(0x13b))/0xb*(-parseInt(_0x2dce0a(0x147))/0xc);if(_0x30bc69===_0x364da3)break;else _0x3e4b98['push'](_0x3e4b98['shift']());}catch(_0x2db4c9){_0x3e4b98['push'](_0x3e4b98['shift']());}}}(_0x4179,0x69903));function _0x4179(){const _0x1e0d14=['268287AkNdcD','58092ojtrpm','Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/115.0.0.0\x20Safari/537.36\x20Edg/115.0.1901.183','9TZtBoB','empty','application/x-www-form-urlencoded','stringify','32OWjRCx','1704jZmKJh','length','attr','en-US,en;q=0.9','data','64WxqZFr','post','.download-items','cheerio','530TjpNSR','gzip,\x20deflate,\x20br','https://v3.saveig.app/api/ajaxSearch','same-origin','media','https://saveig.app/','https://saveig.app','XMLHttpRequest','href','2189WLtLqH','each','*/*','axios','\x22Windows\x22','6289310GtQnRC','144996vRYaOf','337106ZyCWkS','.download-items__btn\x20>\x20a','exports','3298015MRDSlS'];_0x4179=function(){return _0x1e0d14;};return _0x4179();}function _0x1531(_0x19a0ad,_0x148dd2){const _0x41799e=_0x4179();return _0x1531=function(_0x1531f3,_0x53c4b2){_0x1531f3=_0x1531f3-0x138;let _0x33c44b=_0x41799e[_0x1531f3];return _0x33c44b;},_0x1531(_0x19a0ad,_0x148dd2);}const axios=require(_0x37d7d4(0x13e))['default'],qs=require('qs'),cheerio=require(_0x37d7d4(0x156));module[_0x37d7d4(0x144)]=instagramGetUrl=_0x3be40d=>{return new Promise(async(_0x4f5614,_0x2b8ede)=>{const _0xbba4e0=_0x1531;try{const _0x294561=_0xbba4e0(0x159),_0x1d4613={'q':_0x3be40d,'t':_0xbba4e0(0x15b),'lang':'en'},_0x4df1b1={'Accept':_0xbba4e0(0x13d),'Origin':_0xbba4e0(0x138),'Referer':_0xbba4e0(0x15c),'Accept-Encoding':_0xbba4e0(0x158),'Accept-Language':_0xbba4e0(0x151),'Content-Type':_0xbba4e0(0x14b),'Sec-Ch-Ua':'\x22Not/A)Brand\x22;v=\x2299\x22,\x20\x22Microsoft\x20Edge\x22;v=\x22115\x22,\x20\x22Chromium\x22;v=\x22115\x22','Sec-Ch-Ua-Mobile':'?0','Sec-Ch-Ua-Platform':_0xbba4e0(0x13f),'Sec-Fetch-Dest':_0xbba4e0(0x14a),'Sec-Fetch-Mode':'cors','Sec-Fetch-Site':_0xbba4e0(0x15a),'User-Agent':_0xbba4e0(0x148),'X-Requested-With':_0xbba4e0(0x139)},_0x5ab99e=await axios[_0xbba4e0(0x154)](_0x294561,qs[_0xbba4e0(0x14c)](_0x1d4613),{'headers':_0x4df1b1}),_0x480e5f=_0x5ab99e[_0xbba4e0(0x152)][_0xbba4e0(0x152)];if(!_0x480e5f)_0x2b8ede({'results_number':0x0,'url_list':[]});const _0x2300dd=cheerio['load'](_0x480e5f),_0x435ce6=_0x2300dd(_0xbba4e0(0x155)),_0x51b0de=[];_0x435ce6[_0xbba4e0(0x13c)]((_0x23b801,_0x4e374b)=>{const _0x77a53f=_0xbba4e0,_0x5d4d11=_0x2300dd(_0x4e374b)['find'](_0x77a53f(0x143))[_0x77a53f(0x150)](_0x77a53f(0x13a));_0x51b0de['push'](_0x5d4d11);});let _0x321305={'results_number':_0x51b0de[_0xbba4e0(0x14f)],'url_list':_0x51b0de};_0x4f5614(_0x321305);}catch(_0x1d366e){_0x2b8ede(_0x1d366e);}});};
package/src/test.js ADDED
@@ -0,0 +1,28 @@
1
+ const instagramGetUrl = require("./index")
2
+
3
+ async function test(url){
4
+ let result = await instagramGetUrl(url)
5
+ return result
6
+ }
7
+
8
+ test("https://www.instagram.com/p/CMAMhvgsVal1/").then(result=>{
9
+ console.log("Test Videos/Images OK")
10
+ console.dir(result, {depth: null})
11
+ }).catch(err=>{
12
+ console.error(err)
13
+ })
14
+
15
+ /*
16
+ test("https://www.instagram.com/p/CHSvvKXpkH6/").then(result=>{
17
+ console.log("Test Only Image OK")
18
+ console.log(result)
19
+ }).catch(err=>{
20
+ console.error(err)
21
+ })
22
+
23
+ test("https://www.instagram.com/tv/CdmYaq3LAYo/").then(result=>{
24
+ console.log("Test Only Video OK")
25
+ console.log(result)
26
+ }).catch(err=>{
27
+ console.error(err)
28
+ })*/