-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I upload projects using Scratchattach? #152
Comments
You can use project = session.connect_project("PROJECTID")
project.set_json(json_data) to change the project JSON of a project. |
That worked for an already existing project, but how do I create a new project? |
You can't create new projects with scratchattach |
OK |
Also, is it possible to fetch all projects of an user at once? |
|
That only returns the first 20 projects |
you can use: webbrowser.open_new_tab(https://scratch.mit.edu/projects/editor/) #this will make the ID and generate a new project |
will this ever happen? |
Maybe |
you can send a request to https://scratch.mit.edu/projects/editor/ . I'm not sure how to get its id tho. You'll have to a list of your project from an API and check the id of the latest one. |
you could get the id using bs4 in "https://scratch.mit.edu/mystuff/" with all your cookies i believe, the link to it is in the a tag of the top most project. you could parse the id out of it. |
You need to do a post request to https://projects.scratch.mit.edu/ and get "content-name" from the response. Example(not guarranteed to work): import requests
session = ... # Create your session here
response = requests.post("https://projects.scratch.mit.edu/", headers=session._headers, cookies=session._cookies)
project_id = int(response.json()["content-name"]) |
Look and discuss api here towerofnix/scratch-api-unofficial-docs#37 Also, I am currently making a giant fork (for now private) that is a rework of scratchattach. Eventually, i will merge it (prob split). I can implement that easily. |
This is implemented in scratchattach 2.0 (will be released next week). |
can you give me some help?
The text was updated successfully, but these errors were encountered: