-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading 'sessionid') #120
Comments
You still need to connect: instagram_mqtt/examples/realtime.example.ts Lines 35 to 67 in f2672ac
|
If I use ig.realtime.connect, the console print out error↓↓↓
I can get my full_name by |
You need to update your dependencies: #117. |
I checked the dependencies, the version of insatgram_mqtt was already 1.2.3
And if I use
|
Are you sure, you're logged in before you access |
I think I do↓↓↓ import { withRealtime } from 'instagram_mqtt'
import { IgApiClient } from "instagram-private-api";
const ig = withRealtime(new IgApiClient());
const IgUsername = 'username';
const IgPassword = 'password';
(async () => {
ig.state.generateDevice(IgUsername);
await ig.account.login(IgUsername, IgPassword);
const IgFull_name = ((await ig.account.currentUser()).full_name)
console.log(`login processed[${IgUsername}], (${IgFull_name})`);
console.log(ig.state.parsedAuthorization.sessionid)
ig.realtime.on('message', (e) => console.log(e.message))
ig.realtime.on('error', console.error)
ig.realtime.on('close', () => console.error("RealtimeClient closed"))
// connect
// this will resolve once all initial subscriptions have been sent
await ig.realtime.connect({
// optional
// graphQlSubs: [
// // these are some subscriptions
// GraphQLSubscriptions.getAppPresenceSubscription(),
// GraphQLSubscriptions.getZeroProvisionSubscription(ig.state.phoneId),
// GraphQLSubscriptions.getDirectStatusSubscription(),
// GraphQLSubscriptions.getDirectTypingSubscription(ig.state.cookieUserId),
// GraphQLSubscriptions.getAsyncAdSubscription(ig.state.cookieUserId),
// ],
// // optional
// skywalkerSubs: [
// SkywalkerSubscriptions.directSub(ig.state.cookieUserId),
// SkywalkerSubscriptions.liveSub(ig.state.cookieUserId),
// ],
// optional
// this enables you to get direct messages
// irisData: await ig.feed.directInbox().request(),
// optional
// in here you can change connect options
// available are all properties defined in MQTToTConnectionClientInfo
// connectOverrides: {},
// optional
// use this proxy
// socksOptions: {
// type: 5,
// port: 12345,
// host: '...',
// },
});
setInterval(() => {
console.log("1sec")
}, 1000)
})(); |
I have the same issue did you find any solution ? |
I haven't found a solution for this package, but I found another node package witch can do the same thing: https://github.com/Debanjan-San/node-ig-framework |
if you look at the dependencies you will notice that he has his own version of the instagram_mqtt that he modified |
This indicates that
The reason this "works" is that they're only trying the |
So, is there a way to continue using |
I think Instagram private api need to be fixed |
I fixed it by decoding and parsing the authorization by my self but now I get this error
|
Can changing the dependencies of this library to node-ig-framework solve this problem? |
No it didn't for me |
Any updates on this? |
I found a solution, by running |
Hello,II'm a beginner in learning programming and I'm having some problems, but I don't know what I'm doing wrong
If you are free, can you take a look at it for me?
this is my code↓↓↓
It will only print "1sec" repeatly, but nothing happens when the message is received
thanks for anyone who help me
The text was updated successfully, but these errors were encountered: