-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa6a3a7
commit 0afbca2
Showing
5 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Usage on Replit | ||
|
||
Scratch blocks most requests from the Replit, so you must work around it. To log into Scratch, instead of using your password, you can use your token and session ID. | ||
|
||
You can obtain your session ID by [opening your browser developer tools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools), going to Application > Storage (or just Storage), then finding "scratchsessionsid" and copying the cookie value. | ||
|
||
![Getting the session ID from browser devtools](../assets/session-id.png) | ||
|
||
You can obtain your token by running this in your browser console: | ||
```js | ||
alert( | ||
document.getElementById('app')._reactRootContainer._internalRoot | ||
.current.child.pendingProps.store.getState() | ||
.session.session.user.token | ||
); | ||
``` | ||
|
||
Then copying the value that flashes on your screen. | ||
|
||
Then, to log in to scratchclient, use this code: | ||
```python | ||
from scratchclient import ScratchSession | ||
|
||
session = ScratchSession("username", session_id="session ID here", token="token here") | ||
``` | ||
|
||
However, a lot of functionality still might not work. Sites like [Glitch](https://glitch.com/) could serve your purpose in that case- or you can just host it on your own computer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters