Discuss Scratch

50_scratch_tabs
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

King of the page no edit

kRxZy_kRxZy wrote:

(#2860)
How to decode scratchattach activity?
Wdym? Cloud activity?
Sasha--seals
Scratcher
31 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

Last edited by Sasha--seals (Jan. 8, 2025 22:15:55)

kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

50_scratch_tabs wrote:

King of the page no edit

kRxZy_kRxZy wrote:

(#2860)
How to decode scratchattach activity?
Wdym? Cloud activity?
I meant like sa objects
uukelele
Scratcher
12 posts

scratchattach - A Scratch API wrapper (Python)

Sasha--seals wrote:

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
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

uukelele wrote:

Sasha--seals wrote:

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
yeah so, no you can't connect and set cloud vars
Voxalice
Scratcher
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.
50_scratch_tabs
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

kRxZy_kRxZy wrote:

(#2863)

50_scratch_tabs wrote:

King of the page no edit

kRxZy_kRxZy wrote:

(#2860)
How to decode scratchattach activity?
Wdym? Cloud activity?
I meant like sa objects
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.
SharpSwing
Scratcher
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
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

SharpSwing wrote:

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.
This happened to me so I done this, go to command prompt or shell then typed pip install flask the ran the code below
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
Scratcher
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
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
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

AlexDF16 wrote:

Just showing you my scratch project; I just get messages with this.
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1040501091
when green flag clicked
forever
say [I am going to die] for (1000000) secs
end
Please do not advertise here

close your tags

Last edited by kRxZy_kRxZy (Jan. 14, 2025 17:46:45)

AlexDF16
Scratcher
26 posts

scratchattach - A Scratch API wrapper (Python)

Wait, how do you do that infinite thing?
AlexDF16
Scratcher
26 posts

scratchattach - A Scratch API wrapper (Python)

AlexDF16 wrote:

Wait, how do you do that infinite thing?

This?
SharpSwing
Scratcher
8 posts

scratchattach - A Scratch API wrapper (Python)

kRxZy_kRxZy wrote:

SharpSwing wrote:

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.
This happened to me so I done this, go to command prompt or shell then typed pip install flask the ran the code below
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)
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?
kRxZy_kRxZy
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

SharpSwing wrote:

kRxZy_kRxZy wrote:

SharpSwing wrote:

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.
This happened to me so I done this, go to command prompt or shell then typed pip install flask the ran the code below
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)
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 is if you want to host the code on a hosting website like back4app or glitch, I didn't know you were hosting locally
uukelele
Scratcher
12 posts

scratchattach - A Scratch API wrapper (Python)

SharpSwing wrote:

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)

50_scratch_tabs wrote:


⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.

b) two posts above yours

Voxalice wrote:

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

kRxZy_kRxZy wrote:


yeah so, no you can't connect and set cloud vars

d) four posts above yours

uukelele wrote:


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
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

kRxZy_kRxZy wrote:

How to decode scratchattach activity?
What do you mean by decode?
AlexDF16
Scratcher
26 posts

scratchattach - A Scratch API wrapper (Python)

uukelele wrote:

SharpSwing wrote:

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)

50_scratch_tabs wrote:


⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.

b) two posts above yours

Voxalice wrote:

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

kRxZy_kRxZy wrote:


yeah so, no you can't connect and set cloud vars

d) four posts above yours

uukelele wrote:


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.
I think it is working again!
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

AlexDF16 wrote:

uukelele wrote:

SharpSwing wrote:

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)

50_scratch_tabs wrote:


⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.

b) two posts above yours

Voxalice wrote:

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

kRxZy_kRxZy wrote:


yeah so, no you can't connect and set cloud vars

d) four posts above yours

uukelele wrote:


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.
I think it is working again!
Do you have a example of this because the logs don't seem to be working.
AlexDF16
Scratcher
26 posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

AlexDF16 wrote:

uukelele wrote:

SharpSwing wrote:

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)

50_scratch_tabs wrote:


⚠ DO NOT POST ABOUT SEARCH OR CLOUD VARIABLES NOT WORKING, THE SCRATCH TEAM IS AWARE OF IT.

b) two posts above yours

Voxalice wrote:

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

kRxZy_kRxZy wrote:


yeah so, no you can't connect and set cloud vars

d) four posts above yours

uukelele wrote:


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.
I think it is working again!
Do you have a example of this because the logs don't seem to be working.
Not working, it just said that it couldn't load cloud data
(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA)

Powered by DjangoBB