dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

Save cookies and send with other request #1200

Open Lekinio opened 4 years ago

Lekinio commented 4 years ago

Can I save ds_user_id, ds_user, sessionid cookies by myself and use them with other functions?

i am trying to set my cookis but i have error:

Error: Cookie has domain set to a public suffix

rejectPublicSuffixes options is not helping

Nerixyz commented 4 years ago

i am trying to set my cookis but i have error:

How do you do that?

Lekinio commented 4 years ago

i am trying to set my cookis but i have error:

How do you do that?

like this: const cookiejar = newtough.CookieJar();`

const cookie = new Cookie({ key: 'ds_user_id', value: '37239670721', expires: new Date('2020-09-16T11:08:05.000Z'), maxAge: 7776000, domain: instagram.com, path: '/', secure: true, hostOnly: false, creation: new Date('2020-06-18T11:08:05.507Z'), lastAccessed: new Date('2020-06-18T11:08:05.507Z'), });

`this.ig.state.cookieJar.setCookie(cookie.toString(),` 'instagram');`
bolds07 commented 4 years ago

I'm trying to do something similar.

I'm trying to get the api request cookies set to a browser and use from there. does anyone know if it is possible?