althonos / InstaLooter

Another API-less Instagram pictures and videos downloader.
GNU General Public License v3.0
2.01k stars 256 forks source link

v2.4.2 user not fount for all accounts #289

Open evanrich opened 4 years ago

evanrich commented 4 years ago

Library version

What's the installed library version ? Check with instalooter --version:

instalooter v2.4.2

Environment

Describe here your environment, including:

Ubuntu 18.04 LTS Python 3.6.9

Error description - installation

I managed to get this working for a bit after creating the user-agent.txt file in the cache folder, but suddenly now it gives "user not found" for any account I throw at it. It works fine for hashtags, but using "user" stopped working:

instalooter user elliekimxo ./elliekimxo/ -v -N -T {username}.{datetime} --traceback
2020-06-05 21:29:08 homelab-a instalooter.cli[19096] NOTICE Starting download of `elliekimxo`
2020-06-05 21:29:08 homelab-a instalooter.cli[19096] CRITICAL user not found: 'elliekimxo'
Traceback (most recent call last):
  File "/home/evan/.local/lib/python3.6/site-packages/instalooter/cli/__init__.py", line 173, in main
    dlpbar_cls=None if args['--quiet'] else TqdmProgressBar)
  File "/home/evan/.local/lib/python3.6/site-packages/instalooter/looters.py", line 450, in download
    pages_iterator = self.pages()   # type: Iterable[Dict[Text, Any]]
  File "/home/evan/.local/lib/python3.6/site-packages/instalooter/looters.py", line 723, in pages
    it = ProfileIterator.from_username(self._username, self.session)
  File "/home/evan/.local/lib/python3.6/site-packages/instalooter/pages.py", line 178, in from_username
    raise ValueError("user not found: '{}'".format(username))
ValueError: user not found: 'elliekimxo'
evan@homelab-a:/nfs/instagramrips$

Error description - runtime

If you have an issue at runtime, include the required information below:

Reproducible test case

Are you using the CLI ? If so, include a command that can be used to re-raise the error, with actual arguments anybody can try:

instalooter user elliekimxo ./elliekimxo/ -v -N -T {username}.{datetime} --traceback

Expected behaviour

It's supposed to work

Actual behaviour

It suddenly stopped working with user, only works with hashtag

Niggggggo commented 4 years ago

+1 I have the same issue

brndnsvr commented 4 years ago

+1 me too. 'instalooter hashtag blahblahblah' works fine and 'instalooter user anybody' fails. with 'CRITICAL user not found'
os is Kali 2020.2

starf1337 commented 4 years ago

Hopefully the author can update it soon. Although if anyone can find an in-code fix... That would be nice too. I have tried igScraper and it sort of suuuks.

Not an expert, but it looks to me like a syntax/formatting has changed that needs to be addressed in pages.py

evanrich commented 4 years ago

@starf1337 yeah looks like this block:

@classmethod
    def from_username(cls, username, session):
        user_data = cls._user_data(username, session)
        if 'ProfilePage' not in user_data['entry_data']:
            raise ValueError("user not found: '{}'".format(username))

It seems if "ProfilePage" is not in userdata, then it fails with user not found. i might try adding some print statements to see what its getting, but I'm not that good of a python programmer. Looking at instagram's graph api, the only change they made was 5/5/2020, and that was just requesting a timestamp field, doesn't seem like it'd break anything.

evanrich commented 4 years ago

strange... I added a

print(user_data['entry_data']) 

below the user_data =... line, and now it works, although it's sptting out tons of data from user_data...

edit: removed the print line (commented it out) and now it seems to work still.

starf1337 commented 4 years ago

Had it working again but I broke something and kept poor notes. Just conjecture but it seems to be having a problem with cookie session data and captcha. Could just be that my personal login has expired but even if that is the case I cannot logout or login anymore.

To anyone who happens across this, @evanrich has the right idea using print(). At the very least, it shows what data is being passed byref and/or byval in problem areas. Good thinking.

evanrich commented 4 years ago

@starf1337 i can't even get login to work, but im also not using it on a gui based system, so maybe thats why... it seems it can't do a headless chrome login. Also another oddity is that sometimes it complains that a user doesn't exist when you can clearly find that user in instagram, and their profile isn't hidden... The author seems to have abandoned this? My python is rudimentary, but when I have the time I'll try this on a gui based system using some print statements to debug whats going on

starf1337 commented 4 years ago

Ok so I looked around a bit and it looks like the other major instagram projects are having the same issue.

(i.e. https://github.com/postaddictme/instagram-php-scraper/issues/636) - Clue in a later comment but not very helpful.

Edit: Better Example: https://github.com/arc298/instagram-scraper/issues/543

I'll periodically keep an eye on these projects as one of them is bound to figure this thing out. Even if it is in another language at least we will be able to define the problem.

starf1337 commented 4 years ago

Hey @evanrich somebody found a fix on another ticket.

" AdelMadkour commented on May 18 •

I found a quick fix I have seen in another instagram repo ( a php one):

In file InstaLooter/instalooter/looters.py: change this line : data = {'username': username, 'password': password} to this line: data = {'username': username, 'enc_password': '#PWD_INSTAGRAM_BROWSER:0:' + str(time.time()) + ':' + password}"

It worked for me.

Niggggggo commented 4 years ago

Hey @evanrich somebody found a fix on another ticket.

" AdelMadkour commented on May 18 •

I found a quick fix I have seen in another instagram repo ( a php one):

In file InstaLooter/instalooter/looters.py: change this line : data = {'username': username, 'password': password} to this line: data = {'username': username, 'enc_password': '#PWD_INSTAGRAM_BROWSER:0:' + str(time.time()) + ':' + password}"

It worked for me.

I tried using this but unfortunately that didn't work for me.

Funnily enough instalooter works fine without any problems when I run it from my computer at home (or in a Linux VM), but causes the issue above as soon as it runs from my server.

Maybe this has something to do with Insta blocking specific IP addresses?

evanrich commented 4 years ago

I'm not sure @Niggggggo I run from a server at home and sometimes it works, sometimes it doesnt... like I just started running it now on a list, it grabbed the first 3 and now every single user is "not found"

evanrich commented 4 years ago

FYIW,still occurs in 2.4.3

NotRogu commented 4 years ago

Any update?

ghost commented 3 years ago

Same issue here. I think instagram is temporarily blocking ips that are scrapping data.

evanrich commented 3 years ago

i dont think they're blocking ips, as I can browse on my desktop/phone. But the second instalooter runs, even now with 2.4.4, user not found, even on my own profile. They might be analyzing how scrapes happen, or maybe they've updated their api or something and instalooter doesn't work right anymore.

C4l1b3r commented 3 years ago

I had to login for this to download all images.

keithstrydom commented 3 years ago

It's seems to be rate limiting of unauthenticated logins as it also started working after I logged in.

C4l1b3r commented 3 years ago

I run this on Android non root and it works off and on.

sridharmani0510 commented 3 years ago

same prob here couldnt find a fix

xTaromarux commented 2 years ago

Clearing the instalooter cache this is the answer delete cache.txt and user-agent.txt (~/.cache/instalooter/2.4.4 on Linux C:\Users\YOUR-USERNAME\AppData\Local\Martin Larralde\instalooter\Cache\2.4.4 on Windows ). It helps ~(https://github.com/althonos/InstaLooter/issues/322#issuecomment-791234354)

artlung commented 2 years ago

I am having this issue with instalooter user <USER> commands. Trying to make sure I am authenticated right but not sure I am.

instalooter logout gives me back Cookie file not found.

instalooter login prompts me to login. Tried with both email and username. Tried with 2FA on and off, all result in errors but mobile instagram does let me know I was logging in with Mac OS X. With username: Login error: check your login data and with email 'NoneType' object has no attribute 'group

Would like to try @xTaromarux suggestion to delete instalooter cache. Where is that on MacOS? (11.6.2 if it matters)

instalooter version 2.4.4

xTaromarux commented 2 years ago

@artlung First try download cookie from Firefox. https://instaloader.github.io/troubleshooting.html maybe that's why instaloader can't find them because they don't exist

and to login you have to use this command instaloader --login USER_NAME because instaloader is for account login and instalooter is for downloading content

about file path cookie I can't help you because I don't have macOS. So you have to find by yourself.

artlung commented 2 years ago

I was able to uninstall and reinstall instalooter to get around the problem. instaloader does not look related to me. Thanks @xTaromarux

choxner commented 2 years ago

It worked for me once I used instalooter login

Make sure to turn off two step on whatever account you log in as!

Gyombie commented 2 years ago

Hi, I've been trying all the solutions above but I get the error "user not found" for any accounts I try. Has there been any progress on a solution for this issue ??