Comments (10)
I can confirm as well. I'm seeing the same behavior and until Mar 1 2024 the login was working
from instagram-private-api.
Me too, I've been seeing the same error since March 2 while trying to upload a story on instagram.
from instagram-private-api.
for now you can use this but make sure the filetype should be of .jpg
`
require("dotenv").config();
const express = require('express')
const app = express()
const port = process.env.PORT || 4000;
const fs = require('fs');
app.listen(port, () => {
console.log(Listening on port ${port}
)
})
const { IgApiClient } = require('instagram-private-api');
const { get } = require('request-promise');
const postToInsta = async () => {
const ig = new IgApiClient();
ig.state.generateDevice(process.env.IG_USERNAME);
await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
const imageFilePath = '222.jpg';
try {
const imageBuffer = fs.readFileSync(imageFilePath);
const publish = await ig.publish.photo({
file: imageBuffer,
caption: 'RTTTT',
});
console.log(publish)
} catch (error) {
console.error('Error reading the image file:', error);
}
}
postToInsta()`
from instagram-private-api.
It's very funny... At localhost it works, but without session.
async #login(username, password, agent) { this.#client = new IgApiClient(); this.#client.state.generateDevice(username); this.#client.request.defaults.agent = agent; // this.#client.request.end$.subscribe(async () => { // const serialized = await this.#client.state.serialize(); // console.log("serialized"); // delete serialized.constants; // this deletes the version info, so you'll always use the version provided by the library // this.#saveSession(serialized); // }); // if (this.#existsSession()) { // console.log("exists"); // const session = await this.#loadSession(); // if (session && Object.keys(session).length > 0) { // console.log("deserialize"); // await this.#client.state.deserialize(session); // return; // } // } console.log("login"); await this.#client.account.login(username, password); }
Works with the latest version 1.46.1!
Thanks @Nerixyz
from instagram-private-api.
Same here
from instagram-private-api.
The current workaround is to overwrite the instagram-private-api
package in your package.json
like this:
"dependencies": {
...
"instagram-private-api": "Nerixyz/instagram-private-api#update-constants",
...
}
Kudos to @Nerixyz
Reference: #1572
from instagram-private-api.
Could anyone check if it works now?
from instagram-private-api.
Could anyone check if it works now?
I get this error when trying to publish anything (post/story):
C:\...\node_modules\instagram-private-api\dist\core\state.js:143
throw new errors_1.IgCookieNotFoundError(key);
^
IgCookieNotFoundError: Cookie "ds_user_id" not found
from instagram-private-api.
It's very funny... At localhost it works, but without session.
async #login(username, password, agent) {
this.#client = new IgApiClient();
this.#client.state.generateDevice(username);
this.#client.request.defaults.agent = agent;
// this.#client.request.end$.subscribe(async () => {
// const serialized = await this.#client.state.serialize();
// console.log("serialized");
// delete serialized.constants; // this deletes the version info, so you'll always use the version provided by the library
// this.#saveSession(serialized);
// });
// if (this.#existsSession()) {
// console.log("exists");
// const session = await this.#loadSession();
// if (session && Object.keys(session).length > 0) {
// console.log("deserialize");
// await this.#client.state.deserialize(session);
// return;
// }
// }
console.log("login");
await this.#client.account.login(username, password);
}
from instagram-private-api.
Issue is fixed with 1.46.1. Thanks @Nerixyz
from instagram-private-api.
Related Issues (20)
- How to develop your own color picker tool
- Post shared on Story issue
- Unexpected `VideoSourceDurationCheckException` Error when uploading short video HOT 4
- Can i send message to broadcast channel ?
- Account got deleted after using this repo HOT 2
- HELP "400 Bad Request; challenge_required" Can you support the solution? HOT 3
- local response vs staging response
- signup with phone number
- .
- HELP ! How can I get more than 21 user tags medias?
- API Endpoint not found HOT 3
- IgUserIdNotFoundError: Could not extract userid (pk)
- How to properly get Reel (Clip) from the given URL and download reel? HOT 2
- Creating a session logs out others
- "We've detected automated behavior on your account" scary warning HOT 1
- baseUrl configuration
- The class DiscoverFeedResponseUser is not reflecting the object that is received
- About this Account
- I want get all following and followers by username HOT 4
- I use ig.media,delete but it respond 400
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instagram-private-api.