Open EddyVinck opened 4 years ago
I have the same problem.
I have the same problem too.
The auth() method is always returning a 404 Bad Request reply. SessionId is never set due to this issue. So this package is not updated to the current auth method required by IG.
Still not working?
The auth() method is always returning a 404 Bad Request reply. SessionId is never set due to this issue. So this package is not updated to the current auth method required by IG.
Any references or documentation on the new auth method and url? I assume this is now done use GraphQL? Maybe i could open another pull request if i get this to work.
Current workaround: copy your csrf and sessionid cookies from the instagram.com page after using their official login and use these in this API.
const instagram = new Instagram();
instagram.csrfToken = cookies.csrf;
instagram.sessionId = cookies.sessionid;
I have the same problem
I managed to get the sessionId cookie by writing a simple cypress test that login into instagram and write a .txt
file with the sessionId cookie.
You can run this test and chain another script to read the cookie and use this library.
This test may need some changes in the future depending on instagram changes, but you get the idea
describe("Create cookie", () => {
it("Creates cookie", () => {
cy.visit("https://www.instagram.com/");
cy.get('[name="username"]').type("useremail");
cy.get('[name="password"]').type("userpassword").type("{enter}");
cy.wait(5000);
cy.getCookie("sessionid").then((cookie) => {
cy.writeFile("cookie.txt", cookie.value);
cy.wait(2000);
cy.exec("node cypress/e2e/instagram.js");
});
});
});
Does this package still work for anyone?
Here is a (slightly changed) example from the README: