Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I got this error on windows 11 #49

Open
6abr opened this issue Jan 1, 2024 · 29 comments
Open

I got this error on windows 11 #49

6abr opened this issue Jan 1, 2024 · 29 comments
Assignees
Labels
bug Something isn't working

Comments

@6abr
Copy link

6abr commented Jan 1, 2024

I am using my windows 11 laptop and everything started working, but when I answered the last question I got this error message:

Traceback (most recent call last):
File "C:\Users\Acer\Downloads\IGFI\scripts\igfi.py", line 659, in
main(username=str(args.username).strip().lower(), sessionfile=str(args.sessionfile).replace('\', '/'))
File "C:\Users\Acer\Downloads\IGFI\scripts\igfi.py", line 413, in main
client.user_follow(users[NAMES[j]])
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\user.py", line 735, in user_follow
assert self.user_id, "Login required"
AssertionError: Login required

C:\Users\Acer\Downloads\IGFI\scripts>

@new92
Copy link
Owner

new92 commented Jan 1, 2024

Hey @6abr is it the first time using IGFI ?

@new92 new92 self-assigned this Jan 1, 2024
@new92 new92 added the bug Something isn't working label Jan 1, 2024
@6abr
Copy link
Author

6abr commented Jan 1, 2024

@new92 yes

@6abr
Copy link
Author

6abr commented Jan 1, 2024

Hello, I tried again on my kali linux virtual machine, but somehow I got the same error: Traceback (most recent call last):
File "/home/bob/tools/IGFI/scripts/igfi.py", line 659, in
, main(username-str(args.username).strip().lower(), sessionfile-str(args.sessionfile).replace
File "/home/bob/tools/IGFI/scripts/igfi.py" arovh. line 413, in main
client.user_follow(users[NAMES[j]])
File "/usr/local/lib/python3.11/dist-packages/instagrapi/mixins/user.py" line 735, in user_follow
assert self.user_id, "Login required"
AssertionError: Login required
bob@ bob)-[~/tools/IGFI/scripts]

@new92
Copy link
Owner

new92 commented Jan 2, 2024

Ok that’s clearly a bug of IGFI let me fix it and I’ll get back to you.

@new92
Copy link
Owner

new92 commented Jan 4, 2024

Hey @6abr I made some changes and hopefully fixed the bug. It should be running just fine now. So try it and let me know

@6abr
Copy link
Author

6abr commented Jan 4, 2024

Hello @new92 , Maybe, i am doing something wrong. I am on Kali linux VM and I got this error. btw i dont know if that is matter, but i can see a consent.txt file but when i used the cat cmd to it, it didnt show anything. I tried with my windows 11 laptop and i got the same error

Traceback (most recent call last):
File "/home/bob/tools/IGFI/scripts/igfi.py", line 688, in
main(username=str(args.username).strip().lower(), password=str(args.password).strip(), session=str(args.session).replace('\', '/')) if args.session is not None else main(username=str(args.username).strip().lower(), password=str(args.password).strip(), session='')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bob/tools/IGFI/scripts/igfi.py", line 316, in main
if os.stat('./files/consent.txt').st_size == 0:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './files/consent.txt'

@new92
Copy link
Owner

new92 commented Jan 4, 2024

@6abr ok try running IGFI from the IGFI directory not the scripts folder if you're doing so. What I would recommend is to make sure to follow the instructions on the README file. I'll review again the code but try the above method and let me know 👍

@6abr
Copy link
Author

6abr commented Jan 4, 2024

@new92 sorry for bother you, I got this error. tell me thats my fault.
error:
Traceback (most recent call last):
File "/home/bob/tools/IGFI/./scripts/igfi.py", line 688, in
main(username=str(args.username).strip().lower(), password=str(args.password).strip(), session=str(args.session).replace('\', '/')) if args.session is not None else main(username=str(args.username).strip().lower(), password=str(args.password).strip(), session='')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bob/tools/IGFI/./scripts/igfi.py", line 328, in main
logging.basicConfig(
File "/usr/lib/python3.11/logging/init.py", line 2050, in basicConfig
h = FileHandler(filename, mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/logging/init.py", line 1181, in init
StreamHandler.init(self, self._open())
^^^^^^^^^^^^
File "/usr/lib/python3.11/logging/init.py", line 1213, in _open
return open_func(self.baseFilename, self.mode,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/home/bob/tools/IGFI/files/consent.txt'

@new92
Copy link
Owner

new92 commented Jan 4, 2024

Hey @6abr don't worry about it, ok to resolve this issue try running IGFI using root access.

@6abr
Copy link
Author

6abr commented Jan 4, 2024

Dear @new92
I am so sorry for bothering you so many times. I have been struggling to run this script successfully but I can't do it. I got a problem again. You advised me to run the script with root access but it got my attention, if I run the script with root access, it doesn't find the session file, so I run the cookies.py with root access to get the session file, but if I run cookies.py with root then it doesn't find the cookies.sqlite file so I don't get the session file it means I can't run the igfi.py, and if I run the script without root access, I get the previous error, so tell me, what am I doing wrong.

@new92
Copy link
Owner

new92 commented Jan 4, 2024

Hey @6abr really don't worry about it. Why when running IGFI with root access it's unable to locate the session file ? Do you specify the file path using the --session option in the terminal / command line ? Oh I see the issue now, so you don't need to run the cookies.py file using root access, only the igfi.py script. So try using this method and let me know 👍

@6abr
Copy link
Author

6abr commented Jan 5, 2024

Hey @new92 , its me again. When I run igfi.py from the igfi directory with root, it cant find the session but when i navigate to the directory where is the session i clearly see the session file, so i dont understand why it cant find it.

@new92
Copy link
Owner

new92 commented Jan 5, 2024

Hi @6abr can you send me a sceenshot of the complete error message ? I really can't understand why igfi is unable to find the session file. My email address is: new92github@gmail.com

@6abr
Copy link
Author

6abr commented Feb 12, 2024

hey! erorr on windows 11. any solution?

Traceback (most recent call last):
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\private.py", line 298, in _send_private_request
response.raise_for_status()
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/accounts/login/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Acer\Downloads\IGFI\igfi.py", line 646, in
main(username=args.username.strip().lower(), password=args.password.strip(), session=args.session.replace('\', '/'))
File "C:\Users\Acer\Downloads\IGFI\igfi.py", line 347, in main
login = client.login(username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\auth.py", line 391, in login
logged = self.private_request("accounts/login/", data, login=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\private.py", line 445, in private_request
raise e
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\private.py", line 432, in private_request
self._send_private_request(endpoint, **kwargs)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\private.py", line 354, in _send_private_request
raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: You'll need to update Instagram to the latest version before you can use the app.

@new92
Copy link
Owner

new92 commented Feb 14, 2024

Hey @6abr oh I see, that's a strange one. Well if you're using an older version of the Instagram app try updating it. Otherwise try re-installing IGFI. If that doesn't work also try rebooting your device and/or your wifi (disable it wait for a couple of seconds and enable it again).

@Akkiii
Copy link

Akkiii commented Mar 7, 2024

image1
I am facing this error.... I have re-install IGFI as well.

@new92
Copy link
Owner

new92 commented Mar 7, 2024

@Akkiii To avoid this error login to Instagram from Firefox, run the cookies.py script and then execute the igfi.py one.

@Akkiii
Copy link

Akkiii commented Mar 7, 2024

Still I am getting the same error.... as I have followed your mentioned steps

@new92
Copy link
Owner

new92 commented Mar 7, 2024

Ok, let's see, so the correct installation steps are these:

sudo su
git clone https://github.com/new92/IGFI
cd IGFI
sudo pip install -r ./files/requirements.txt
python3 ./cookies.py
python3 ./igfi.py -u <username> -p <password> --session <path_to_session_file>

The session file will be generated when running the cookies.py script so make sure to copy the path generated. And paste it in the --session . Make sure that you've followed all these steps berofe running igfi.py

@aditya-kumar-129
Copy link

aditya-kumar-129 commented Mar 19, 2024

@new92 Do we need to replace the path_to_session_file with some other thing in the below command:-
python3 ./igfi.py -u -p --session <path_to_session_file>

If we don't need to put anything then you can mention it in the readme file.
May be some comments like in place of userName place your userName etc.
That could be better.

@aditya-kumar-129
Copy link

aditya-kumar-129 commented Mar 19, 2024

Also, I executed the window commands that you mentioned in the ReadMe file
I got the below error when I ran cookie.py
C:\Users\myuserName\Desktop\IGFI>python3 cookies.py
Using cookies from C:\Users\userName/AppData/Roaming/Mozilla/Firefox/Profiles\w8riq4h2.default\cookies.sqlite.
Cookie import failed: no such table: moz_cookies

Even though I logged in to the Instagram in the firefox browser.
It would be better if you simply make a unlisted video and put the link here/ReadMe

@new92
Copy link
Owner

new92 commented Mar 19, 2024

Hey @aditya-kumar-129 ok thanks for mentioning these issues. Although I can't locate the "python3 ./igfi.py -u -p --session <path_to_session_file>" you're talking about. The command which appears on the README I see in all installation guides is the "python3 ./igfi.py -u -p --session <path_to_session_file>". To answer your question, you replace the <path_to_session_file> with the path generated from the "python3 ./cookies.py" command. As for the error you're encountering to be honest, it's the first time I see an error with such message. However you can try the following steps:

  • Restart Firefox: Sometimes, simply restarting the browser can resolve temporary issues like this.

  • Clear Cookies and Cache: Clearing your browser's cookies and cache might help resolve the issue. Go to Firefox's settings or preferences, find the privacy & security section, and look for options to clear cookies and site data.

  • Check for Updates: Ensure that your Firefox browser is up to date. Sometimes, outdated software can cause compatibility issues.

  • Reset Firefox: If the issue persists, you might consider resetting Firefox to its default settings. This will revert all settings to their defaults, including cookies and cache.

  • Check for Antivirus or Firewall Interference: Sometimes, antivirus or firewall software can interfere with browser operations. Temporarily disabling such software or adding exceptions for Firefox might help.

  • Reinstall Firefox: If none of the above solutions work, you might need to reinstall Firefox to fix any corrupted files or settings.

@aditya-kumar-129
Copy link

aditya-kumar-129 commented Mar 20, 2024

@new92 Regarding the above quote
I installed Firefox for the first time on my machine.

Actually, I also tried in the Ubuntu terminal on my Windows machine by installing the ubuntu.
In that when I run the below command then I get the below error:-
python3 ./cookies.py
No Firefox cookies.sqlite file found. Use -c COOKIEFILE.

I tried to solve the error and at one place I got that I need to include the path to the cookies file using the -c command
So run the below command and then also I am getting the below error:-
python3 ./cookies.py -c "C:\Users\userName\AppData\Roaming\Mozilla\Firefox\Profiles\w8riq4h2.default\cookies.sqlite"
Using cookies from C:\Users\UserName\AppData\Roaming\Mozilla\Firefox\Profiles\w8riq4h2.default\cookies.sqlite.
Cookie import failed: no such table: moz_cookies

I don't know what exactly is the issue. If you could help me it would be greatful.

@aditya-kumar-129
Copy link

@new92
I can also try some manual steps by putting the cookie manually in the file
If you could just tell me which cookie I need to put.

@new92
Copy link
Owner

new92 commented Mar 20, 2024

Hey @aditya-kumar-129 are you logged in to your Instagram account from Firefox ?

@aditya-kumar-129
Copy link

aditya-kumar-129 commented Mar 20, 2024 via email

@new92
Copy link
Owner

new92 commented Mar 20, 2024

Ok, check if Instagram locked your account temporarily and you need to follow a verification process. Check also these issues maybe they'll offer a better solution.

@aditya-kumar-129
Copy link

aditya-kumar-129 commented Mar 22, 2024 via email

@new92
Copy link
Owner

new92 commented Mar 22, 2024

Ok so the error is originated from the Firefox browser. More specifically, Firefox must have changed their database columns which leads to the specific error. In order to resolve this issue you have to install a compatible with the script version of Firefox. That would be 78.x

So uninstall the current version of Firefox and install the 78.x one.

To answer your question, no it's not necessary to install Firefox's webdriver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants