yatsenkolesh / instagram-nodejs

Simple library for auth, get followers, search by hashtags and locations, like posts, follow, get user feed of instagram with nodejs
MIT License
318 stars 74 forks source link

i cant get it to work #34

Open poomkusa opened 6 years ago

poomkusa commented 6 years ago

i installed the package, then used this code:

let Instagram = require('instagram-nodejs-without-api');
Instagram = new Instagram()

Instagram.getCsrfToken().then((csrf) =>
{
  Instagram.csrfToken = csrf;
}).then(() =>
{
  return Instagram.auth('inst-your-username', 'inst-your-password').then(sessionId =>
  {
    Instagram.sessionId = sessionId

    return Instagram.getUserDataByUsername('username-for-get').then((t) =>
    {
      return Instagram.getUserFollowers(t.graphql.user.id).then((t) =>
      {
        console.log(t); // - instagram followers for user "username-for-get"
      })
    })

  })
}).catch(console.error);

i changed three parameters: 'inst-your-username', 'inst-your-password', and 'username-for-get' to my own, then get this error: image

not sure if im doing this right, not a very solid background here. any help or suggestion to documentation/link/example i should learn would be appreciated.

kimaldis commented 6 years ago

FWIW, I get the same. with the added information that both csrf & sessionID are undefined. Any thoughts? I'm also a little green in this area.

aidv commented 6 years ago

I have reverse engineered whatever it is that Instagram is doing for a few days now and I've fixed whatever is needed to log in, now I need the developer to let me push a commit.

Whatever needs to be done after that is up to everybody else to figure out.

@yatsenkolesh OD, wanna let me push?

aidv commented 6 years ago

I have forked and updated the code https://github.com/aidv/instagram-nodejs

yatsenkolesh commented 6 years ago

@aidv please, create a pull request.

aidv commented 6 years ago

@yatsenkolesh np, I did yesterday I think

aidv commented 6 years ago

I'm sorry I'm new to the whole Git thing. I'm using GitKraken

yatsenkolesh commented 6 years ago

Maybe I can help you:

1) try to clone this repo 2) create a new branch 3) apply your changes 4) make git push

aidv commented 6 years ago

@yatsenkolesh thank you, but it says Push failed - Access denied

yatsenkolesh commented 6 years ago

you are pushed own branch or to master ?

aidv commented 6 years ago

On my own. I need access somehow, or just download instagram.js from my repo and upload it. These are my changed:

yatsenkolesh commented 6 years ago

Sorry, please make screenshot, when you pushing to own branch

yatsenkolesh commented 6 years ago

Its should works

aidv commented 6 years ago

https://www.youtube.com/watch?v=VblEyH4aaxg&feature=youtu.be

yatsenkolesh commented 6 years ago

I have a solution. Visit you fork and click to "Pull request" button

screen shot 2018-08-19 at 12 24 14 am

aidv commented 6 years ago

Done

yatsenkolesh commented 6 years ago

We are fixed! I updated the version. Try to use 1.0.3, but if u will have challenge required exception - push me. Thanks, @aidv

yildirimatcioglu commented 6 years ago

"Instagram authentication failed (challenge required erro)", at 1.0.3 I can get token but can not get sessionId

yatsenkolesh commented 6 years ago

@wixvii try to change account or auth from web interface. Instagram is changing API and we should prepare functional to instagram challenges.

yildirimatcioglu commented 6 years ago

how can I change auth ? I didnt understand it

yatsenkolesh commented 6 years ago

Sorry, I mean - change account

yildirimatcioglu commented 6 years ago

its still same ?

oplusplus commented 5 years ago

"Instagram authentication failed (challenge required erro)", at 1.0.3 I can get token but can not get sessionId

same thing happening here! please any help??