Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
fixed #89 hard coded the app ids
Browse files Browse the repository at this point in the history
  • Loading branch information
pishangujeniya committed Apr 15, 2023
1 parent a0474e9 commit ebd3894
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ web_modules/
.next
out

# Nuxt.js build / generate output
.nuxt
dist
# # Nuxt.js build / generate output
# .nuxt
# dist

# Gatsby files
.cache/
Expand Down
20 changes: 16 additions & 4 deletions InstagramHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class InstagramHelper {

this.UserId = this.getCookie("ds_user_id");

this.getConsumerLibCommonsJs().then(async () => {
console.info('Ready you can now continue');
await this.askPrompts()
});
this.storeAppIds();

console.info('Ready you can now continue');
this.askPrompts();
}

private async askPrompts() {
Expand Down Expand Up @@ -91,9 +91,21 @@ class InstagramHelper {
return "";
}

/**
* App Ids Stored from this url : https://static.cdninstagram.com/rsrc.php/v3iyjp4/yO/l/en_US/DRdIhWKQvFs.js?
*/
private storeAppIds() {
// Source https://static.cdninstagram.com/rsrc.php/v3iyjp4/yO/l/en_US/DRdIhWKQvFs.js
localStorage.setItem(this.LocalStorageKeys.instagramFBAppId, "124024574287414");
localStorage.setItem(this.LocalStorageKeys.instagramWebFBAppId, "1217981644879628");
localStorage.setItem(this.LocalStorageKeys.instagramWebDesktopFBAppId, "389801252");
localStorage.setItem(this.LocalStorageKeys.igLiteAppId, "");
}

/**
* provides the ConsumerLibCommon Js File
* @param {string} jsFileName default is 4f7f1faf9a94.js
* @deprecated The method should not be used, use storeAppIds()
*/
private async getConsumerLibCommonsJs(jsFileName: string = "4f7f1faf9a94.js") {

Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ This JavaScript has helper methods to perform various tasks automation.
- That will then generate a Chrome Shortcut on your selected path with name `InstagramHelperChrome`
- Open that Special Chrome Browser using that shortcut. (Ignore the flag that says _You are using an unsupported comman-line flag: --disable-web-security. Stability and security will suffer_) (This flag is shown because we will be mimicking the automation process of Sending Request to Instagram using Chrome).
- Install [**Disable Content-Security-Policy**](https://chrome.google.com/webstore/detail/disable-content-security/ieelmcmcagommplceebfedjlakkhpden?hl=en) Extension.
- Open [Instagram.com](https://instagram.com) in new tab and click on CSP & CORS Unblock extension icons to enable them.
- Open [Instagram.com](https://instagram.com) in new tab and click on CSP icon to enable them. *(It should turn pink)*
- Press `F12` (Developer Tools) or `Ctrl+Shift+I`
- Press `Ctrl+R` to reload the page.
- Paste the following code in the console tab.

```javascript

const script = document.createElement("script");
script.src = "https://cdn.jsdelivr.net/gh/pishangujeniya/instagram-helper@main/InstagramHelper.min.js";
script.src = "https://cdn.jsdelivr.net/gh/pishangujeniya/instagram-helper@3.1/dist/InstagramHelper.min.js";
script.async = false;
document.head.appendChild(script);
setTimeout(() => {
Expand Down Expand Up @@ -109,10 +109,11 @@ setTimeout(() => {
- [PayPal](https://paypal.me/Pishang)

### 😍 Donors
1. [Nikita Rvachev](mailto:[email protected])
2. [Laila Gates](mailto:[email protected])
3. [Mark Utnehmer](mailto:[email protected])
4. [Nadir Ajnay](mailto:[email protected])
1. NXkXiXa RXaXhXv
2. LXiXa GXtXs
3. MXrX UXnXhXeX
4. NXdXr AXnXy
5. MXKXrXiXtXn

<a href="https://paypal.me/Pishang"><img src="./images/9218.jpg"></a>

18 changes: 14 additions & 4 deletions InstagramHelper.js → dist/InstagramHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ class InstagramHelper {
www_claim_v2: "www-claim-v2"
};
this.UserId = this.getCookie("ds_user_id");
this.getConsumerLibCommonsJs().then(() => __awaiter(this, void 0, void 0, function* () {
console.info('Ready you can now continue');
yield this.askPrompts();
}));
this.storeAppIds();
console.info('Ready you can now continue');
this.askPrompts();
}
askPrompts() {
return __awaiter(this, void 0, void 0, function* () {
Expand Down Expand Up @@ -94,9 +93,20 @@ class InstagramHelper {
}
return "";
}
/**
* App Ids Stored from this url : https://static.cdninstagram.com/rsrc.php/v3iyjp4/yO/l/en_US/DRdIhWKQvFs.js?
*/
storeAppIds() {
// Source https://static.cdninstagram.com/rsrc.php/v3iyjp4/yO/l/en_US/DRdIhWKQvFs.js
localStorage.setItem(this.LocalStorageKeys.instagramFBAppId, "124024574287414");
localStorage.setItem(this.LocalStorageKeys.instagramWebFBAppId, "1217981644879628");
localStorage.setItem(this.LocalStorageKeys.instagramWebDesktopFBAppId, "389801252");
localStorage.setItem(this.LocalStorageKeys.igLiteAppId, "");
}
/**
* provides the ConsumerLibCommon Js File
* @param {string} jsFileName default is 4f7f1faf9a94.js
* @deprecated The method should not be used, use storeAppIds()
*/
getConsumerLibCommonsJs(jsFileName = "4f7f1faf9a94.js") {
return __awaiter(this, void 0, void 0, function* () {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "instagram-helper",
"version": "3.0",
"version": "3.1",
"description": "Instagram Scripts for Bulk Unsending Direct Messages",
"main": "InstagramHelper.js",
"scripts": {
"compile": "tsc",
"compile:version": "tsc --outfile dist/InstagramHelper.%npm_package_version%.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
"outDir": "./dist/", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down

0 comments on commit ebd3894

Please sign in to comment.