rebane2001 / scratch-dl

scratch.mit.edu downloader/archiver
The Unlicense
20 stars 1 forks source link

Script does not work without project_token in the metadata #3

Open trueauracoral opened 1 year ago

trueauracoral commented 1 year ago

I looked in network developer tools and found the request for projects.scratch.mit.edu now needs token specifically the one from the metadata. With some very simple code this issue can be fixed:

    with open(f"{project_id}.json") as f:
        json_stuff = json.loads(f.read())
    print(f"Downloading project {project_id}")
    r = requests.get(f"https://projects.scratch.mit.edu/{project_id}?token={json_stuff['project_token']}", headers=headers)
rebane2001 commented 1 year ago

Huh, what a weird change

trueauracoral commented 1 year ago

https://projects.scratch.mit.edu/318927435 - 403 missing

https://projects.scratch.mit.edu/318927435?token=1679458394_a78ea6b56f94cefb5711f0f9f82ff8269239e8e0d9364cda0f55230bd7167cffc8d0b46d0ebbb454bc26f16f095fb4e0a544c33ca07f2810941ebe81278ee481 - works