TimMcCool / scratchattach

Scratch API wrapper with support for almost all site features, cloud requests framework and more
MIT License
179 stars 50 forks source link

Login issue #7

Closed jimjamgithub closed 2 years ago

jimjamgithub commented 2 years ago

so, while trying to log in to my account in scratchattach, it firstly returns with: Failed to login. Either the provided authentication data is wrong or your network is banned from Scratch The authentication data is correct, and i did login with the same account on the same network after that. Then this long error message comes:

Traceback (most recent call last):
  File "/home/runner/mmo-crasher/venv/lib/python3.8/site-packages/scratchattach/_session.py", line 240, in login
    session_id = str(re.search('"(.*)"', request.headers["Set-Cookie"]).group())
AttributeError: 'NoneType' object has no attribute 'group'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    session = scratch3.login("", "")
  File "/home/runner/mmo-crasher/venv/lib/python3.8/site-packages/scratchattach/_session.py", line 243, in login
    raise(_exceptions.LoginFailure)
scratchattach._exceptions.LoginFailure

also, the same code worked about an hour earlier i'm using replit btw

Edit: Removed login data - TimMcCool

TimMcCool commented 2 years ago

Scratch banned some of replit's IP adresses, so logging in from replit does not always work. scratchattach._exceptions.LoginFailure is raised when Scratch blocks the login request.

jimjamgithub commented 2 years ago

oh ok, thats annoying (also didn't realise i left login details in the error message, thanks for removing)

TimMcCool commented 2 years ago

You can sometimes fix the problem by forking the repl, that will give the repl a new ip adress.

catguy323 commented 3 months ago

how do you make it access the forked repl

TimMcCool commented 3 months ago

The info from this issue is no longer up to date. Scratch blocked all replit IPs from accessing all API endpoints (except for cloud variables) about two years ago.