Smart123s / ItchClaim

Automatically claim free games from itch.io
https://itchclaim.tmbpeter.com
MIT License
52 stars 1 forks source link

FileNotFoundError session-{username}.json #16

Closed latchee closed 1 month ago

latchee commented 1 month ago

Hi There, I just installed itchclaim and when I try to run it, I get the error: `> itchclaim --login latchee claim Enter password for user latchee: Traceback (most recent call last): File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/main.py", line 193, in login self.user.load_session() File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/ItchUser.py", line 111, in load_session with open(self.get_default_session_filename(), 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/latchee/.config/itchclaim/users/session-latchee.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/latchee/.local/bin/itchclaim", line 8, in sys.exit(main()) File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/main.py", line 207, in main Fire(ItchClaim) File "/home/latchee/.local/lib/python3.10/site-packages/fire/core.py", line 143, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/latchee/.local/lib/python3.10/site-packages/fire/core.py", line 477, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/home/latchee/.local/lib/python3.10/site-packages/fire/core.py", line 693, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/main.py", line 51, in init self.login(login, password, totp) File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/main.py", line 202, in login self.user.login(password, totp) File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/ItchUser.py", line 68, in login self.user_id = soup.find_all(attrs={"name": "user_id"})[0]['value'] IndexError: list index out of range`

It looks like itchclaim is not saving the session's information. I manually created the folders /itchclaim/users/ as they did not exist under /home/latchee/.config/. Unfortunately, this did not resolve the issue. I also tried to touch /home/latchee/.config/itchclaim/users/session-latchee.json, but then itchclaim was not happy as the file was empty. I have now deleted session-latchee.json again.

Would you be able to help?

Smart123s commented 1 month ago

The error occurred if the user didn't have 2FA enabled, but the script still tried to load data from the 2FA page.

Should be fixed in v1.4.3. Please update with pip install --upgrade itchclaim.

From your logs:

File "/home/latchee/.local/lib/python3.10/site-packages/ItchClaim/ItchUser.py", line 68, in login
self.user_id = soup.find_all(attrs={"name": "user_id"})[0]['value']
IndexError: list index out of range`
latchee commented 4 weeks ago

Fantastic, thank you very much!