Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- youhan_school
-
41 posts
scratchattach - A Scratch API wrapper (Python)
New in v0.5.5:ok
- Getting and following Forum Topics (new scratch3.ForumTopic class)
- Getting list of the forum topics in a category
- Getting forum topic change log
- Getting and editing Forum Posts (new scratch3.ForumPost class)
- Getting forum posts of a topic
- Searching forum posts all over Scratch
- Getting the forum posts made by a user
- Getting a post's ocular reactions
- Getting a user's ocular status
- Getting site statistics (from https://scratch.mit.edu/statistics/)
- Getting site health
To prevent spam, adding posts to topics is not a scratchattach feature and never will be.
If you find any bugs in the new features, please report them.
Main profile: https://scratch.mit.edu/users/youhan_school/
主要页面:https://scratch.mit.edu/users/youhan_school/
Profile utama: https://scratch.mit.edu/users/youhan_school/
- youhan_school
-
41 posts
scratchattach - A Scratch API wrapper (Python)
Hi! If you need help just create a post through here ya! thanks! I m new here!
Main profile: https://scratch.mit.edu/users/youhan_school/
主要页面:https://scratch.mit.edu/users/youhan_school/
Profile utama: https://scratch.mit.edu/users/youhan_school/
- Loganmcc04
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
Hey, I have been trying to return multiple values from cloud requests too but it doesn't seem to work.Can you send us your code? I don't know what to do with this error:
Edit: works now.
It looks like this.
Example:
return (argument1) - Username
return user.message_count - Message Count
return user.follower_count - Follower Count
return user.following_count - Following Count
Result:
error (could also return just (argument1) in scratch)
I also tried sending it in a big long string, but it just pasted into scratch as the actual functions names instead of what the functions contain.
Example:
name = (argument1)
message = user.message_count
follower = user.follower_count
following = user.following_count
return (argument1) + message + follower + following
Result in scratch:
(argument1) user.message_count user.follower_count user.following_count
I hope you can fix this..
![](http://cdn.scratch.mit.edu/scratchr2/static/__9209616f20ac7fc52efa806cd216a370__/djangobb_forum/img/smilies/big_smile.png)
Last edited by Loganmcc04 (June 1, 2022 09:06:42)
- infintyrussia_test
-
33 posts
scratchattach - A Scratch API wrapper (Python)
The problem was that I was setting a var to an image load and a string. If that makes sense.Can you send us your code? I don't know what to do with this error:
Edit: works now.
- xxxxxxx-70
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
hello
<<Xxxxxxx-70>>
______________________________________________________________ Oh hi there im xxxxxxx-70 an 16 year old i enjoy my life and it’s pretty chill I have accomplished many milestone and I’m happy to have them :) I also do a lot of art and very few codes if you want to support my alts check down here
Here are all my alts @Bluevubeman @nicescracher @the-guy-who-cares :D
![](https://assets.scratch.mit.edu/get_image/.%2E/c1d9da9c6c3c410284b7431f107797d3.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/3ba447259d9da8cbe2eee4c0bef976ce.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/fcc57f8a8b8e4f08166944abaa2cd765.gif)
![](https://u.cubeupload.com/FireStar2424/3ba447259d9da8cbe2ee.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/f28389728c5bcd372ac5ac56ce03be88.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/29ed3208f8d966445206011f06b4e0fb.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/5ad39905cce3086b70e9dd0ec9f229f8.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/479199624a9241e7995ecc9491282f61.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/38ee8224842c5327b02d96f58392914b.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/0174cfa8d59dd1b81b17b087a0b1f202.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/77bb9ede423e0d0c6dcc17bede479d22.png)
![](https://u.cubeupload.com/heylowArts/Screenshot2023021513.png)
- Ameise15
-
8 posts
scratchattach - A Scratch API wrapper (Python)
Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Thanks in advance! Anyways, scratchattach ist awesome! ![](//cdn.scratch.mit.edu/scratchr2/static/__82c5f70a5a73d22897d8d18de10b2aec__/djangobb_forum/img/smilies/big_smile.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__82c5f70a5a73d22897d8d18de10b2aec__/djangobb_forum/img/smilies/big_smile.png)
Last edited by Ameise15 (June 1, 2022 14:05:39)
when green flag clicked
forever
change [My followers v] by (1)
end
- TimMcCool
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
What error does it show? Thanks Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
![](http://cdn.scratch.mit.edu/scratchr2/static/__9209616f20ac7fc52efa806cd216a370__/djangobb_forum/img/smilies/smile.png)
Last edited by TimMcCool (June 1, 2022 13:51:21)
Developer of scratchattach, the most popular Python Scratch API wrapper
- TimMcCool
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
Hey, I have been trying to return multiple values from cloud requests too but it doesn't seem to work.Can you send us your code? I don't know what to do with this error:
Edit: works now.
It looks like this.
Example:
return (argument1) - Username
return user.message_count - Message Count
return user.follower_count - Follower Count
return user.following_count - Following Count
Result:
error (could also return just (argument1) in scratch)
I also tried sending it in a big long string, but it just pasted into scratch as the actual functions names instead of what the functions contain.
Example:
name = (argument1)
message = user.message_count
follower = user.follower_count
following = user.following_count
return (argument1) + message + follower + following
Result in scratch:
(argument1) user.message_count user.follower_count user.following_count
I hope you can fix this..
That's not a bug. “message_count()”, “follower_count()” and “following_count()” are functions, not attributes.
“user.message_count” will only reference the function. To get the user's message count, use "message = user.message_count()“.
”user.message_count()“ will return an integer while argument1 is a string. You can't add integers to string. Therefore ”return (argument1) + message + follower + following" won't work either. You could use an f-string to join the numbers and letters.
I fixed your code:
name = argument1 user = scratch3.get_user(name) message = user.message_count() follower = user.follower_count() following = user.following_count() return f"{argument1} {message} {follower} {following}"
Last edited by TimMcCool (June 1, 2022 14:04:23)
Developer of scratchattach, the most popular Python Scratch API wrapper
- Ameise15
-
8 posts
scratchattach - A Scratch API wrapper (Python)
What error does it show? Thanks Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
It's showing:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 40, in _connect
self.websocket.connect(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_core.py”, line 244, in connect
self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_http.py”, line 136, in connect
sock = _ssl_socket(sock, options.sslopt, hostname)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_http.py”, line 272, in _ssl_socket
sock = _wrap_sni_socket(sock, sslopt, hostname, check_hostname)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/websocket/_http.py”, line 248, in _wrap_sni_socket
return context.wrap_socket(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py”, line 512, in wrap_socket
return self.sslsocket_class._create(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py”, line 1070, in _create
self.do_handshake()
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py”, line 1341, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “cloud2.py”, line 4, in <module>
conn = session.connect_cloud(project_id=“698201759”)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_session.py”, line 238, in connect_cloud
return _cloud.CloudConnection(username = self._username, session_id = self.session_id, project_id = int(project_id))
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 17, in __init__
self._connect(cloud_host=cloud_host)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scratchattach/_cloud.py”, line 47, in _connect
raise(_exceptions.ConnectionError)
scratchattach._exceptions.ConnectionError
Last edited by Ameise15 (June 1, 2022 15:19:54)
when green flag clicked
forever
change [My followers v] by (1)
end
- SansStudios
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
What error does it show? Thanks Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)
scratchattach._exceptions.ConnectionError
To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.
Also, your computer's name is included in the traceback—you might want to remove that.
☁️ scratchcloud ☁️
Click above to check it out! I've worked on it for over a year!
Just like sudden sadness comes hangin' on the breeze
- xxxxxxx-70
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
![](http://cdn.scratch.mit.edu/scratchr2/static/__9209616f20ac7fc52efa806cd216a370__/djangobb_forum/img/smilies/big_smile.png)
when green flag clicked
change [ ] by (10000000000000000000000000000)
<<Xxxxxxx-70>>
______________________________________________________________ Oh hi there im xxxxxxx-70 an 16 year old i enjoy my life and it’s pretty chill I have accomplished many milestone and I’m happy to have them :) I also do a lot of art and very few codes if you want to support my alts check down here
Here are all my alts @Bluevubeman @nicescracher @the-guy-who-cares :D
![](https://assets.scratch.mit.edu/get_image/.%2E/c1d9da9c6c3c410284b7431f107797d3.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/3ba447259d9da8cbe2eee4c0bef976ce.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/fcc57f8a8b8e4f08166944abaa2cd765.gif)
![](https://u.cubeupload.com/FireStar2424/3ba447259d9da8cbe2ee.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/f28389728c5bcd372ac5ac56ce03be88.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/29ed3208f8d966445206011f06b4e0fb.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/5ad39905cce3086b70e9dd0ec9f229f8.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/479199624a9241e7995ecc9491282f61.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/38ee8224842c5327b02d96f58392914b.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/0174cfa8d59dd1b81b17b087a0b1f202.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/77bb9ede423e0d0c6dcc17bede479d22.png)
![](https://u.cubeupload.com/heylowArts/Screenshot2023021513.png)
- xxxxxxx-70
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
join me here follow me please…
<<Xxxxxxx-70>>
______________________________________________________________ Oh hi there im xxxxxxx-70 an 16 year old i enjoy my life and it’s pretty chill I have accomplished many milestone and I’m happy to have them :) I also do a lot of art and very few codes if you want to support my alts check down here
Here are all my alts @Bluevubeman @nicescracher @the-guy-who-cares :D
![](https://assets.scratch.mit.edu/get_image/.%2E/c1d9da9c6c3c410284b7431f107797d3.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/3ba447259d9da8cbe2eee4c0bef976ce.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/fcc57f8a8b8e4f08166944abaa2cd765.gif)
![](https://u.cubeupload.com/FireStar2424/3ba447259d9da8cbe2ee.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/f28389728c5bcd372ac5ac56ce03be88.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/29ed3208f8d966445206011f06b4e0fb.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/5ad39905cce3086b70e9dd0ec9f229f8.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/479199624a9241e7995ecc9491282f61.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/38ee8224842c5327b02d96f58392914b.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/0174cfa8d59dd1b81b17b087a0b1f202.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/77bb9ede423e0d0c6dcc17bede479d22.png)
![](https://u.cubeupload.com/heylowArts/Screenshot2023021513.png)
- Ameise15
-
8 posts
scratchattach - A Scratch API wrapper (Python)
Thanks alot. I just realized it's working perfectly when I do it on replit instead vs code (That was the only python editor I had)What error does it show? Thanks Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)
scratchattach._exceptions.ConnectionError
To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.
Also, your computer's name is included in the traceback—you might want to remove that.
when green flag clicked
forever
change [My followers v] by (1)
end
- -FreeEngines-
-
100+ posts
scratchattach - A Scratch API wrapper (Python)
please differentiate. replit isnt an editor but an coding platform on its own with an own vm. i have absolutely no clue why youre certificate seems to be wrong, but thats not because of vscodeThanks alot. I just realized it's working perfectly when I do it on replit instead vs code (That was the only python editor I had)What error does it show? Thanks Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)
scratchattach._exceptions.ConnectionError
To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.
Also, your computer's name is included in the traceback—you might want to remove that.
- Ameise15
-
8 posts
scratchattach - A Scratch API wrapper (Python)
OK but it's not bad because it's working nowplease differentiate. replit isnt an editor but an coding platform on its own with an own vm. i have absolutely no clue why youre certificate seems to be wrong, but thats not because of vscodeThanks alot. I just realized it's working perfectly when I do it on replit instead vs code (That was the only python editor I had)What error does it show? Thanks Always when I try to connect to the cloud of a project it shows an error. Can anyone help me? Anyways, scratchattach ist awesome!
It's showing:
ssl.SSLCertVerificationError: certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)
scratchattach._exceptions.ConnectionError
To get certificates, you need to go to `/Applications/Python 3.x/` and open the `Install Certificates.command` file.
Also, your computer's name is included in the traceback—you might want to remove that.
![](http://cdn.scratch.mit.edu/scratchr2/static/__9209616f20ac7fc52efa806cd216a370__/djangobb_forum/img/smilies/smile.png)
when green flag clicked
forever
change [My followers v] by (1)
end
- MooMoo5678star
-
39 posts
scratchattach - A Scratch API wrapper (Python)
hi
when green flag clicked
forever
say [hi]
end
my main profile:@MooMoo5678star
![](http://cdn.scratch.mit.edu/scratchr2/static/__82c5f70a5a73d22897d8d18de10b2aec__/djangobb_forum/img/smilies/smile.png)
when green flag clicked
say (cool)
- xxxxxxx-70
-
1000+ posts
scratchattach - A Scratch API wrapper (Python)
![](http://cdn.scratch.mit.edu/scratchr2/static/__9209616f20ac7fc52efa806cd216a370__/djangobb_forum/img/smilies/big_smile.png)
<<Xxxxxxx-70>>
______________________________________________________________ Oh hi there im xxxxxxx-70 an 16 year old i enjoy my life and it’s pretty chill I have accomplished many milestone and I’m happy to have them :) I also do a lot of art and very few codes if you want to support my alts check down here
Here are all my alts @Bluevubeman @nicescracher @the-guy-who-cares :D
![](https://assets.scratch.mit.edu/get_image/.%2E/c1d9da9c6c3c410284b7431f107797d3.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/3ba447259d9da8cbe2eee4c0bef976ce.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/fcc57f8a8b8e4f08166944abaa2cd765.gif)
![](https://u.cubeupload.com/FireStar2424/3ba447259d9da8cbe2ee.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/f28389728c5bcd372ac5ac56ce03be88.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/29ed3208f8d966445206011f06b4e0fb.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/5ad39905cce3086b70e9dd0ec9f229f8.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/479199624a9241e7995ecc9491282f61.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/38ee8224842c5327b02d96f58392914b.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/0174cfa8d59dd1b81b17b087a0b1f202.gif)
![](https://assets.scratch.mit.edu/get_image/.%2E/77bb9ede423e0d0c6dcc17bede479d22.png)
![](https://u.cubeupload.com/heylowArts/Screenshot2023021513.png)
- hubblefam
-
45 posts
scratchattach - A Scratch API wrapper (Python)
for some reason user.reply_comment() is broken i think.
code:
when i run it, it does not have any errors it just doesn't reply to the comment
code:
print('importing')
import scratchattach as scratch3
from keep_alive import keep_alive
import os
print('logging in')
session = scratch3.login("hubblescript", os.environ['password'])
print('complete.\n')
user = scratch3.get_user("hubblefam")
while True:
usercomments = user.comments(limit=20, page=1)
for comment in usercomments:
if comment['Content'][0] == '!':
command = comment['Content'][1:]
if not comment['hasReplies?']:
print(command)
user.reply_comment(command, parent_id=comment['CommentID'])
when i run it, it does not have any errors it just doesn't reply to the comment
Last edited by hubblefam (June 1, 2022 19:54:18)