instagram-private-api: CookieNotValidError
Hi! Everything worked for me. And now suddenly ceased with here such here error.
{“name”:“CookieNotValidError”,“message”:“Cookie
sessionidyou are searching found was either not found or not valid!”}
Nothing changed in the code. Cookies cleaned. What could be the reason?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 33 (1 by maintainers)
Workaround if you are building against a local copy of instagram-private-api, change /v1/cookie-storage.js line 21 from
self.storage.findCookie(CONSTANTS.HOSTNAME, '/', name, function(err, cookie) {to
self.storage.findCookie('instagram.com', '/', name, function(err, cookie) {I refactored this to CONSTANTS.COOKIE_DOMAIN.
Seems to work, not sure of the ramifications… Changing CONSTANTS.HOSTNAME breaks other things, leave it alone. I’m sure there’s a better fix, but I don’t know enough about the cookie implementation to offer a real PR.
\client\v1\jar.jsSorry, but hot-patching third-party code shouldn’t be the preferred way to fix problems. @IvanMMM is there any chance you could do a PR so this can be fixed and merged and packaged right away?
Hey, To everyone that tackles this in the future I managed to get it working. This problem was fixed in version 0.7, but you can’t get it from NPM yet. If you will install this library with npm you will get 0.6.8(At this moment of writing this). to download the specific updated working version try to add this to package.json:
“instagram-private-api”: “git://github.com/huttarichard/instagram-private-api#0.7.0”
and run npm install afterwards. This way the module will be installed directly from github and not from NPM.
https://github.com/dilame/instagram-private-api/issues/596#issuecomment-453927349
Hey guys,
I’m still getting a
after installing the most recent version.
"instagram-private-api": "^0.6.7",@yuceltoluyag >= 0.7 Version still having issues with cookies, look https://github.com/dilame/instagram-private-api/issues/632
Using 0.7 Version and old cookies work while changing i.instagram.com to instagram.com, but i found that is not always working, i am getting CookieNotValidError sometimes but is is disastrous because it is writing user.json files empty with 0kb, and it is breaking all functions
Delete igdm-cli/node_modules/instagram-private-api folder and change ur package.json
and open terminal npm install or npm update. Easy