Discuss Scratch

youhan_school
Scratcher
41 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

Joshisaurio wrote:

youhan_school wrote:

Joshisaurio wrote:

-FreeEngines- wrote:

Joshisaurio wrote:

Joshisaurio wrote:

How do you even get your session ID?
Why doesn't anyone answer?
sorry answering late, idk if this got answered aready.
when making an post request to https://scratch.mit.edu/login with {username, password} in the request body, the response the server returns contains the session id in the cookie at
caseless.dict // this returns the cookie header which you then have to extract the value from
Thx but how do you get it in Python? I mean I don't get it I only know how to code in Python
See the ref document
Link pls?
Here you go!
The package is available on PyPi (Link: https://pypi.org/project/scratchattach/ ) and on GitHub (Link: https://github.com/TimMcCool/scratchattach ).

MarioBrosU22
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

Imma ask again but why does the stats() function only return followers and following stats for some users?
Test my username on it

Hi its me
ghazihikaru
Scratcher
3 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

using System. Collections;
using
Scratch_hong
Scratcher
16 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

This Is Cool
if <This It Cool> then

move <key [a] pressed?> stepsend
move (100000000000000) steps

Last edited by Scratch_hong (May 29, 2022 09:45:50)


i know ascii to!!!… Scratch_hongScratch_hongLOVE Lot of alt and helper
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

Sid72020123 wrote:

TimMcCool wrote:

(test post so I can implement posts in scratchattach)
Using this feature can be used to spam the forums by other users…
Yes, I decided not to add the feature to scratchattach.

MarioBrosU22 wrote:

Imma ask again but why does the stats() function only return followers and following stats for some users?
Test my username on it
That's because ScratchDB only collected this data for these users

Last edited by TimMcCool (May 29, 2022 10:18:27)


My profile / Mein Profil: @TimMcCool
IMAGOD7
Scratcher
2 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

scratchgodo wrote:

god286 wrote:

TimMcCool wrote:

(test post so I can implement posts in scratchattach)
Automated posts are not allowed?
Probably there not allowed because of spam

say [how]
scratchgodo
Scratcher
500+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

IMAGOD7 wrote:

scratchgodo wrote:

god286 wrote:

TimMcCool wrote:

(test post so I can implement posts in scratchattach)
Automated posts are not allowed?
Probably there not allowed because of spam
Snip
Read the links and it will say how.

It is now raining cat blocks, it is Caturday, I love cat blocks, please play with one their so cute and fun here is some:

TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

To use “session.connect_studio(”id“)”, update scratchattach using “pip install scratchattach –upgrade”

Last edited by TimMcCool (May 29, 2022 15:42:45)


My profile / Mein Profil: @TimMcCool
vg_coder
Scratcher
2 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

I have a question. Do you have to have the thing running it on all the time for it to update?
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

New in v0.5.5:


- 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.

Last edited by TimMcCool (May 29, 2022 15:52:25)


My profile / Mein Profil: @TimMcCool
milla_carrera
Scratcher
15 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

when green flag clicked
move (10) steps
next costume
next costume
forever
turn cw (15) degrees
end
KROKOBIL
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

I can't post comments on studios or projects, only on profil pages… Toggle commenting or love/fave doesn't work on projects too. But following a studio or adding/removing projects works fine.
Can you help me?

Traceback (most recent call last):
File "/My_File.py“, line 31, in <module>
project.favorite()
File ”/scratchattach/scratch3/_project.py“, line 225, in favorite
cookies = self._cookies,
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py“, line 910, in json
return complexjson.loads(self.text, **kwargs)
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py“, line 348, in loads
return _default_decoder.decode(s)
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py“, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py“, line 355, in raw_decode
raise JSONDecodeError(”Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

KROKOBIL wrote:

I can't post comments on studios or projects, only on profil pages… Toggle commenting or love/fave doesn't work on projects too. But following a studio or adding/removing projects works fine.
Can you help me?

Traceback (most recent call last):
File "/My_File.py“, line 31, in <module>
project.favorite()
File ”/scratchattach/scratch3/_project.py“, line 225, in favorite
cookies = self._cookies,
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py“, line 910, in json
return complexjson.loads(self.text, **kwargs)
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py“, line 348, in loads
return _default_decoder.decode(s)
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py“, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File ”/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py“, line 355, in raw_decode
raise JSONDecodeError(”Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
That looks like a scratchattach bug. Weird, it was working before. I'll look into it

Last edited by TimMcCool (May 29, 2022 18:28:50)


My profile / Mein Profil: @TimMcCool
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

KROKOBIL wrote:

I can't post comments on studios or projects, only on profil pages… Toggle commenting or love/fave doesn't work on projects too. But following a studio or adding/removing projects works fine.
Can you help me?


Thanks for reporting the problem. It looks like there were some bug with loving / faving projects and posting comments. These bugs are fixed now. Use
pip install scratchattach --upgrade
to update scratchattach to v0.5.9

My profile / Mein Profil: @TimMcCool
hmbadger
Scratcher
27 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

Sick!
This Can Help Me With Projects!

Heya! Hamish Here!
400+ Followers/10/Animator/Cool
dyllyu
Scratcher
2 posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

i dont have pip, so how am i supposed to dowload this? thanks
KROKOBIL
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

dyllyu wrote:

i dont have pip, so how am i supposed to dowload this? thanks
Go to github an click Code 》Download ZIP. Open the ZIP file in the folder with your python code. Then you can import it with “import scratchattach as scratch3”.

@TimMcCool: Please add this to your installation instruction.
minniesworld
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

I found that pip install scratchattach doesn't work for me, so if you have that problem then try py -m pip install scratchattach.
yippymishy
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

minniesworld wrote:

I found that pip install scratchattach doesn't work for me, so if you have that problem then try py -m pip install scratchattach.
Thanks, I was about to ask about that.


KROKOBIL
Scratcher
100+ posts

scratchattach - A Scratch API wrapper for cloud interactions and more! (Python)

BUG:

In every comment function you use:
if len(response) != 40:
    break
It should be:
if len(r) == 0:
    break
(or something like this - response is not defined)

Please change this!

Last edited by KROKOBIL (May 30, 2022 16:33:18)

Powered by DjangoBB

Standard | Mobile