breuerfelix / jinsta

javascript + instagram + algorithms
MIT License
60 stars 13 forks source link

IgCookieNotFoundError: Cookie "ds_user_id" not found #71

Closed bmsimo closed 4 years ago

bmsimo commented 4 years ago

I've read the documentation and it doesn't say that i should add a cookie, or login first in the browser.

this is the entire log

(node:1989) UnhandledPromiseRejectionWarning: IgCookieNotFoundError: Cookie "ds_user_id" not found
    at State.extractCookieValue (/Users/eip/Documents/newig/node_modules/instagram-private-api/dist/core/state.js:101:19)
    at State.get cookieUserId [as cookieUserId] (/Users/eip/Documents/newig/node_modules/instagram-private-api/dist/core/state.js:86:21)
    at LauncherRepository.postLoginSync (/Users/eip/Documents/newig/node_modules/instagram-private-api/dist/repositories/launcher.repository.js:12:39)
    at /Users/eip/Documents/newig/node_modules/instagram-private-api/dist/services/simulate.service.js:22:40
    at Bluebird.map.request (/Users/eip/Documents/newig/node_modules/instagram-private-api/dist/services/simulate.service.js:49:49)
    at tryCatcher (/Users/eip/Documents/newig/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/Users/eip/Documents/newig/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (/Users/eip/Documents/newig/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (/Users/eip/Documents/newig/node_modules/bluebird/js/release/promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (/Users/eip/Documents/newig/node_modules/bluebird/js/release/map.js:37:10)
    at _drainQueueStep (/Users/eip/Documents/newig/node_modules/bluebird/js/release/async.js:97:12)
    at _drainQueue (/Users/eip/Documents/newig/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/eip/Documents/newig/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues (/Users/eip/Documents/newig/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (timers.js:637:19)
(node:1989) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1989) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Maybe i'm missing something here?

imkimchi commented 4 years ago

can you try to add a seed?

like

config.seed = 'something'

bmsimo commented 4 years ago

@imkimchi Perfect! Working right now, what's the seed config?

imkimchi commented 4 years ago

its used for creating deviceid I think! to make it unique

imkimchi commented 4 years ago

@breuerfelix I think seed config should be required since it doesnt work when seed is same as username?

bmsimo commented 4 years ago

@imkimchi Great, i tried it , it worked. Here's my config:

config.seed = 'something';
config.likeLimit = 25;
config.mediaDelay = 60;
// you can edit every property you want
// just do it like we change the keywords here
config.tag = [ 'kitty', 'kitten', 'catstagram', 'catsofinstagram' ];
config.blacklist = [
    'porn', 'naked', 'sex', 'vagina', 'penis', 'nude',
    'tits', 'boobs', 'like4like', 'nsfw', 'sexy', 'drugs',
    'babe', 'binary', 'bitcoin', 'crypto', 'forex', 'dick',
    'squirt', 'gay', 'homo', 'nazi', 'jew', 'judaism',
    'muslim', 'islam', 'hijab', 'niqab', 'farright',
    'rightwing', 'conservative', 'death', 'racist', 'cbd',
  ];

I don't think i'll use it for now, it started liking a random user's pics, which had no description and max 3 likes. I guess i'm too spoiled with instapy being able to filter a post by min likes,description and even language :/

Nevertheless, i wish you the best with this project 👍

breuerfelix commented 4 years ago

i fixed the issue with the config seed :)

@drakruka the project is just an MVP right now to see if we dont experience blocks :)