Removes the love from this project. You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_project`
(self)
| 509 | raise exceptions.APIError(str(r)) |
| 510 | |
| 511 | def unlove(self): |
| 512 | """ |
| 513 | Removes the love from this project. You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_project` |
| 514 | """ |
| 515 | session = self._assert_auth() |
| 516 | r = requests.delete( |
| 517 | f"https://api.scratch.mit.edu/proxy/projects/{self.id}/loves/user/{session.username}", |
| 518 | headers=self._headers, |
| 519 | cookies=self._cookies, |
| 520 | ).json() |
| 521 | if "userLove" in r: |
| 522 | if r["userLove"] is True: |
| 523 | self.unlove() |
| 524 | else: |
| 525 | raise exceptions.APIError(str(r)) |
| 526 | |
| 527 | def favorite(self): |
| 528 | """ |
nothing calls this directly
no test coverage detected