diff --git a/lib/Public.js b/lib/Public.js index 4486367..5ade899 100644 --- a/lib/Public.js +++ b/lib/Public.js @@ -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 } diff --git a/main.js b/main.js index adc3009..fe6357c 100644 --- a/main.js +++ b/main.js @@ -10,7 +10,7 @@ const metainfo = [ ` __/ | | | `, ` |___/ |_| `, ` `, - ` v1.9.5 by shanmite`, + ` v1.9.6 by shanmite`, ] /**多账号存储 */ let multiple_account = []; diff --git a/package.json b/package.json index ed59a52..714ff87 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/script/pkg/pkg.ps1 b/script/pkg/pkg.ps1 index b7a2cd0..64ef37f 100644 --- a/script/pkg/pkg.ps1 +++ b/script/pkg/pkg.ps1 @@ -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 }