Discuss Scratch

Techsoft2020
Scratcher
16 posts

scratchclient - A scratch API wrapper for python

(retracted)

Last edited by Techsoft2020 (Feb. 10, 2022 08:18:38)

ajsya
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

mbrick2 wrote:

whats the advantages over scratchconnect
-3
  1. less features then scratchconnect
  2. more buggy (sometimes) then scratchconnect
  3. not as well maintained as scratchconnect (owner is literally banned on scratch)
dhuls
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

ajsya wrote:

mbrick2 wrote:

whats the advantages over scratchconnect
-3
  1. less features then scratchconnect
  2. more buggy (sometimes) then scratchconnect
  3. not as well maintained as scratchconnect (owner is literally banned on scratch)
They released. 5.0 while banned so that doesn't matter
mbrick2
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

dhuls wrote:

ajsya wrote:

mbrick2 wrote:

whats the advantages over scratchconnect
-3
  1. less features then scratchconnect
  2. more buggy (sometimes) then scratchconnect
  3. not as well maintained as scratchconnect (owner is literally banned on scratch)
They released. 5.0 while banned so that doesn't matter
But arnt they on github @CubeyTheCube
god286
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

mbrick2 wrote:

But arnt they on github @CubeyTheCube
CubeyTheCube can't test API changes though.

Last edited by god286 (Feb. 11, 2022 05:42:58)

Chiroyce
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

god286 wrote:

I've just started getting an “incorrect username or password” error for no reason. I'm confused. I tested the credentials and they are correct.
Scratch is now blocking logins from specific Replit IPs
hiPeeps124816
Scratcher
500+ posts

scratchclient - A scratch API wrapper for python

9pfs wrote:

THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????
not necessarily, what about projects continuously monitoring messages
god286
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

Chiroyce wrote:

god286 wrote:

I've just started getting an “incorrect username or password” error for no reason. I'm confused. I tested the credentials and they are correct.
Scratch is now blocking logins from specific Replit IPs


Can we appeal certain accounts or something?!

Last edited by god286 (March 14, 2022 03:04:38)

Techsoft2020
Scratcher
16 posts

scratchclient - A scratch API wrapper for python

god286 wrote:

Chiroyce wrote:

god286 wrote:

I've just started getting an “incorrect username or password” error for no reason. I'm confused. I tested the credentials and they are correct.
Scratch is now blocking logins from specific Replit IPs


Can we appeal certain accounts or something?!


I have same error in replit seriously!
CZSuperboy
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

Chiroyce wrote:

god286 wrote:

I've just started getting an “incorrect username or password” error for no reason. I'm confused. I tested the credentials and they are correct.
Scratch is now blocking logins from specific Replit IPs
Could that be the issue I've been having?
Chiroyce
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

CZSuperboy wrote:

Could that be the issue I've been having?
If your credentials are truly correct, yes. I ran a manual script to login from my device and it worked, but the same script doesn't work in replit/
Joshisaurio
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

Raihan142857 wrote:

A few days ago I noticed there was no easy way to mess with scratch's API in Python so I created a python module to do this. https://pypi.org/project/scratchclient/

You can install it using
pip install scratchclient

Thanks to this npm package for the reference code and ilcheese2 for their modified version of my cloud code.

You can report issues on the github repo, this topic, or my scratch profile.

Usage:
Basic usage:
from scratchclient import ScratchSession
session = ScratchSession("ceebee", "--uwu--")
# post comments
session.get_user("Paddle2See").post_comment("OwO")
# lots of other stuff
print(session.get_project(450216269).get_comments()[0].content)
print(session.get_studio(29251822).description)
Cloud connection:
from scratchclient import ScratchSession
session = ScratchSession("griffpatch", "SecurePassword7")
connection = session.create_cloud_connection(450216269)
connection.set_cloud_variable("variable name", 5000)
@connection.on("set")
def on_set(variable):
    print(variable.name, variable.value)
print(connection.get_cloud_variable("other variable"))

I havent made documentation yet because I'm lazy so feel free to ask questions in this topic.
Wow thanks! I wanted to connect my Python! I'll try it!
coolcoder1213
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

I just use s2py but this is useful for some things.
nini2009ph
Scratcher
87 posts

scratchclient - A scratch API wrapper for python

Shawn12344 wrote:

(#394)
Hello can i get some help with an error i keep getting. the error i get is websocket._exceptions.websocketconnectionclosedexception: connection to remote host was lost. i get the error after my code has been running for about 10+ hours.
Your computer lost connection to the server (There is nothing to do about it then to restart the websocket use try or threading to restart it)
nini2009ph
Scratcher
87 posts

scratchclient - A scratch API wrapper for python

nini2009ph wrote:

(#555)

Shawn12344 wrote:

(#394)
Hello can i get some help with an error i keep getting. the error i get is websocket._exceptions.websocketconnectionclosedexception: connection to remote host was lost. i get the error after my code has been running for about 10+ hours.
Your computer lost connection to the server (There is nothing to do about it then to restart the websocket use try or threading to restart it)
Or you can try my client xd https://replit.com/@nini2009ph/ScratchCloudClient-BETA-10#main.py (Copy the URL don't click it because scratch makes the @ to 40% xd)

Last edited by nini2009ph (April 19, 2022 05:04:58)

-Ninja--
Scratcher
6 posts

scratchclient - A scratch API wrapper for python

What does it do ??
nini2009ph
Scratcher
87 posts

scratchclient - A scratch API wrapper for python

-Ninja-- wrote:

(#557)
What does it do ??
It's like scratchclient but upgraded
eucc
Scratcher
59 posts

scratchclient - A scratch API wrapper for python

-Ninja-- wrote:

What does it do ??
Interaction with Scratch API
AdamKRPS425
Scratcher
44 posts

scratchclient - A scratch API wrapper for python

can you tell me how you made this?

I am interested in making one to suit my needs
SansStudios
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

The creator made this using Python. They had to do a few things:

1. Coding
- Decide on how things work (syntax, objects, etc)
- Write out the code for all of the different objects
- Understand and implement scratch's websocket connection and apis

2. Publishing
- Using PyPi to publish the package

Basically, to create your own scratch python library, you should first learn Python.

Powered by DjangoBB