Discuss Scratch

ito-noizi
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

Is it real?
Shuaib_Zaker
Scratcher
78 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

ito-noizi wrote:

wvzack wrote:

BrothersandLuan wrote:

Is there a way just to run scratchattach in an online IDE.

Actually most websites would probably be blocked so it might be hard…
replit works with cloud vars but we all know that nobody even talks about them anymore. Just a question but does it work in chatgpts sidebar when you ask for help?
Regardless of whether you’re using Replit or another online IDE, the Scratch cloud server doesn’t check if your IP or account is banned. That means you can change cloud variables from an online IDE. You can apparently even upload assets this way, though most other actions aren’t supported.

ChatGPT can generate code, but it likely doesn’t have scratchattach installed, since it’s not a widely used module. That means you can’t actually run scratchattach in ChatGPT. You might be able to generate code for it, though.
I was able to use it … It has a sidebar that can run code. I was surprised but idk
Chatgpt runs code to test it.
aaliyaan0110
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

scott170 wrote:

Can you add encoding and decoding built into this? It would make life so much easier.
sorry for necroposting but WHATTT
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

aaliyaan0110 wrote:

scott170 wrote:

Can you add encoding and decoding built into this? It would make life so much easier.
sorry for necroposting but WHATTT
DW you dident necropost what are you confused about?
aaliyaan0110
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

aaliyaan0110 wrote:

scott170 wrote:

Can you add encoding and decoding built into this? It would make life so much easier.
sorry for necroposting but WHATTT
DW you dident necropost what are you confused about?
“it would make life alot easier”
tagrim123
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

NFlex23 wrote:

There are a bunch of other Scratch Python libraries out there already, such as Scratchcloud and Scratchclient, so you may want to use one of those instead of creating an entirely new library. That being said, this still looks really cool and has a lot of potential.
Famous last words before this thing went famous.
TutorLurdumolochTest
Scratcher
8 posts

scratchattach - A Scratch API wrapper (Python)

Maybe this could be used this
El_snak
Scratcher
26 posts

scratchattach - A Scratch API wrapper (Python)

TheMobileGames wrote:

caftingdead261 wrote:

Don't you need to own the project to change them?
No, you can change the variables of any project as long as you aren’t banned from the Scratch API and have the Scratcher rank of course. It’s actually very very helpful to me whenever I need to change some variables on my project with an alt account instead.
Doesn’t that mean I can use it to create a program to hax cloud games? If you know how a game works and how it uses, takes, sends, and receives cloud data, couldn’t you just do something like make a malicious python program to unlock all achievements in the cloud multiplayer fun game by griffpatch? If you knew how, I mean.
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

TutorLurdumolochTest wrote:

Maybe this could be used this
is this like a github alternative?
Boss_1s
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

El_snak wrote:

TheMobileGames wrote:

caftingdead261 wrote:

Don't you need to own the project to change them?
No, you can change the variables of any project as long as you aren’t banned from the Scratch API and have the Scratcher rank of course. It’s actually very very helpful to me whenever I need to change some variables on my project with an alt account instead.
Doesn’t that mean I can use it to create a program to hax cloud games? If you know how a game works and how it uses, takes, sends, and receives cloud data, couldn’t you just do something like make a malicious python program to unlock all achievements in the cloud multiplayer fun game by griffpatch? If you knew how, I mean.
https://github.com/TimMcCool/scratchattach/issues/468
sumsarasmus
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

Did 2.0 change comment posting alot? I have a theory I want to confirm.
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

sumsarasmus wrote:

Did 2.0 change comment posting alot? I have a theory I want to confirm.
what do you mean by that? Like the way the api works was chnaged?
AlexDF16
Scratcher
31 posts

scratchattach - A Scratch API wrapper (Python)

hello again
sumsarasmus
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

sumsarasmus wrote:

Did 2.0 change comment posting alot? I have a theory I want to confirm.
what do you mean by that? Like the way the api works was chnaged?
There were a ton of spam attacks right after 2.0. I wonder if automatic comment posting was changed/added.
cone_as
Scratcher
43 posts

scratchattach - A Scratch API wrapper (Python)

Hi, I am a new user of scratchattach and I have a question about the decoding and encoding of responses. Does the sprite automaticly decode encoded responses or do I have to prompt it to. If so, what do block do I need to use to decode it?

Thanks
Boss_1s
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

cone_as wrote:

Hi, I am a new user of scratchattach and I have a question about the decoding and encoding of responses. Does the sprite automaticly decode encoded responses or do I have to prompt it to. If so, what do block do I need to use to decode it?

Thanks
If you're using the Encoding class in your backend, you'll need this sprite in your project to decode. However, without the Encoding class you don't need to prompt it to encode/decode anything.
VIGARPAST_777
Scratcher
72 posts

scratchattach - A Scratch API wrapper (Python)

I've a question

I have a project.json file, and I want to “paste” it to another Scratch project using ScratchAttach. Is this possible? If so, could someone tell me how?

Last edited by VIGARPAST_777 (Oct. 11, 2025 08:28:28)

TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

#3077
It is possible using
project.set_json(your_json)
.
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
    data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
    Requests.check_response(r)
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
    raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
    output = self.on_call(*received_request.arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
    username = str(client.get_requester()).lower()
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
    activity.load_log_data()
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
    logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
    raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error 
VIGARPAST_777
Scratcher
72 posts

scratchattach - A Scratch API wrapper (Python)

[quote=wvzack]Scrtachattach projects are currently getting these errors and im wondering if it is possible to just skip over them and keep going when they come up.

[code=powershell]Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
Requests.check_response(r)
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
output = self.on_call(*received_request.arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
username = str(client.get_requester()).lower()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
activity.load_log_data()
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error
Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
data = requests.get(f"https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}", timeout=10).json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
Requests.check_response(r)
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in __call__
output = self.on_call(*received_request.arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
username = str(client.get_requester()).lower()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
activity.load_log_data()
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error [/code][/quote]
ScratchAttach projects are currently getting these errors and I’m wondering if it is possible to just skip over them and keep going when they come up.

I’m working with **ScratchAttach** in Python to get information from Scratch projects. Sometimes the Scratch server does not respond correctly to cloud variable requests, which causes the program to stop. I want it to continue running even if these errors happen.

A simple way to handle this is using `try...except`:
[code=python]
from scratchattach.utils.exceptions import FetchError, APIError

try:
username = str(client.get_requester()).lower()
except (FetchError, APIError) as e:
print(f"Error retrieving information: {e}")
username = None
[/code]

Or a retry loop:

[code=python]
from time import sleep

for _ in range(3):
try:
username = str(client.get_requester()).lower()
break
except (FetchError, APIError):
print("Error contacting Scratch, retrying...")
sleep(2)
else:
username = None
[/code]

Full error example from ScratchAttach:

[code=powershell]Warning: Caught error in request 'get_all_info' - Full error below
Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 50, in logs
data = requests.get(f"[https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset}](https://clouddata.scratch.mit.edu/logs?projectid={self.project_id}&limit={limit}&offset={offset})", timeout=10).json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 34, in get
Requests.check_response(r)
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/utils/requests.py", line 19, in check_response
raise exceptions.APIError("Internal Scratch server error")
scratchattach.utils.exceptions.APIError: Internal Scratch server error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 33, in **call**
output = self.on_call(*received_request.arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/Python_Projects/ByteBank/cloud_requests.py", line 97, in get_all_info
username = str(client.get_requester()).lower()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/eventhandlers/cloud_requests.py", line 384, in get_requester
activity.load_log_data()
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/site/cloud_activity.py", line 75, in load_log_data
logs = self.cloud.logs(filter_by_var_named=self.var, limit=100)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/bytebank/lib/python3.11/site-packages/scratchattach/cloud/cloud.py", line 58, in logs
raise exceptions.FetchError(str(e))
scratchattach.utils.exceptions.FetchError: Internal Scratch server error[/code]

Last edited by VIGARPAST_777 (Oct. 11, 2025 16:01:35)

Powered by DjangoBB