mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-11 09:08:14 +08:00
🐛 完善活动正则
This commit is contained in:
@@ -184,11 +184,10 @@ async function loadData(): Promise<void> {
|
||||
function getAnnoTime(content: string): string | false {
|
||||
const regexes = [
|
||||
/〓活动时间〓.*?\d\.\d版本期间持续开放/,
|
||||
/(?:〓活动时间〓|〓任务开放时间〓).*?(?:(\d\.\d版本更新(?:完成|))|(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}).*?)后永久开放/,
|
||||
/(?:〓(?:活动|折扣)时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后).*?~.*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>/,
|
||||
/(?:〓(?:活动|折扣)时间〓|祈愿时间|【上架时间】).*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>.*?~.*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>/,
|
||||
/(?:〓活动时间〓|〓任务开放时间〓).*?(?:(\d\.\d)版本更新(?:完成|)|<t class="t_(?:gl|lc)".*?>(.*?)<\/t> *?)后永久开放/s,
|
||||
/(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d)版本更新后.*?~.*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>/s,
|
||||
/(?:〓(?:活动|折扣)时间〓|祈愿时间|【上架时间】).*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>.*?~.*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>/s,
|
||||
/〓活动时间〓.*?(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}).*?(\d\.\d版本结束)/,
|
||||
/〓更新时间〓.+?<t class="t_(?:gl|lc)".*?>(.*?)&;lt;\/t>/,
|
||||
];
|
||||
if (content.match(regexes[0])) {
|
||||
const res = content.match(regexes[0]);
|
||||
@@ -206,6 +205,9 @@ function getAnnoTime(content: string): string | false {
|
||||
}
|
||||
if (content.match(regexes[2])) {
|
||||
const res = content.match(regexes[2]);
|
||||
if (res?.[1]?.match(/\d\.\d/)) {
|
||||
return `${res?.[1]}版本更新后 ~ ${res?.[2]}`;
|
||||
}
|
||||
return `${res?.[1]} ~ ${res?.[2]}`;
|
||||
}
|
||||
if (content.match(regexes[3])) {
|
||||
@@ -220,11 +222,6 @@ function getAnnoTime(content: string): string | false {
|
||||
}
|
||||
return `${res?.[1]} ~ ${res?.[2]}`;
|
||||
}
|
||||
if (content.match(regexes[5])) {
|
||||
console.log("verUpdateTime");
|
||||
// todo 待处理
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user