Look like Instagram changed something on their Instagram main site recently. The web scraping mechanims in this library isn't working well any more. Please help to check and apply a patch as soon as possible.
Best,
-Young
Hi kaki,
Look like Instagram changed something on their Instagram main site recently. The web scraping mechanims in this library isn't working well any more. Please help to check and apply a patch as soon as possible.
Best,
-Young
this.queryHashs = {
story: mainScriptBody.match(/50,[a-zA-Z]="([^"]+)",/)[1], // <- this line
post,
comment,
hashtag: hashtagScriptBody.match(localQueryIdRegex)[1],
location: locationScriptBody.match(localQueryIdRegex)[1],
};
Hi kaki,
When I called `getProfilePostsById`
I got error at Insta._getQueryHashs
`TypeError: Cannot read property '1' of null`
```
this.queryHashs = {
story: mainScriptBody.match(/50,[a-zA-Z]="([^"]+)",/)[1], // <- this line
post,
comment,
hashtag: hashtagScriptBody.match(localQueryIdRegex)[1],
location: locationScriptBody.match(localQueryIdRegex)[1],
};
```
I didn't fix all problems, only fix post queryhash.
In my case, post queryhash should come from ConsumerLibCommons.
const consumerLibCommonsBody = await this.self.get(ConsumerLibCommons, undefined, false);
const [[, firstQueryId], [, secondQueryId]] =[...consumerLibCommonsBody.matchAll(/queryId:"([^"]+)"/g)];
// firstQueryId is used for posts.
And story query hash is still wrong.
(Oh, I used my sessionid as library input)
I didn't fix all problems, only fix post queryhash.
In my case, post queryhash should come from ConsumerLibCommons.
```
const consumerLibCommonsBody = await this.self.get(ConsumerLibCommons, undefined, false);
const [[, firstQueryId], [, secondQueryId]] =[...consumerLibCommonsBody.matchAll(/queryId:"([^"]+)"/g)];
// firstQueryId is used for posts.
```
And story query hash is still wrong.
(Oh, I used my sessionid as library input)
After fully running unit tests, I was able to reproduce the issue on getProfileStoryById and getProfilePostsById, therefore on getProfileStory and getProfilePosts too.
Like you noticed, it must have something to do with query hashes.
I'll invesigate now.
Thanks for reporting.
Alright.
After fully running unit tests, I was able to reproduce the issue on `getProfileStoryById` and `getProfilePostsById`, therefore on `getProfileStory` and `getProfilePosts` too.
Like you noticed, it must have something to do with query hashes.
I'll invesigate now.
Thanks for reporting.
getProfilePostsById (and getProfilePosts) is now fixed as per 6a50348.
getProfileStoryById (and getProfileStory) will have to wait for the v2 refactor, because it involves calling an endpoint from a different domain (https://i.instagram.com/api/v1/feed/reels_media/?reel_ids={profileId}) while the lib, in its current state, isn't flexible enough for that.
I'll begin this work asap.
`getProfilePostsById` (and `getProfilePosts`) is now fixed as per 6a50348.
`getProfileStoryById` (and `getProfileStory`) will have to wait for the v2 refactor, because it involves calling an endpoint from a different domain (`https://i.instagram.com/api/v1/feed/reels_media/?reel_ids={profileId}`) while the lib, in its current state, isn't flexible enough for that.
I'll begin this work asap.
Awesome, was just running into that issue, great to see its resolved, thank you! You should add a public bitcoin address in the description, I'd like to support the repo with a small donation :)
Awesome, was just running into that issue, great to see its resolved, thank you! You should add a public bitcoin address in the description, I'd like to support the repo with a small donation :)
I started working on this last week, I'm hoping to make a pre-release next week.
However, I won't make profit from scraping Instagram, as this activity would switch from illicit to illegal.
Thanks anyway :)
I started working on this last week, I'm hoping to make a pre-release next week.
However, I won't make profit from scraping Instagram, as this activity would switch from *illicit* to *illegal*.
Thanks anyway :)
Hi kaki,
Look like Instagram changed something on their Instagram main site recently. The web scraping mechanims in this library isn't working well any more. Please help to check and apply a patch as soon as possible.
Best,
-Young
Hello,
All unit tests are passing, please provide more details about the issue you're experiencing.
Hi kaki,
When I called
getProfilePostsById
I got error at Insta._getQueryHashs
TypeError: Cannot read property '1' of null
I traced IG query hashs.
Getting posts query hash should be come from ConsumerLibCommons.js.
I can get posts with this change.
Could you please make a PR, or, at least, a diff ?
Thanks.
I didn't fix all problems, only fix post queryhash.
In my case, post queryhash should come from ConsumerLibCommons.
And story query hash is still wrong.
(Oh, I used my sessionid as library input)
Alright.
After fully running unit tests, I was able to reproduce the issue on
getProfileStoryById
andgetProfilePostsById
, therefore ongetProfileStory
andgetProfilePosts
too.Like you noticed, it must have something to do with query hashes.
I'll invesigate now.
Thanks for reporting.
getProfilePostsById
(andgetProfilePosts
) is now fixed as per6a50348
.getProfileStoryById
(andgetProfileStory
) will have to wait for the v2 refactor, because it involves calling an endpoint from a different domain (https://i.instagram.com/api/v1/feed/reels_media/?reel_ids={profileId}
) while the lib, in its current state, isn't flexible enough for that.I'll begin this work asap.
Awesome, was just running into that issue, great to see its resolved, thank you! You should add a public bitcoin address in the description, I'd like to support the repo with a small donation :)
I started working on this last week, I'm hoping to make a pre-release next week.
However, I won't make profit from scraping Instagram, as this activity would switch from illicit to illegal.
Thanks anyway :)