Skip to content

Commit

Permalink
fix: add getOneDynamicByDyid v1
Browse files Browse the repository at this point in the history
  • Loading branch information
shanmiteko committed Apr 5, 2024
1 parent 7a8682c commit 469a6dc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/core/searcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function parseDynamicCard(dynamic_detail_card) {
, { info = {} } = user_profile
, cardToJson = strToJson(card)
, extendjsonToJson = strToJson(extend_json)
, { add_on_card_info = [] } = display
, { add_on_card_info = [] } = display || {}
, { item } = cardToJson;
const dy_type2chat_type = new Map([[1, 17], [2, 11], [4, 17], [8, 1], [64, 12]]);
/* 转发者的UID */
Expand Down
29 changes: 19 additions & 10 deletions lib/net/bili.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,25 @@ const bili_client = {
},
_getOneDynamicByDyid: new Line(
'获取一个动态的细节',
Array(10)
.fill(
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', Math.floor(Math.random() * 10 ** 10)),
config: { retry: false },
query: {
dynamic_id
}
})
)
[
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', 1),
config: { retry: false },
query: {
dynamic_id
}
}),
...Array(10)
.fill(
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', Math.floor(Math.random() * 10 ** 10)),
config: { retry: false },
query: {
dynamic_id
}
})
)
]
, responseText => {
const
res = strToJson(responseText),
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const utils = {
const obj = JSON.parse(str);
return typeof obj === 'object' ? obj : false
} catch (e) {
utils.log.error("json解析", e)
utils.log.error("json解析", e + "\n" + params)
return false;
}
} else {
Expand Down

0 comments on commit 469a6dc

Please sign in to comment.