Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Gimenz/insta-fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Gimenz committed Feb 26, 2024
2 parents 75ab042 + b9bcea8 commit 468bef4
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 207 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ more example you can check at example.ts file

```js
let { igApi } = require("insta-fetcher");
let ig = new igApi("your cookie");

// some example with proxy, but i never test it
let ig = new igApi("your cookie", false, {
proxy: {
host: 'proxy-url',
port: 80,
auth: {username: 'my-user', password: 'my-password'}
}
});

// Public post
ig.fetchPost("https://www.instagram.com/reel/CXhW_4sp32Z/").then((res) => {
Expand Down
13 changes: 10 additions & 3 deletions examples/example.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
// an example to get cookie using getCookie function

import { getCookie, igApi, isIgPostUrl, shortcodeFormatter } from '../src'
const ig = new igApi('your Cookie');

// some example working with axios proxy
const proxy = {
host: '127.0.0.1',
port: 1337,
protocol: 'http'
}
const ig = new igApi('your Cookie', { proxy });

// you can easily get ig cookie. from anywhere, termux, terminal or etc
getCookie('username', 'password').then(res => {
Expand Down Expand Up @@ -41,10 +48,10 @@ getCookie('username', 'password').then(res => {
console.log(userV2);

// ig url can be extracted , you can use shortcodeFormatter
const formatted = shortcodeFormatter('https://www.instagram.com/p/CW0hkIOFip9/?utm_source=ig_web_copy_link');
const formatted = shortcodeFormatter('https://www.instagram.com/p/C3M96a2vOCV/?utm_source=ig_web_copy_link&igsh=MzRlODBiNWFlZA==');
console.log(formatted);

// or if you want to check wether the ig post is valid url?
const check = isIgPostUrl('https://www.instagram.com/p/CW0hkIOFip9/?utm_source=ig_web_copy_link');
const check = isIgPostUrl('https://www.instagram.com/p/C3M96a2vOCV/?utm_source=ig_web_copy_link&igsh=MzRlODBiNWFlZA==');
console.log(check);
})();
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 51 additions & 51 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
{
"name": "insta-fetcher",
"version": "1.3.23",
"description": "Simplified Instagram metadata scraping",
"main": "./dist/index.js",
"scripts": {
"build:all": "tsc && typedoc",
"build": "tsc",
"build:docs": "typedoc",
"build:tsc": "tsc",
"start": "tsc && node dist/index.js",
"prepare": "npm run build-ts",
"build-ts": "tsc"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/Gimenz/insta-fetcher.git"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"keywords": [
"instagram-scraper",
"instagram-downloader",
"instagram-saver",
"insta-scraper",
"instagram",
"ig-scraper",
"ig-api",
"instagram-private-api",
"instagram-api",
"instagram-scraping"
],
"author": "Muhamad Ristiyanto <agaaja187@gmail.com> <https://fb.me/mg.ezpz>",
"license": "MIT",
"bugs": {
"url": "https://github.com/Gimenz/insta-fetcher/issues"
},
"homepage": "https://github.com/Gimenz/insta-fetcher",
"dependencies": {
"axios": "^0.27.2",
"big-integer": "^1.6.51",
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/node": "^17.0.29",
"typedoc": "^0.22.15",
"typescript": "^4.6.3"
}
"name": "insta-fetcher",
"version": "1.3.27",
"description": "Simplified Instagram metadata scraping",
"main": "./dist/index.js",
"scripts": {
"build:all": "tsc && typedoc",
"build": "tsc",
"build:docs": "typedoc",
"build:tsc": "tsc",
"start": "tsc && node dist/index.js",
"prepare": "npm run build-ts",
"build-ts": "tsc"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/Gimenz/insta-fetcher.git"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"keywords": [
"instagram-scraper",
"instagram-downloader",
"instagram-saver",
"insta-scraper",
"instagram",
"ig-scraper",
"ig-api",
"instagram-private-api",
"instagram-api",
"instagram-scraping"
],
"author": "Muhamad Ristiyanto <agaaja187@gmail.com> <https://fb.me/mg.ezpz>",
"license": "MIT",
"bugs": {
"url": "https://github.com/Gimenz/insta-fetcher/issues"
},
"homepage": "https://github.com/Gimenz/insta-fetcher",
"dependencies": {
"axios": "^0.27.2",
"big-integer": "^1.6.51",
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/node": "^17.0.29",
"typedoc": "^0.22.15",
"typescript": "^4.6.3"
}
}
12 changes: 3 additions & 9 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@ export const config = {
/** Instagram Base URL */
instagram_base_url: 'https://www.instagram.com',
instagram_base_z4: 'https://z-p4.www.instagram.com',
/** Instagram Api Stories */
instagram_stories_url: 'https://i.instagram.com/api/v1/feed/user',
/** Instagram Api Fetch User Data */
instagram_user_url: 'https://i.instagram.com/api/v1/users',
/** Instagram Api Fetch media info by media_id */
instagram_media_info_url: 'https://i.instagram.com/api/v1/media/{mediaId}/info/',
/** Instagram Api v1 */
instagram_api_v1: 'https://i.instagram.com/api/v1',
/** Instagram API Search User */
instagram_search_url: 'https://www.instagram.com/web/search/topsearch/?query=',
/** Instagram GraphQL query */
instagram_graphql: 'https://www.instagram.com/graphql/query/',
/** Android User-Agent */
android: 'Instagram 177.0.0.30.119 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)',
/** Desktop User-Agent */
desktop: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36',
/** iPhone User-Agent */
iPhone: 'Instagram 123.0.0.21.114 (iPhone; CPU iPhone OS 11_4 like Mac OS X; en_US; en-US; scale=2.00; 750x1334) AppleWebKit/605.1.15'
};
}
62 changes: 0 additions & 62 deletions src/helper/RequestHandler.ts

This file was deleted.

Loading

0 comments on commit 468bef4

Please sign in to comment.