Giter Site home page Giter Site logo

edouardcourty / user-instagram Goto Github PK

View Code? Open in Web Editor NEW
84.0 1.0 19.0 696 KB

This module allows you to get the data of any user or post on Instagram.

JavaScript 100.00%
instagram instagram-scraper instagram-feed node-instagram user-instagram

user-instagram's Issues

Error when deploying severless function

Hi!

First of all, thank you for creating this library!
Unfortunately, I cannot get it to work in production.

I'm working on a Next.JS application and use this library inside of a serverless function.
When I'm testing it locally, everything seems to work fine.

However, when I deploy the application using Vercel, I get the following error:
An error occured while fetching data for user boexclusives. Maybe this user does not exist ?

Do you have any idea why this is happening?

Thanks in advance!

"Please submit an Issue on Github"

Hi, today i started using this NPM and got a weird error. Please help :(

Error: Unknown error, please submit an issue on GitHub.
at C:\Users---\OneDrive\Dokumente---\Discord\DC Bots\JoniBot v13\node_modules\user-instagram\src\Instagram\Infrastructure\InstagramRepository.js:374:23
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)

The Code:
const instagram = require('user-instagram');
let name = args[0];
if(!name) return message.channel.send('Enter an account to search for!');
await instagram.authenticate(process.env.username, process.env.passwort);
instagram.getUserData(name).then(userData => {
let embed = new MessageEmbed()
.setTitle(**Profile from: ${userData.getUsername()}**)
message.channel.send({embeds:[embed]});

    })

does not find users

UnableToFetchUserDataError: An error occured while fetching data for user instasamka. Maybe this user does not exist ?
IMG_20210716_001107

TypeError: Cannot read property 'user' of undefined

I know it may be the duplicate of another problem, but for me, I changed everything, tried to run it on different computers, different VPS and stuff and still the same error

The Compelete Error:

(node:3638) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of undefined

    at /rbd/pnpm-volume/25d72025-e3a1-4ce5-8141-f18084a1e354/node_modules/.registry.npmjs.org/user-instagram/2.1.3/node_modules/user-instagram/src/scrape.js:23:37

    at processTicksAndRejections (internal/process/task_queues.js:88:5)

(node:3638) 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: 1)

(node:3638) [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.

i also tried using vpn on everything and still the same.....

Safe to use??

Is this kind of api hitting safe to use. I mean, these apis are not mentioned anywhere officially by facebook/instagram.
What if tomorrow they change these apis, the entire project is dependent on it.

Issue fetching the username

It was working fine previously, and I didn't change any code.
It could be an issue of IG updating their GQL?
I'm pretty sure the user exists, I also tested with other users.

/home/pi/apps/roby/node_modules/user-instagram/src/scrape.js:18
    const user = GQL.data.graphql.user;
                                  ^

TypeError: Cannot read property 'user' of undefined

and

UnableToFetchUserDataError: An error occured while fetching data for user oio.studio. Maybe this user does not exist ?
    at Function.fromUsername (/Users/ml/www/oio/apps/roby/node_modules/user-instagram/src/Exceptions/UnableToFetchUserDataError.js:7:12)
    at /Users/ml/www/oio/apps/roby/node_modules/user-instagram/src/scrape.js:67:43

Comments?

Is it possible to scrape the comments for a user's media post too?

Issues using package

I was trying to use this package for my bot and whenever I run the command, in my console it says:

(node:979) UnhandeledPromiseRejectionWarning: TypeError: Cannot read property 'user' of undefined
     at /home/runner/MLlama-Bot/node_modules/user-instagram/src/scrape.js:23:37
     at runMicrotasks (<anonymous>)
     at processTicksAndRejections (internal/process/task_queues.js:97:5)
...

Error should be rejected

InstagramGenericError should be sent to reject function here.

As currently it is only returned, the promise keeps waiting and never fulfill. This is a major bug and should be fixed.

No session found when running on google cloud platform

Hey, I have an issue with login process. Whenever I try to authenticate it works perfectly if I run the app on my PC, but I have hosted it on GCP, It says that "No session found, Did you authenticate?". This happens only on GCP and not on local system. I have a windows 10 machine and debian 10 on gcp.
Screenshot 2022-03-27 163829

Show only a few Posts

The module only shows a few posts, not all
I have 74 and the module only gives me 10

Crash when user not found.

When I try a search user without an account my app crash with this error:

var error = new Error(message);
              ^

Error: Request failed with status code 404
    at createError (C:\Users\Andrey\Desktop\jobs\testdiscord\node_modules\user-instagram\node_modules\axios\lib\core\createError.js:16:15)
    at settle (C:\Users\Andrey\Desktop\jobs\testdiscord\node_modules\user-instagram\node_modules\axios\lib\core\settle.js:17:12)
    at IncomingMessage.handleStreamEnd (C:\Users\Andrey\Desktop\jobs\testdiscord\node_modules\user-instagram\node_modules\axios\lib\adapters\http.js:244:11)
    at IncomingMessage.emit (node:events:341:22)
    at endReadableNT (node:internal/streams/readable:1294:12)
    at processTicksAndRejections (node:internal/process/task_queues:80:21) {..SOME ERROR..}```

Only works on local host

I'm using the library to create an iscord bot, however I can't find a host that this library works with.

Can running getUserData too often lead to rate limiting the application?

Hi there!

I am using instagram.getUserData() function with a node-cron in 5 minutes interval to check for new photos being posted. I have noticed, that using instagram.authenticate() too often leads to the application getting rate limited very fast, so I tried bypassing it with only logging in once during app initialization. That little trick solved the problem, however I was wondering if my app could still gate rate limited for scraping user data too often. If so, what is the optimal interval to prevent rate limit?

Thanks in advance for all of your answers!

Refused to set unsafe header 'user-agent' & CORS cache-control rejection

As of version 2.1.3 this package is broken and unusable. It works as intended on version 2.0.8 but you changed the request headers after that version which is causing the breaking bug.

You are setting an unsafe header 'user-agent' causing this error : Refused to set unsafe header "user-agent"

And there's also an invalid field cache control that returns the following error.

Access to XMLHttpRequest at 'https://www.instagram.com/xyz/?__a=1' from origin 'https://www.mysite.com' has been blocked by CORS policy: Request header field cache-control is not allowed by Access-Control-Allow-Headers in preflight response.

Can you please revert things to how they were or remove the new request parameters?

Fix description of project

Hi, thanks for package, your can update description in JSON exist one error:

"subscriberCount": 444,
is
"subscribersCount": 444,

The key on json have one error.

UnableToFetchUserDataError

I tried to get data of user 'tassakpro'. And i get this error.

UnableToFetchUserDataError: An error occured while fetching data for user tassakpro. Maybe this user does not exist ?
at Function.fromUsername (/app/node_modules/user-instagram/src/Exceptions/UnableToFetchUserDataError.js:7:12)
at /app/node_modules/user-instagram/src/scrape.js:67:43
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)

User exists. https://www.instagram.com/tassakpro/
It's giving error on github. on my pc, it's working. How can i fix that?

UnableToFetchUserDataError

Hello! When I try to get information about the user, I'm getting the error.

UnableToFetchUserDataError: An error occured while fetching data for user lwjerri. Maybe this user does not exist ?
    at Function.fromUsername (C:\Users\Andrey\Desktop\jobs\japi\node_modules\user-instagram\src\Exceptions\UnableToFetchUserDataError.js:7:12)
    at C:\Users\Andrey\Desktop\jobs\japi\node_modules\user-instagram\src\scrape.js:67:43
    at processTicksAndRejections (node:internal/process/task_queues:93:5)

Unkown error

InstagramGenericError: Unkown error, please submit an issue on GitHub with the following error message: Request failed with status code 400
17:30:45 1|stars | at /var/www/node_modules/user-instagram/src/Instagram/Infrastructure/InstagramRepository.js:382:23
17:30:45 1|stars | at processTicksAndRejections (internal/process/task_queues.js:97:5)

i do get this on auth

Unable to get user data

When plugin does it's request to instagram, instagram graph api is returning 302 with no data. This is causing:

scrape.js:18 Uncaught (in promise) TypeError: Cannot read property 'user' of undefined

Keep "The server has sent an unsuccessful response. The rate limit has been hit, retry later." Although I havent send any request

I tried uploading my backend on digital Ocean and authenticated my Instagram account at first everything was working great but then after leaving the backend for a day or two I couldn't send any request to Instagram my guess is that something is wrong with caching the credentials. I can see that you guys try to re-authenticate the user if the session expires. I am not sure if that's the issue or note but I am just trying to think of a solution

UnableToFetchPostDataError when using AWS

Hi, first of all thanks for all you've done on this it's really been a big help.

I'm running into a problem where when I try to use this package in my app locally, theres no problem but when I deploy my app to AWS I keep running into this issue where the scrapper is unable to find the post and I'm getting:

UnableToFetchPostDataError: An error occured while fetching post data for shortcode CIyq3yGD5Pd. Maybe this post does not exist ?

Any ideas why?

Could this be shut down by Instagram?

Hi, thanks for developing this, it is extremely handy. I just wanted to see if you had any idea about what Instagram's attitudes towards these scrapers. I'm creating an app which needs Instagram info and the Basic API is a pain. Do you think there is a relatively high probability that Instagram will be able to shut off access to APIs such as these or do you think it's secure?

This may be a stupid question but would love to get your opinion on it as the developer.

429 response code

This Package working smoothly until last week. but right now I'm getting 429 error code. does Instagram change anything?

Basic use of the package

I literally have this on my code below:

const IG = require("user-instagram");

IG("sadi.boii")
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });

But I still get the following error message

UnableToFetchUserDataError: An error occured while fetching data for user sadi.boii. Maybe this user does not exist ?
    at Function.fromUsername (/home/junior/Desktop/DJ-COACH-EWALLET/node_modules/user-instagram/src/Exceptions/UnableToFetchUserDataError.js:7:12)
    at /home/junior/Desktop/DJ-COACH-EWALLET/node_modules/user-instagram/src/scrape.js:67:43

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.