Skip to content

Commit

Permalink
fix: API_video
Browse files Browse the repository at this point in the history
  • Loading branch information
z0z0r4 committed Jul 25, 2023
1 parent 59a515d commit 3421689
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bilibili_api/cheese.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ async def has_liked(self):
"""
self.credential.raise_for_no_sessdata()

api =get_api("video")["info"]["has_liked"]
api =API_video["info"]["has_liked"]
params = {"aid": self.get_aid()}
return await Api(**api, credential=self.credential).update_params(**params).result == 1

Expand All @@ -650,7 +650,7 @@ async def get_pay_coins(self):
"""
self.credential.raise_for_no_sessdata()

api =get_api("video")["info"]["get_pay_coins"]
api =API_video["info"]["get_pay_coins"]
params = {"aid": self.get_aid()}
return (await Api(**api, credential=self.credential).update_params(**params).result)[
"multiply"
Expand All @@ -665,7 +665,7 @@ async def has_favoured(self):
"""
self.credential.raise_for_no_sessdata()

api =get_api("video")["info"]["has_favoured"]
api =API_video["info"]["has_favoured"]
params = {"aid": self.get_aid()}
return (await Api(**api, credential=self.credential).update_params(**params).result)[
"favoured"
Expand All @@ -684,7 +684,7 @@ async def like(self, status: bool = True):
self.credential.raise_for_no_sessdata()
self.credential.raise_for_no_bili_jct()

api = get_api("video")["operate"]["like"]
api = API_video["operate"]["like"]
data = {"aid": self.get_aid(), "like": 1 if status else 2}
return await Api(**api, credential=self.credential).update_data(data).result

Expand All @@ -706,7 +706,7 @@ async def pay_coin(self, num: int = 1, like: bool = False):
if num not in (1, 2):
raise ArgsException("投币数量只能是 1 ~ 2 个。")

api = get_api("video")["operate"]["coin"]
api = API_video["operate"]["coin"]
data = {
"aid": self.get_aid(),
"multiply": num,
Expand Down Expand Up @@ -734,7 +734,7 @@ async def set_favorite(
self.credential.raise_for_no_sessdata()
self.credential.raise_for_no_bili_jct()

api = get_api("video")["operate"]["favorite"]
api = API_video["operate"]["favorite"]
data = {
"rid": self.get_aid(),
"type": 2,
Expand Down

0 comments on commit 3421689

Please sign in to comment.