Compare commits

..
2 Commits
Author SHA1 Message Date
shanmite 6c08cee944 fix: article模式下uid无法获取 2021-07-28 14:24:51 +08:00
shanmite 236fcb6284 pref: 去除对unzipper的依赖
feat: 专栏转发率达一半以上时跳过
2021-07-28 13:02:12 +08:00
5 changed files with 25 additions and 15 deletions
+1 -1
View File
@@ -194,7 +194,7 @@ class Monitor extends Public {
const
/**判断是转发源动态还是现动态 */
uid = lottery_info_type === ('tag' || 'article') ? uids[0] : uids[1]
uid = lottery_info_type === 'uid' ? uids[1] : uids[0]
, isFollowed = (new RegExp(uid)).test(attentionList)
, description = typeof des === 'string' ? des : ''
, needAt = /(?:@|艾特)[^@|(艾特)]*?好友/.test(description)
+14 -8
View File
@@ -114,7 +114,7 @@ function modifyDynamicRes(res) {
*/
array = next.has_more === 0
? []
: cards.map(onecard => parseDynamicCard(onecard))
: cards.map(parseDynamicCard)
log.info('处理动态数据', `动态数据读取完毕(${cards.length})(${next.has_more})`);
@@ -298,17 +298,23 @@ class Public {
let dyinfos = [];
for (const cv of cvs) {
const content = await BiliAPI.getOneArticleByCv(cv)
, dyids = content.match(/(?<=t.bilibili.com\/)[0-9]+/g) || [];
let { length } = dyids,
const
content = await BiliAPI.getOneArticleByCv(cv),
dyids = content.match(/(?<=t.bilibili.com\/)[0-9]+/g) || [],
/**判断此专栏是否查看过的权重 */
weight = 8;
weight = dyids.length / 2;
let { length } = dyids;
log.info('获取动态', `提取专栏(${cv})中提及的dyid(${length})`)
for (const dyid of dyids) {
let _weight = 0;
const isRelayed = await MyStorage.searchDyid(dyid);
weight = isRelayed ? weight - 1 : 8;
if (weight < 0) {
log.info('获取动态', '连续8条动态曾经转过,该专栏或已查看,故中止')
if (isRelayed) {
_weight += 1;
}
if (_weight >= weight) {
log.info('获取动态', `1/2动态曾经转过,该专栏或已查看,故中止`)
dyinfos = []
break
}
+1 -1
View File
@@ -10,7 +10,7 @@ const metainfo = [
` __/ | | | `,
` |___/ |_| `,
` `,
` v1.9.5 by shanmite`,
` v1.9.7 by shanmite`,
]
/**多账号存储 */
let multiple_account = [];
+4 -5
View File
@@ -23,7 +23,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/shanmite/AutoScript.git"
"url": "https://github.com/shanmiteko/AutoScript.git"
},
"keywords": [
"auto",
@@ -32,16 +32,15 @@
"author": "shanmite",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/shanmite/AutoScript/issues"
"url": "https://github.com/shanmiteko/AutoScript/issues"
},
"homepage": "https://github.com/shanmite/AutoScript#readme",
"homepage": "https://github.com/shanmiteko/AutoScript#readme",
"devDependencies": {
"eslint": "^7.17.0",
"pkg": "^5.2.1"
},
"dependencies": {
"chalk": "^4.1.1",
"nodemailer": "^6.5.0",
"unzipper": "^0.10.11"
"nodemailer": "^6.5.0"
}
}
+5
View File
@@ -30,6 +30,11 @@ foreach ($TRI in $TRIARR) {
Move-Item -Path $BIN -Destination $DIR -Force
Copy-Item -Path $ENV_FILE -Destination $DIR -Force
Copy-Item -Path $CONFIG_FILE -Destination $DIR -Force
if ($DIR -eq "nlts-win-x64") {
New-Item -Path $DIR -Name "start.bat" -ItemType File -Value "@echo off && lottery start && pause" -Force
New-Item -Path $DIR -Name "check.bat" -ItemType File -Value "@echo off && lottery check && pause" -Force
New-Item -Path $DIR -Name "clear.bat" -ItemType File -Value "@echo off && lottery clear && pause" -Force
}
Compress-Archive -Path $DIR -DestinationPath "$($DIR)-$(Get-Date -Format "yyyyMMd")" -Force
}