mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
parent
adbfb6bb38
commit
15c1d22469
@ -531,7 +531,7 @@ class Monitor extends Searcher {
|
||||
try {
|
||||
log.info('开始获取Ai评论', `(https://t.bilibili.com/${dyid})`);
|
||||
onelotteryinfo.chat = await getAiContent(lottery_info.des) || '!!!';
|
||||
log.info('Ai评论内容', `${onelotteryinfo.chat}`);
|
||||
log.info('获取到Ai评论内容', `${onelotteryinfo.chat}`);
|
||||
} catch (e) {
|
||||
log.error('获取AI评论失败,使用随机评论', e);
|
||||
onelotteryinfo.chat = (getRandomOne(chats) || '!!!').replace(/\$\{uname\}/g, uname);
|
||||
|
||||
@ -252,6 +252,8 @@ function oldParseDynamicCard(dynamic_detail_card) {
|
||||
/* 定位@信息 */
|
||||
obj.ctrl = (extendjsonToJson.ctrl) || [];
|
||||
/* 预约抽奖信息 */
|
||||
obj.reserve_id = '';
|
||||
obj.reserve_lottery_text = '信息丢失';
|
||||
if (add_on_card_info.length > 0) {
|
||||
const [status, oid_str, text] = add_on_card_info
|
||||
.filter(it => typeof it.reserve_attach_card !== 'undefined'
|
||||
@ -278,7 +280,7 @@ function oldParseDynamicCard(dynamic_detail_card) {
|
||||
obj.is_charge_lottery = true;
|
||||
}
|
||||
/* 是否有官方抽奖 */
|
||||
obj.hasOfficialLottery = extension && extension.lott && true;
|
||||
obj.hasOfficialLottery = extension && extension.lott && true || false;
|
||||
/* 转发者的描述 纯文字内容 图片动态描述 后两个分别是视频动态的描述和视频本身的描述*/
|
||||
obj.description =
|
||||
(item && ((item.content || '') + (item.description || '')))
|
||||
@ -288,6 +290,9 @@ function oldParseDynamicCard(dynamic_detail_card) {
|
||||
+ (cardToJson.vest && cardToJson.vest.content || '')
|
||||
)
|
||||
|| '';
|
||||
if (obj.description.startsWith('互动抽奖 ')) {
|
||||
obj.hasOfficialLottery = true;
|
||||
}
|
||||
/* 转发 */
|
||||
if (obj.type === 1) {
|
||||
const { origin_extension, origin, origin_extend_json = '{}' } = cardToJson
|
||||
@ -308,6 +313,8 @@ function oldParseDynamicCard(dynamic_detail_card) {
|
||||
/* 被转发者的动态的ID !!!!此为大数需使用字符串值,不然JSON.parse()会有丢失精度 */
|
||||
obj.origin_dynamic_id = desc.orig_dy_id_str;
|
||||
/* 预约抽奖信息 */
|
||||
obj.origin_reserve_id = '';
|
||||
obj.origin_reserve_lottery_text = '信息丢失';
|
||||
if (add_on_card_info.length > 0) {
|
||||
const [status, oid_str, text] = add_on_card_info
|
||||
.filter(it => typeof it.reserve_attach_card !== 'undefined'
|
||||
@ -334,7 +341,7 @@ function oldParseDynamicCard(dynamic_detail_card) {
|
||||
obj.origin_is_charge_lottery = true;
|
||||
}
|
||||
/* 是否有官方抽奖 */
|
||||
obj.origin_hasOfficialLottery = origin_extension && origin_extension.lott;
|
||||
obj.origin_hasOfficialLottery = origin_extension && origin_extension.lott || false;
|
||||
/* 被转发者的name */
|
||||
obj.origin_uname = (user && (user.name || user.uname)) || '';
|
||||
/* 被转发者的描述 */
|
||||
@ -342,6 +349,9 @@ function oldParseDynamicCard(dynamic_detail_card) {
|
||||
(item && (item.content || '' + item.description || ''))
|
||||
|| (originToJson.dynamic || '' + originToJson.desc || '')
|
||||
|| '';
|
||||
if (obj.origin_description.startsWith('互动抽奖 ')) {
|
||||
obj.origin_hasOfficialLottery = true;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
log.error('动态卡片解析', e);
|
||||
@ -364,9 +374,9 @@ function modifyDynamicRes(res) {
|
||||
log.error('处理动态数据', '获取动态数据出错,可能是访问太频繁 \n' + res);
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* !cards已经能涵盖cards == null,你在想什么?
|
||||
*/
|
||||
/**
|
||||
* !cards已经能涵盖cards == null,你在想什么?
|
||||
*/
|
||||
if (!items || !items.length) {
|
||||
log.warn('处理动态数据', '未找到任何动态信息');
|
||||
items = [];
|
||||
@ -438,8 +448,8 @@ class Searcher {
|
||||
|
||||
// 当 offset 为 '0'(初始页)时,传入 offset 会报错
|
||||
const OneDynamicInfo = offset === '0'
|
||||
? await hadUidGetOneDynamicInfoByUID()
|
||||
: await hadUidGetOneDynamicInfoByUID(offset);
|
||||
? await hadUidGetOneDynamicInfoByUID()
|
||||
: await hadUidGetOneDynamicInfoByUID(offset);
|
||||
|
||||
const mDRdata = modifyDynamicRes(OneDynamicInfo);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user