Skip to content

Commit a6ab8c0

Browse files
committed
chore: Merge branch 'dev' of https://github.com/Nemo2011/bilibili-api into dev
2 parents 313c736 + bd2b415 commit a6ab8c0

File tree

9 files changed

+584
-7
lines changed

9 files changed

+584
-7
lines changed

bilibili_api/data/api/dynamic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
"comment": "获取动态页 UP 主信息列表"
207207
},
208208
"dynamic_page_info": {
209-
"url": "https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all?timezone_offset=-480&type=all&page=1&features=itemOpusStyle",
209+
"url": "https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all",
210210
"method": "GET",
211211
"verify": true,
212212
"params": {

bilibili_api/data/api/show.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"info": {
3+
"get": {
4+
"url": "https://show.bilibili.com/api/ticket/project/get",
5+
"method": "GET",
6+
"verify": false,
7+
"ignore_code": true,
8+
"params": {
9+
"id": "展出id"
10+
},
11+
"comment": "展出信息"
12+
},
13+
"buyer_info": {
14+
"url": "https://show.bilibili.com/api/ticket/buyer/list",
15+
"method": "GET",
16+
"verify": true,
17+
"ignore_code": true,
18+
"comment": "读取用户所有购买人身份"
19+
},
20+
"token": {
21+
"url": "https://show.bilibili.com/api/ticket/order/prepare",
22+
"method": "POST",
23+
"verify": true,
24+
"ignore_code": true,
25+
"no_csrf": true,
26+
"data": {
27+
"project_id": "项目id",
28+
"screen_id": "展出id",
29+
"sku_id": "票id"
30+
},
31+
"comment": "获取购票 token"
32+
}
33+
},
34+
"operate": {
35+
"order": {
36+
"url": "https://show.bilibili.com/api/ticket/order/createV2",
37+
"method": "POST",
38+
"verify": true,
39+
"no_csrf": true,
40+
"ignore_code": true,
41+
"params": {
42+
"project_id": "展出id"
43+
},
44+
"comment": "创建订单"
45+
}
46+
}
47+
}

bilibili_api/dynamic.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,13 @@ def __init__(
723723
def get_dynamic_id(self) -> int:
724724
return self.__dynamic_id
725725

726-
async def get_info(self) -> dict:
726+
async def get_info(self, features: str = "itemOpusStyle") -> dict:
727727
"""
728728
获取动态信息
729729
730+
Args:
731+
features (str, optional): 默认 itemOpusStyle.
732+
730733
Returns:
731734
dict: 调用 API 返回的结果
732735
"""
@@ -735,7 +738,7 @@ async def get_info(self) -> dict:
735738
params = {
736739
"id": self.__dynamic_id,
737740
"timezone_offset": -480,
738-
"features": "itemOpusStyle",
741+
"features": features,
739742
}
740743
data = (
741744
await Api(**api, credential=self.credential).update_params(**params).result
@@ -889,6 +892,7 @@ async def get_dynamic_page_info(
889892
credential: Credential,
890893
_type: Optional[DynamicType] = None,
891894
host_mid: Optional[int] = None,
895+
features: str = "itemOpusStyle",
892896
pn: int = 1,
893897
offset: Optional[int] = None,
894898
) -> List[Dynamic]:
@@ -906,6 +910,8 @@ async def get_dynamic_page_info(
906910
907911
host_mid (int, optional): 获取对应 UP 主动态的 mid. Defaults to None.
908912
913+
features (str, optional): 默认 itemOpusStyle.
914+
909915
pn (int, optional): 页码. Defaults to 1.
910916
911917
offset (int, optional): 偏移值(下一页的第一个动态 ID,为该请求结果中的 offset 键对应的值),类似单向链表. Defaults to None.
@@ -917,7 +923,7 @@ async def get_dynamic_page_info(
917923
api = API["info"]["dynamic_page_info"]
918924
params = {
919925
"timezone_offset": -480,
920-
"features": "itemOpusStyle",
926+
"features": features,
921927
"offset": offset,
922928
"page": pn,
923929
}

0 commit comments

Comments
 (0)