fix: add getOneDynamicByDyid v1

This commit is contained in:
shanmite 2024-04-05 10:10:01 +08:00
parent 7a8682ce76
commit 469a6dc7b5
3 changed files with 21 additions and 12 deletions

View File

@ -67,7 +67,7 @@ function parseDynamicCard(dynamic_detail_card) {
, { info = {} } = user_profile , { info = {} } = user_profile
, cardToJson = strToJson(card) , cardToJson = strToJson(card)
, extendjsonToJson = strToJson(extend_json) , extendjsonToJson = strToJson(extend_json)
, { add_on_card_info = [] } = display , { add_on_card_info = [] } = display || {}
, { item } = cardToJson; , { item } = cardToJson;
const dy_type2chat_type = new Map([[1, 17], [2, 11], [4, 17], [8, 1], [64, 12]]); const dy_type2chat_type = new Map([[1, 17], [2, 11], [4, 17], [8, 1], [64, 12]]);
/* 转发者的UID */ /* 转发者的UID */

View File

@ -414,7 +414,15 @@ const bili_client = {
}, },
_getOneDynamicByDyid: new Line( _getOneDynamicByDyid: new Line(
'获取一个动态的细节', '获取一个动态的细节',
Array(10) [
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', 1),
config: { retry: false },
query: {
dynamic_id
}
}),
...Array(10)
.fill( .fill(
(dynamic_id) => get({ (dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', Math.floor(Math.random() * 10 ** 10)), url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', Math.floor(Math.random() * 10 ** 10)),
@ -424,6 +432,7 @@ const bili_client = {
} }
}) })
) )
]
, responseText => { , responseText => {
const const
res = strToJson(responseText), res = strToJson(responseText),

View File

@ -45,7 +45,7 @@ const utils = {
const obj = JSON.parse(str); const obj = JSON.parse(str);
return typeof obj === 'object' ? obj : false return typeof obj === 'object' ? obj : false
} catch (e) { } catch (e) {
utils.log.error("json解析", e) utils.log.error("json解析", e + "\n" + params)
return false; return false;
} }
} else { } else {