From c02dcdf81487acabc0f70a589f40d2349ad5d3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Sat, 29 Oct 2022 17:17:07 +0800 Subject: [PATCH] =?UTF-8?q?assistant=E6=B7=BB=E5=8A=A0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8D=95=E8=8E=B7=EF=BC=8C=E9=81=BF=E5=85=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=AD=BB=E9=94=81=E5=BC=82=E5=B8=B8=E9=80=A0=E6=88=90?= =?UTF-8?q?assistant=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netease_music/src/assistantUtils.js | 17 +++++--- netease_music/src/index.js | 2 +- netease_music/todo.txt | 60 +++++++++++++---------------- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/netease_music/src/assistantUtils.js b/netease_music/src/assistantUtils.js index 2899471..16847c8 100644 --- a/netease_music/src/assistantUtils.js +++ b/netease_music/src/assistantUtils.js @@ -1,5 +1,7 @@ // 定时更新 wait 表 +const sleepUtils = require("../../utils/sleepUtils"); + // 计算数组差集 (a - b) function getDiffSet(a, b) { // let a = [1, 2, 3]; @@ -45,11 +47,16 @@ async function migrateIdsFromCheckToFetch(tableName, fieldName, insertSql = null } } -function getPromise(tableName, fieldName, insertSql) { - return new Promise(async function (resolve) { - await migrateIdsFromCheckToFetch(tableName, fieldName, insertSql); - resolve(); - }); +async function getPromise(tableName, fieldName, insertSql) { + try { + return new Promise(async function (resolve) { + await migrateIdsFromCheckToFetch(tableName, fieldName, insertSql); + resolve(); + }); + } catch (e) { + console.error(e); + await sleepUtils.sleep(10 * 1000); + } } async function updateWaitTable() { await Promise.all([ diff --git a/netease_music/src/index.js b/netease_music/src/index.js index 10592f3..5f1b829 100644 --- a/netease_music/src/index.js +++ b/netease_music/src/index.js @@ -84,7 +84,7 @@ async function main(args) { case 'assistant': await assistantUtils.updateWaitTable(); - await sleepUtils.sleep(5000); + await sleepUtils.sleep(10 * 1000); break; default: console.log("utils参数不匹配,退出"); diff --git a/netease_music/todo.txt b/netease_music/todo.txt index 53d7016..a1efb14 100644 --- a/netease_music/todo.txt +++ b/netease_music/todo.txt @@ -1,35 +1,29 @@ -cd C:\Users\Coz\Desktop\tools\ -cd /www/neteasemusic/tools -node index --utils song --min 1800000000 --max 2000000000 --order DESC # -node index --utils song --min 1290000000 --max 1500000000 --order DESC # -node index --utils song --min 400000000 --max 1000000000 --order ASC # -node index --utils song --min 0 --max 400000000 --order ASC # -############################################################################################# -node index --utils album --min 134000000 --max 160000000 # -node index --utils album --min 0 --max 134000000 # -############################################################################################# -node index --utils artist # -############################################################################################# -node index --utils comment --min 1800000000 --max 2000000000 --order DESC # -node index --utils comment --min 1290000000 --max 1500000000 --order DESC # -node index --utils comment --min 400000000 --max 1000000000 --order ASC # -node index --utils comment --min 0 --max 400000000 --order ASC # -############################################################################################# -node index --utils lyric --min 1800000000 --max 2000000000 # -node index --utils lyric --min 400000000 --max 1000000000 # -node index --utils lyric --min 0 --max 400000000 # -############################################################################################# -node index --utils playlist # +本地 +auto.bat + +windows服务器 +cd C:\Users\Administrator\Desktop\tools\netease_music +node index --utils album --min 10000000 --limit 1000 --order asc +node index --utils album --limit 1000 --order desc +node index --utils artist --limit 1000 --order desc +node index --utils artist --min 30000000 --limit 1000 --order asc + +linux服务器 +cd /www/neteasemusic/tools +node index --utils album --min 70000000 --limit 1000 +node index --utils album --min 80000000 --limit 1000 +node index --utils album --min 90000000 --limit 1000 +node index --utils album --min 100000000 --limit 1000 + +hifini +linux服务器 +node index --limit 300,50 +node index --limit 200,50 +node index --limit 200,50 --order desc +Windows server +node index --limit 300,50 --order desc + -正式库 -node index --utils song -node index --utils album --min 10000000 -node index --utils album --order desc -node index --utils artist -node index --utils playlist -node index --utils comment --limit 10000 -node index --utils lyric -node index --utils assistant 本地库测试 node index --database neteasemusic_develop --utils song @@ -41,6 +35,8 @@ node index --database neteasemusic_develop --utils comment --limit 10000 node index --database neteasemusic_develop --utils lyric node index --database neteasemusic_develop --utils assistant + + 思路: 通过一首歌,查出对应的artist和album,然后顺藤摸瓜查出网易云的其他song, album, artist, lyric, comment等 @@ -50,8 +46,6 @@ node index --database neteasemusic_develop --utils assistant 后期: -爬取歌单playlist功能需要更新 - 删除song_playlist_relation表中rcmd_reason字段(全是空字符串) 歌单定时更新(rel表中添加一个del字段,先将歌单下面的全部置为删除状态,再插入的时候把已有歌曲的标记重新修改为正常状态)