MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / unlove

Method unlove

scratchattach/site/project.py:511–525  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

jsonMethod · 0.80
_assert_authMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected