From 0b887580fcc1a6f99bb0f12aa834fae61f352d49 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: Mon, 7 Nov 2022 15:05:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netease_music/auto.bat | 6 +++--- netease_music/sql/statistic.sql | 27 ++++++++------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/netease_music/auto.bat b/netease_music/auto.bat index 261610b..d507d20 100644 --- a/netease_music/auto.bat +++ b/netease_music/auto.bat @@ -1,10 +1,10 @@ start cmd /k "node index --utils assistant" start cmd /k "node index --utils song" -start cmd /k "node index --utils album" -start cmd /k "node index --utils artist" +start cmd /k "node index --utils album --limit 10000" +start cmd /k "node index --utils artist --limit 10000" start cmd /k "node index --utils comment --limit 10000" -start cmd /k "node index --utils lyric" +start cmd /k "node index --utils lyric --limit 10000" @REM start cmd /k "node index --utils playlist" exit \ No newline at end of file diff --git a/netease_music/sql/statistic.sql b/netease_music/sql/statistic.sql index 0d76a3a..088779b 100644 --- a/netease_music/sql/statistic.sql +++ b/netease_music/sql/statistic.sql @@ -3,9 +3,6 @@ DELETE FROM analysis WHERE `key` LIKE '%_old'; UPDATE analysis SET `key`=concat(`key`,'_old'), modify_time=modify_time WHERE `key` NOT LIKE '%_old'; INSERT INTO analysis (`key`, `value`) VALUES ('songCount', (SELECT count(*) as count FROM song) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`); --- INSERT INTO analysis (`key`, `value`) VALUES ('songWaiting', (SELECT count(DISTINCT song_id) AS count --- FROM ( SELECT song_id FROM song_artist_relation UNION SELECT song_id FROM song_album_relation ) t_tmp --- WHERE song_id NOT IN ( SELECT song_id FROM song )) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`); INSERT INTO analysis (`key`, `value`) VALUES ('songWaiting', (SELECT count(*) as count FROM wait_fetch_song) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`); INSERT INTO analysis (`key`, `value`) VALUES ('playlistCount', (SELECT count(*) AS count FROM playlist) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`); INSERT INTO analysis (`key`, `value`) VALUES ('albumCount', (SELECT count(*) as count FROM album) ) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`); @@ -57,27 +54,20 @@ INSERT IGNORE INTO wait_check_album (id) SELECT album_id FROM song_album_rela -- 查看需要爬取的 song 的分布 -SELECT cast( format( t_tmp.song_id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count -FROM ( - SELECT DISTINCT song_id FROM song_album_relation - UNION - SELECT DISTINCT song_id FROM song_artist_relation -) as t_tmp -WHERE song_id NOT IN ( SELECT song_id FROM song ) +SELECT cast( format( id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +FROM wait_fetch_song GROUP BY s ORDER BY s DESC -- 查看需要爬取的 album 的分布 -SELECT cast( format( album_id / 1000000, 0) * 1000000 as UNSIGNED ) as s, count(*) as count -FROM song_album_relation -WHERE album_id NOT IN ( SELECT album_id FROM album ) +SELECT cast( format( id / 1000000, 0) * 1000000 as UNSIGNED ) as s, count(*) as count +FROM wait_fetch_album GROUP BY s ORDER BY s DESC -- 查看需要爬取的 artist 的分布 -SELECT cast( format( artist_id / 2000000, 0) * 2000000 as UNSIGNED ) as s, count(*) as count -FROM song_artist_relation -WHERE artist_id NOT IN ( SELECT artist_id FROM artist ) +SELECT cast( format( id / 1000000, 0) * 1000000 as UNSIGNED ) as s, count(*) as count +FROM wait_fetch_artist GROUP BY s ORDER BY s DESC @@ -89,9 +79,8 @@ GROUP BY s ORDER BY s DESC -- 查看需要爬取的 lyric 的分布 -SELECT cast( format( song_id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count -FROM song -WHERE song_id NOT IN ( SELECT song_id FROM lyric ) +SELECT cast( format( id / 10000000, 0) * 10000000 as UNSIGNED ) as s, count(*) as count +FROM wait_fetch_lyric GROUP BY s ORDER BY s DESC