Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- 50_scratch_tabs
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
King of the page no edit
(#2860)Wdym? Cloud activity?
How to decode scratchattach activity?
- Sasha--seals
-
31 posts
scratchattach - A Scratch API wrapper (Python)
So I am trying to run this code:
But I am getting this error:
My browser / operating system: Windows NT 10.0, Chrome 131.0.0.0, No Flash versions detected
import scratchattach as sa session = sa.login("Sasha--seals","################################################################################################") cloud = session.connect_scratch_cloud("1115594690") client = cloud.requests() @client.request def get_user(): #There will be stuff here that gets the info about the user return "pong" @client.event def on_ready(): print("Request handler is running") client.start(thread=True)
But I am getting this error:
Exception in thread Thread-3 (_updater):
Traceback (most recent call last):
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 176, in _get_addrinfo_list
addrinfo_list = socket.getaddrinfo(
hostname, port, 0, socket.SOCK_STREAM, socket.SOL_TCP
)
File "C:\Python\Exec\Lib\socket.py", line 975, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Exec\Lib\threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "C:\Python\Exec\Lib\threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\eventhandlers\cloud_events.py", line 31, in _updater
self.source_cloud.connect()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\cloud\cloud.py", line 27, in connect
super().connect()
~~~~~~~~~~~~~~~^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\cloud\_base.py", line 137, in connect
self.websocket.connect(
~~~~~~~~~~~~~~~~~~~~~~^
self.cloud_host,
^^^^^^^^^^^^^^^^
...<4 lines>...
header = self.header
^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_core.py", line 256, in connect
self.sock, addrs = connect(
~~~~~~~^
url, self.sock_opt, proxy_info(**options), options.pop("socket", None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 137, in connect
addrinfo_list, need_tunnel, auth = _get_addrinfo_list(
~~~~~~~~~~~~~~~~~~^
hostname, port_from_url, is_secure, proxy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 191, in _get_addrinfo_list
raise WebSocketAddressException(e)
websocket._exceptions.WebSocketAddressException: [Errno 11001] getaddrinfo failed
My browser / operating system: Windows NT 10.0, Chrome 131.0.0.0, No Flash versions detected
Last edited by Sasha--seals (Jan. 8, 2025 22:15:55)
- kRxZy_kRxZy
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I meant like sa objects King of the page no edit(#2860)Wdym? Cloud activity?
How to decode scratchattach activity?
- uukelele
-
12 posts
scratchattach - A Scratch API wrapper (Python)
So I am trying to run this code:import scratchattach as sa session = sa.login("Sasha--seals","################################################################################################") cloud = session.connect_scratch_cloud("1115594690") client = cloud.requests() @client.request def get_user(): #There will be stuff here that gets the info about the user return "pong" @client.event def on_ready(): print("Request handler is running") client.start(thread=True)
But I am getting this error:Exception in thread Thread-3 (_updater):
Traceback (most recent call last):
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 176, in _get_addrinfo_list
addrinfo_list = socket.getaddrinfo(
hostname, port, 0, socket.SOCK_STREAM, socket.SOL_TCP
)
File "C:\Python\Exec\Lib\socket.py", line 975, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Exec\Lib\threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "C:\Python\Exec\Lib\threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\eventhandlers\cloud_events.py", line 31, in _updater
self.source_cloud.connect()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\cloud\cloud.py", line 27, in connect
super().connect()
~~~~~~~~~~~~~~~^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\cloud\_base.py", line 137, in connect
self.websocket.connect(
~~~~~~~~~~~~~~~~~~~~~~^
self.cloud_host,
^^^^^^^^^^^^^^^^
...<4 lines>...
header = self.header
^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_core.py", line 256, in connect
self.sock, addrs = connect(
~~~~~~~^
url, self.sock_opt, proxy_info(**options), options.pop("socket", None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 137, in connect
addrinfo_list, need_tunnel, auth = _get_addrinfo_list(
~~~~~~~~~~~~~~~~~~^
hostname, port_from_url, is_secure, proxy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 191, in _get_addrinfo_list
raise WebSocketAddressException(e)
websocket._exceptions.WebSocketAddressException: [Errno 11001] getaddrinfo failed
My browser / operating system: Windows NT 10.0, Chrome 131.0.0.0, No Flash versions detected
scratch cloud broke
- kRxZy_kRxZy
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
yeah so, no you can't connect and set cloud varsSo I am trying to run this code:import scratchattach as sa session = sa.login("Sasha--seals","################################################################################################") cloud = session.connect_scratch_cloud("1115594690") client = cloud.requests() @client.request def get_user(): #There will be stuff here that gets the info about the user return "pong" @client.event def on_ready(): print("Request handler is running") client.start(thread=True)
But I am getting this error:Exception in thread Thread-3 (_updater):
Traceback (most recent call last):
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 176, in _get_addrinfo_list
addrinfo_list = socket.getaddrinfo(
hostname, port, 0, socket.SOCK_STREAM, socket.SOL_TCP
)
File "C:\Python\Exec\Lib\socket.py", line 975, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Exec\Lib\threading.py", line 1041, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "C:\Python\Exec\Lib\threading.py", line 992, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\eventhandlers\cloud_events.py", line 31, in _updater
self.source_cloud.connect()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\cloud\cloud.py", line 27, in connect
super().connect()
~~~~~~~~~~~~~~~^^
File "C:\Python\Exec\Lib\site-packages\scratchattach\cloud\_base.py", line 137, in connect
self.websocket.connect(
~~~~~~~~~~~~~~~~~~~~~~^
self.cloud_host,
^^^^^^^^^^^^^^^^
...<4 lines>...
header = self.header
^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_core.py", line 256, in connect
self.sock, addrs = connect(
~~~~~~~^
url, self.sock_opt, proxy_info(**options), options.pop("socket", None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 137, in connect
addrinfo_list, need_tunnel, auth = _get_addrinfo_list(
~~~~~~~~~~~~~~~~~~^
hostname, port_from_url, is_secure, proxy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Python\Exec\Lib\site-packages\websocket\_http.py", line 191, in _get_addrinfo_list
raise WebSocketAddressException(e)
websocket._exceptions.WebSocketAddressException: [Errno 11001] getaddrinfo failed
My browser / operating system: Windows NT 10.0, Chrome 131.0.0.0, No Flash versions detected
scratch cloud broke
- Voxalice
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
For anyone trying to use scratchattach's cloud features, keep in mind that cloud variables are currently broken, and all we can do is wait for them to be fixed.
Unfortunately, no one seems to know what's causing issues or when they will be fixed.
This affects everyone on Scratch, so the Scratch Team is aware of the situation.
Unfortunately, no one seems to know what's causing issues or when they will be fixed.
This affects everyone on Scratch, so the Scratch Team is aware of the situation.
- 50_scratch_tabs
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
(#2863)You could look at scratchattach's source code. I think the only useful place is in /scratchattach/site/*.py. I find the source code much better than the documentation on that.I meant like sa objects King of the page no edit(#2860)Wdym? Cloud activity?
How to decode scratchattach activity?
- SharpSwing
-
8 posts
scratchattach - A Scratch API wrapper (Python)
Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.
Last edited by SharpSwing (Jan. 14, 2025 17:32:29)
- kRxZy_kRxZy
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
This happened to me so I done this, go to command prompt or shell then typed pip install flask the ran the code below Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.
import flask from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return "server started" if __name__ == '__main__': app.run(host='0.0.0.0', port=8080)
- AlexDF16
-
26 posts
scratchattach - A Scratch API wrapper (Python)
Just showing you my scratch project; I just get messages with this.
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1040501091
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1040501091
when green flag clicked
forever
say [I am going to die] for (1000000) secs
end
Last edited by AlexDF16 (Jan. 14, 2025 17:46:22)
- kRxZy_kRxZy
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
Please do not advertise here Just showing you my scratch project; I just get messages with this.
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1040501091when green flag clicked
forever
say [I am going to die] for (1000000) secs
end
close your tags
Last edited by kRxZy_kRxZy (Jan. 14, 2025 17:46:45)
- AlexDF16
-
26 posts
scratchattach - A Scratch API wrapper (Python)
Wait, how do you do that infinite thing?
- AlexDF16
-
26 posts
scratchattach - A Scratch API wrapper (Python)
Wait, how do you do that infinite thing?
This?
- SharpSwing
-
8 posts
scratchattach - A Scratch API wrapper (Python)
Are you saying I should run that code, and then try setting the cloud variable? It tried that, and it didn't work. Should the flask server be open while I try to set the cloud var?This happened to me so I done this, go to command prompt or shell then typed pip install flask the ran the code below Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.import flask from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return "server started" if __name__ == '__main__': app.run(host='0.0.0.0', port=8080)
- kRxZy_kRxZy
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
This is if you want to host the code on a hosting website like back4app or glitch, I didn't know you were hosting locallyAre you saying I should run that code, and then try setting the cloud variable? It tried that, and it didn't work. Should the flask server be open while I try to set the cloud var?This happened to me so I done this, go to command prompt or shell then typed pip install flask the ran the code below Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.import flask from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return "server started" if __name__ == '__main__': app.run(host='0.0.0.0', port=8080)
- uukelele
-
12 posts
scratchattach - A Scratch API wrapper (Python)
Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.
Can you not read the posts:
a) one post above yours (signature)
…
⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.
…
b) two posts above yours
For anyone trying to use scratchattach's cloud features, keep in mind that cloud variables are currently broken, and all we can do is wait for them to be fixed.
Unfortunately, no one seems to know what's causing issues or when they will be fixed.
This affects everyone on Scratch, so the Scratch Team is aware of the situation.
c) three posts above yours
…
yeah so, no you can't connect and set cloud vars
d) four posts above yours
…
scratch cloud broke
Seriously, if you can see many other people that have had this error, please try reading the responses to their questions instead of making another post on the same topic that is literally everywhere here.
- wvzack
-
500+ posts
scratchattach - A Scratch API wrapper (Python)
What do you mean by decode? How to decode scratchattach activity?
- AlexDF16
-
26 posts
scratchattach - A Scratch API wrapper (Python)
I think it is working again!Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.
Can you not read the posts:
a) one post above yours (signature)…
⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.
…
b) two posts above yoursFor anyone trying to use scratchattach's cloud features, keep in mind that cloud variables are currently broken, and all we can do is wait for them to be fixed.
Unfortunately, no one seems to know what's causing issues or when they will be fixed.
This affects everyone on Scratch, so the Scratch Team is aware of the situation.
c) three posts above yours…
yeah so, no you can't connect and set cloud vars
d) four posts above yours…
scratch cloud broke
Seriously, if you can see many other people that have had this error, please try reading the responses to their questions instead of making another post on the same topic that is literally everywhere here.

- wvzack
-
500+ posts
scratchattach - A Scratch API wrapper (Python)
Do you have a example of this because the logs don't seem to be working.I think it is working again!Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.
Can you not read the posts:
a) one post above yours (signature)…
⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.
…
b) two posts above yoursFor anyone trying to use scratchattach's cloud features, keep in mind that cloud variables are currently broken, and all we can do is wait for them to be fixed.
Unfortunately, no one seems to know what's causing issues or when they will be fixed.
This affects everyone on Scratch, so the Scratch Team is aware of the situation.
c) three posts above yours…
yeah so, no you can't connect and set cloud vars
d) four posts above yours…
scratch cloud broke
Seriously, if you can see many other people that have had this error, please try reading the responses to their questions instead of making another post on the same topic that is literally everywhere here.
- AlexDF16
-
26 posts
scratchattach - A Scratch API wrapper (Python)
Not working, it just said that it couldn't load cloud dataDo you have a example of this because the logs don't seem to be working.I think it is working again!Hmm, when I try to use scratchattach to set a cloud var, I get "websocket._exceptions.WebSocketAddressException: getaddrinfo failed". I'm connected to the Internet, so I'm not quite sure why this is happening. I see many other people have had this error.
Can you not read the posts:
a) one post above yours (signature)…
⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.
…
b) two posts above yoursFor anyone trying to use scratchattach's cloud features, keep in mind that cloud variables are currently broken, and all we can do is wait for them to be fixed.
Unfortunately, no one seems to know what's causing issues or when they will be fixed.
This affects everyone on Scratch, so the Scratch Team is aware of the situation.
c) three posts above yours…
yeah so, no you can't connect and set cloud vars
d) four posts above yours…
scratch cloud broke
Seriously, if you can see many other people that have had this error, please try reading the responses to their questions instead of making another post on the same topic that is literally everywhere here.
(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)