Downloads the project json and returns it as a string
(self)
| 303 | |
| 304 | @deprecated("Use raw_json instead") |
| 305 | def get_json(self) -> str: |
| 306 | """ |
| 307 | Downloads the project json and returns it as a string |
| 308 | """ |
| 309 | try: |
| 310 | self.update() |
| 311 | response = requests.get( |
| 312 | f"https://projects.scratch.mit.edu/{self.id}?token={self.project_token}", |
| 313 | timeout=10, |
| 314 | ) |
| 315 | return response.text |
| 316 | |
| 317 | except Exception as exc: |
| 318 | raise (exceptions.FetchError("Method only works for projects created with Scratch 3")) from exc |
| 319 | |
| 320 | def body(self) -> editor.Project: |
| 321 | """ |