1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
程序员小墨 2022-10-19 22:58:56 +08:00
parent 8451e7a849
commit da900dc2b1
7 changed files with 287 additions and 57 deletions

View File

@ -56,7 +56,7 @@ CREATE TABLE `album` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `playlist` (
`playlist_id` int(10) unsigned NOT NULL COMMENT '歌单id',
`playlist_id` bigint(20) unsigned NOT NULL COMMENT '歌单id',
`title` varchar(200) NOT NULL COMMENT '歌单名',
`english_title` varchar(200) DEFAULT NULL COMMENT '歌单名(英文)',
`description` varchar(1500) NOT NULL COMMENT '歌单简介',
@ -81,8 +81,8 @@ CREATE TABLE `playlist` (
`status` tinyint(4) DEFAULT NULL COMMENT '保留状态码',
`privacy` tinyint(4) DEFAULT NULL COMMENT '保留状态码',
`ad_type` tinyint(4) DEFAULT NULL COMMENT '保留状态码',
`special_type` tinyint(4) DEFAULT NULL COMMENT '保留状态码',
`official_playlist_type` tinyint(4) DEFAULT NULL COMMENT '保留状态码',
`special_type` int(11) DEFAULT NULL COMMENT '保留状态码',
`official_playlist_type` varchar(20) DEFAULT NULL COMMENT '保留状态码',
`op_recommend` tinyint(4) DEFAULT NULL COMMENT '保留状态码 0-false 1-true',
`high_quality` tinyint(4) DEFAULT NULL COMMENT '保留状态码 0-false 1-true',
`new_imported` tinyint(4) DEFAULT NULL COMMENT '保留状态码 0-false 1-true',
@ -106,7 +106,7 @@ CREATE TABLE `song_playlist_relation` (
`song_id` int(10) unsigned NOT NULL COMMENT '歌曲id',
`playlist_id` int(10) unsigned NOT NULL COMMENT '歌单id',
`alg` varchar(20) DEFAULT NULL COMMENT '保留字段',
`rcmdReason` varchar(20) DEFAULT NULL COMMENT '保留字段',
`rcmd_reason` varchar(20) DEFAULT NULL COMMENT '保留字段',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '爬取时间',
`modify_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
PRIMARY KEY (`song_id`, `playlist_id`),
@ -185,11 +185,13 @@ CREATE TABLE `comment_progress` (
CREATE TABLE `category` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '分类id',
`qianqian_id` int DEFAULT NULL COMMENT '千千音乐id',
`netease_id` int DEFAULT NULL COMMENT '网易音乐id',
`title` varchar(255) NOT NULL COMMENT '分类名称',
`qianqian_group` varchar(255) DEFAULT NULL COMMENT '分类所属分组',
`qianqian_group_chinese` varchar(255) DEFAULT NULL COMMENT '分类所属分组(中文)',
`netease_id` int DEFAULT NULL COMMENT '网易音乐id',
`qianqian_id` int DEFAULT NULL COMMENT '千千音乐id',
`alias` varchar(255) DEFAULT NULL COMMENT '分类别名',
`qianqian_group` varchar(255) DEFAULT NULL COMMENT '千千音乐 分类所属分组',
`qianqian_group_chinese` varchar(255) DEFAULT NULL COMMENT '千千音乐 分类所属分组(中文)',
`netease_group_chinese` varchar(255) DEFAULT NULL COMMENT '网易音乐 分类所属分组(中文)',
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

View File

@ -9,70 +9,164 @@ const dbUtils = global.dbUtils;
// refer:
// https://neteasecloudmusicapi-docs.4everland.app/
// https://github.com/Binaryify/NeteaseCloudMusicApi
const { playlist_catlist, playlist_hot, playlist_detail, playlist_track_all, song_detail } = require('NeteaseCloudMusicApi');
const { playlist_catlist, playlist_hot, playlist_detail } = require('NeteaseCloudMusicApi');
// // 从数据库中查出还缺少的歌词,并进行爬取
// async function fetchAll() {
// console.log("start fetching lyrics ...");
// var playlistIds = await dbUtils.query(`
// SELECT DISTINCT playlist_id FROM playlist WHERE playlist_id NOT IN ( SELECT playlist_id FROM lyric )
// `, []);
// playlistIds = playlistIds.map(playlist => playlist.playlist_id);
// for (let i = 0; i < playlistIds.length; i++) {
// await global.checkIsExit();
// const playlistId = playlistIds[i];
// console.log(`${i + 1}/${playlistIds.length} | lyric: ${playlistId}`);
// try {
// await fetch({ playlistId: playlistId });
// } catch (err) {
// console.error(err);
// }
// await sleepUtils.sleep(global.sleepTime);
// }
// }
async function fetchAll({ args }) {
console.log("start fetching playlists ...");
console.log("playlist 需要一口气爬完,中途不能停止,否则下次又要重头爬(歌单不会重复爬取,但是分页列表会)")
// 从数据库中查出所有的网易云分类
let result = await dbUtils.query(`SELECT title FROM category WHERE netease_group_chinese IS NOT NULL`);
cate = result.map(cate => cate.title);
cate.unshift('全部'); // 插入第一个
console.log(cate);
for (let i = 0; i < cate.length; i++) {
const categoryName = cate[i];
try {
await fetchCategory({ categoryName: categoryName, progress: `${i + 1}/${cate.length}` });
} catch (err) {
console.error(err);
}
}
}
async function fetchCategory({ categoryName, progress }) {
// 首先去网易云音乐首页获得歌单 (每一首音乐右侧都会有几个包含该音乐的歌单)
let haveNext = true;
let perPage = 35;
let offset = 0;
while (haveNext) {
let url = `https://music.163.com/discover/playlist?cat=${encodeURIComponent(categoryName)}&limit=${perPage}&offset=${offset}`;
try {
// var html = fs.readFileSync(path.join(__dirname, "../../temp", `discover-playlist.html`), 'utf8');
var html = await requestUtils.getApiResult(url);
// fs.writeFileSync(path.join(__dirname, "../../temp", `discover-playlist.html`), html);
var matcher = html.matchAll(/"\/playlist\?id=(\d{1,20})"/g);
var m = matcher.next();
var a = new Set(); // 因为每个歌单id会出现两次所以使用Set去重
while (!m.done) {
a.add(Number(m.value[1]));
m = matcher.next();
}
var playlistIds = Array.from(a).sort();
} catch (errors) {
console.error(errors);
return;
}
// 从数据库查出已爬取的歌单ids并从 playlistIds 中排除这部分歌单
var exceptPlaylistIds = await dbUtils.query(`
SELECT playlist_id FROM playlist WHERE playlist_id IN ?
`, [[playlistIds]]);
exceptPlaylistIds = exceptPlaylistIds.map(playlist => playlist.playlist_id);
var finalPlaylistIds = playlistIds.filter(playlistId => exceptPlaylistIds.indexOf(playlistId) == -1);
// console.log("playlistIds", playlistIds);
// console.log("exceptPlaylistIds", exceptPlaylistIds);
// console.log("finalPlaylistIds", finalPlaylistIds);
console.log("finalPlaylistIds.length", finalPlaylistIds.length);
for (let i = 0; i < finalPlaylistIds.length; i++) {
await global.checkIsExit();
const playlistId = finalPlaylistIds[i];
// console.log(offset, i, finalPlaylistIds.length);
console.log(`分类: ${progress} | 歌单: ${offset + i + 1}/${offset + finalPlaylistIds.length} | playlist: ${playlistId}`);
try {
await fetch({ playlistId: playlistId });
} catch (err) {
console.error(err);
}
await sleepUtils.sleep(global.sleepTime);
}
// 最有一页判断标识
if (html.indexOf(`class="zbtn znxt js-disabled">下一页</a>`) > -1) haveNext = false;
offset += perPage;
}
}
// 获取歌词详情
async function fetch({ playlistId, debug = false }) {
let result = await dbUtils.query('SELECT count(*) as count FROM playlist WHERE playlist_id = ?', [playlistId]);
if (result[0].count > 0 && !debug) {
console.log(`数据库中已有数据,跳过 playlistId: ${playlistId}`);
return;
}
// https://neteasecloudmusicapi-docs.4everland.app/#/?id=%e6%ad%8c%e5%8d%95%e5%88%86%e7%b1%bb
var queryParams = {};
try {
// 获取歌单分类
// var playlistResult = await playlist_catlist(queryParams);
// var playlistResult = await playlist_hot(queryParams);
// var playlistResult = await playlist_detail({
// id: playlistId,
// });
var playlistResult = await song_detail({
// ids: ["536623501", "536623501"].join(','),
// var playlistResult = await playlist_catlist({});
// var playlistResult = await playlist_hot({});
var playlistResult = await playlist_detail({
id: playlistId,
});
// var playlistResult = await playlist_track_all({
// id: playlistId,
// limit: 10,
// offset: 0,
// });
fs.writeFileSync(path.join(__dirname, "../../temp", `playlist-${playlistId}.json`), JSON.stringify(playlistResult));
// fs.writeFileSync(path.join(__dirname, "../../temp", `playlist-${playlistId}.json`), JSON.stringify(playlistResult));
} catch (errors) {
console.error(errors);
return;
}
console.log(playlistResult);
let playlist = playlistResult.body.playlist;
// console.log("playlist", playlist);
// let lyricInfo = {
// playlistId: playlistId,
// lyric: lyric.lyric,
// version: lyric.version,
// };
// // console.log("lyricInfo", lyricInfo);
// dbUtils.query('INSERT IGNORE INTO lyric SET ?', {
// playlist_id: lyricInfo.playlistId,
// lyric: lyricInfo.lyric,
// version: lyricInfo.version,
// });
// return lyricInfo;
let playlistInfo = {
playlist_id: playlist.id,
title: playlist.name,
english_title: playlist.englishTitle,
description: playlist.description,
user_id: playlist.userId,
tags: JSON.stringify(playlist.tags),
alg_tags: JSON.stringify(playlist.algTags),
playlist_create_time: playlist.createTime,
playlist_update_time: playlist.updateTime,
track_count: playlist.trackCount,
play_count: playlist.playCount,
subscribed_count: playlist.subscribedCount,
share_count: playlist.shareCount,
comment_count: playlist.commentCount,
cover_image: playlist.coverImgUrl ? /^https?:\/\/p.\.music\.126\.net\/(.*?)$/.exec(playlist.coverImgUrl)[1] : '',
title_image: playlist.titleImageUrl ? /^https?:\/\/p.\.music\.126\.net\/(.*?)$/.exec(playlist.titleImageUrl)[1] : '',
background_cover: playlist.backgroundCoverUrl ? /^https?:\/\/p.\.music\.126\.net\/(.*?)$/.exec(playlist.backgroundCoverUrl)[1] : '',
ordered: playlist.ordered,
copied: playlist.copied,
status: playlist.status,
privacy: playlist.privacy,
ad_type: playlist.adType,
special_type: playlist.specialType,
official_playlist_type: playlist.officialPlaylistType,
op_recommend: playlist.opRecommend,
high_quality: playlist.highQuality,
new_imported: playlist.newImported,
update_frequency: playlist.updateFrequency,
grade_status: playlist.gradeStatus,
score: playlist.score,
creator: JSON.stringify(playlist.creator),
video_ids: JSON.stringify(playlist.videoIds),
videos: JSON.stringify(playlist.videos),
banned_track_ids: JSON.stringify(playlist.bannedTrackIds),
remix_video: JSON.stringify(playlist.remixVideo),
};
// console.log("playlistInfo", playlistInfo);
if (playlist.bannedTrackIds) {
console.log("bannedTrackIds", playlist.bannedTrackIds);
process.exit(0);
}
let trackIds = playlist.trackIds.map(track => [track.id, playlist.id, track.alg, track.rcmdReason]);
if (trackIds.length > 0)
await dbUtils.query('INSERT IGNORE INTO song_playlist_relation (song_id, playlist_id, alg, rcmd_reason) VALUES ?', [trackIds]);
await dbUtils.query(`
INSERT INTO playlist ( ${Object.keys(playlistInfo).map(field => `\`${field}\``).join(",")} ) VALUES ?
ON DUPLICATE KEY UPDATE ${Object.keys(playlistInfo).map(field => `${field}=VALUES(${field})`).join(", ")}
`, [[Object.values(playlistInfo)]]);
return playlistInfo;
}
module.exports = {
fetch: fetch,
// fetchAll: fetchAll,
fetchAll: fetchAll,
}

View File

@ -22,7 +22,7 @@ async function fetchAll({ args = {} }) {
${args.limit ? `LIMIT ${args.limit}` : ''}
`;
// // 更新现有数据
// sql = `SELECT song_id FROM song WHERE ${whereClause} AND data_version = 1`;
// sql = `SELECT song_id FROM song WHERE data_version = 1`;
// 测试用
// sql = `SELECT song_id FROM song_artist_relation group by song_id limit 10`;
console.log(sql);

View File

@ -32,6 +32,7 @@ async function test() {
// 不是所有歌手都有个人主页 例如 https://music.163.com/#/artist?id=1079075
// let res = await songInfoUtils.fetchAll({ args: {} });
// let res = await playlistUtils.fetchAll();
// let res = await albumInfoUtils.fetch({ albumId: "9156", debug: true });
// let res = await artistInfoUtils.fetch({ artistId: "12023508" });
@ -66,6 +67,8 @@ async function main(args) {
await lyricInfoUtils.fetchAll({ args: args });
else if (args.utils == "comment")
await commentUtils.fetchAll({ args: args });
else if (args.utils == "playlist")
await playlistUtils.fetchAll({ args: args });
else {
console.log("utils参数不匹配退出");
return;

View File

@ -0,0 +1,28 @@
const fs = require('fs');
const path = require('path');
var html = fs.readFileSync(path.join(__dirname, 'get_cate_html.html'), 'utf8');
var htmlGroup = html.split('<dl class="f-cb">');
var rows = [];
htmlGroup.forEach(function (group) {
let title = group.match(/<\/i>(.*?)<\/dt>/);
if (!title) return; // 排除第一个 全部
title = title[1];
var matcher = group.matchAll(/data-cat="(.*?)"/g);
var m = matcher.next();
var cate = [];
while (!m.done) {
let category = m.value[1].replace(/&amp;/g, "&");
cate.push(category);
rows.push(`('${category}', '${title}')`);
m = matcher.next();
}
console.log({ title, cate });
});
console.log(`
INSERT INTO category (title, netease_group_chinese) VALUES ${rows.join(',')} ON DUPLICATE KEY UPDATE netease_group_chinese=VALUES(netease_group_chinese)
`);
return;

View File

@ -0,0 +1,96 @@
<h3><a href="/discover/playlist/" class="j-flag u-btn u-btn-g s-fc1" data-cat="全部"><em>全部风格</em></a></h3>
<dl class="f-cb">
<dt><i class="u-icn u-icn-71"></i>语种</dt>
<dd >
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%8D%8E%E8%AF%AD" data-cat="华语">华语</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%AC%A7%E7%BE%8E" data-cat="欧美">欧美</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%97%A5%E8%AF%AD" data-cat="日语">日语</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E9%9F%A9%E8%AF%AD" data-cat="韩语">韩语</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%B2%A4%E8%AF%AD" data-cat="粤语">粤语</a><span class="line">|</span>
</dd>
</dl>
<dl class="f-cb">
<dt><i class="u-icn u-icn-6"></i>风格</dt>
<dd >
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B5%81%E8%A1%8C" data-cat="流行">流行</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%91%87%E6%BB%9A" data-cat="摇滚">摇滚</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B0%91%E8%B0%A3" data-cat="民谣">民谣</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%94%B5%E5%AD%90" data-cat="电子">电子</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E8%88%9E%E6%9B%B2" data-cat="舞曲">舞曲</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E8%AF%B4%E5%94%B1" data-cat="说唱">说唱</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E8%BD%BB%E9%9F%B3%E4%B9%90" data-cat="轻音乐">轻音乐</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%88%B5%E5%A3%AB" data-cat="爵士">爵士</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E4%B9%A1%E6%9D%91" data-cat="乡村">乡村</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=R%26B%2FSoul" data-cat="R&amp;B/Soul">R&amp;B/Soul</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%8F%A4%E5%85%B8" data-cat="古典">古典</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B0%91%E6%97%8F" data-cat="民族">民族</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E8%8B%B1%E4%BC%A6" data-cat="英伦">英伦</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E9%87%91%E5%B1%9E" data-cat="金属">金属</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%9C%8B%E5%85%8B" data-cat="朋克">朋克</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E8%93%9D%E8%B0%83" data-cat="蓝调">蓝调</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E9%9B%B7%E9%AC%BC" data-cat="雷鬼">雷鬼</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E4%B8%96%E7%95%8C%E9%9F%B3%E4%B9%90" data-cat="世界音乐">世界音乐</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%8B%89%E4%B8%81" data-cat="拉丁">拉丁</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=New%20Age" data-cat="New Age">New Age</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%8F%A4%E9%A3%8E" data-cat="古风">古风</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%90%8E%E6%91%87" data-cat="后摇">后摇</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=Bossa%20Nova" data-cat="Bossa Nova">Bossa Nova</a><span class="line">|</span>
</dd>
</dl>
<dl class="f-cb">
<dt><i class="u-icn u-icn-7"></i>场景</dt>
<dd >
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B8%85%E6%99%A8" data-cat="清晨">清晨</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%A4%9C%E6%99%9A" data-cat="夜晚">夜晚</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%AD%A6%E4%B9%A0" data-cat="学习">学习</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%B7%A5%E4%BD%9C" data-cat="工作">工作</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%8D%88%E4%BC%91" data-cat="午休">午休</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E4%B8%8B%E5%8D%88%E8%8C%B6" data-cat="下午茶">下午茶</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%9C%B0%E9%93%81" data-cat="地铁">地铁</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E9%A9%BE%E8%BD%A6" data-cat="驾车">驾车</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E8%BF%90%E5%8A%A8" data-cat="运动">运动</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%97%85%E8%A1%8C" data-cat="旅行">旅行</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%95%A3%E6%AD%A5" data-cat="散步">散步</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E9%85%92%E5%90%A7" data-cat="酒吧">酒吧</a><span class="line">|</span>
</dd>
</dl>
<dl class="f-cb">
<dt><i class="u-icn u-icn-8"></i>情感</dt>
<dd >
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%80%80%E6%97%A7" data-cat="怀旧">怀旧</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B8%85%E6%96%B0" data-cat="清新">清新</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B5%AA%E6%BC%AB" data-cat="浪漫">浪漫</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E4%BC%A4%E6%84%9F" data-cat="伤感">伤感</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B2%BB%E6%84%88" data-cat="治愈">治愈</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%94%BE%E6%9D%BE" data-cat="放松">放松</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%AD%A4%E7%8B%AC" data-cat="孤独">孤独</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%84%9F%E5%8A%A8" data-cat="感动">感动</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%85%B4%E5%A5%8B" data-cat="兴奋">兴奋</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%BF%AB%E4%B9%90" data-cat="快乐">快乐</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%AE%89%E9%9D%99" data-cat="安静">安静</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%80%9D%E5%BF%B5" data-cat="思念">思念</a><span class="line">|</span>
</dd>
</dl>
<dl class="f-cb">
<dt><i class="u-icn u-icn-9"></i>主题</dt>
<dd class="last">
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%BB%BC%E8%89%BA" data-cat="综艺">综艺</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%BD%B1%E8%A7%86%E5%8E%9F%E5%A3%B0" data-cat="影视原声">影视原声</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=ACG" data-cat="ACG">ACG</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%84%BF%E7%AB%A5" data-cat="儿童">儿童</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%A0%A1%E5%9B%AD" data-cat="校园">校园</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%B8%B8%E6%88%8F" data-cat="游戏">游戏</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=70%E5%90%8E" data-cat="70后">70后</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=80%E5%90%8E" data-cat="80后">80后</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=90%E5%90%8E" data-cat="90后">90后</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%BD%91%E7%BB%9C%E6%AD%8C%E6%9B%B2" data-cat="网络歌曲">网络歌曲</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=KTV" data-cat="KTV">KTV</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%BB%8F%E5%85%B8" data-cat="经典">经典</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E7%BF%BB%E5%94%B1" data-cat="翻唱">翻唱</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%90%89%E4%BB%96" data-cat="吉他">吉他</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E9%92%A2%E7%90%B4" data-cat="钢琴">钢琴</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E5%99%A8%E4%B9%90" data-cat="器乐">器乐</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=%E6%A6%9C%E5%8D%95" data-cat="榜单">榜单</a><span class="line">|</span>
<a class="s-fc1 " href="/discover/playlist/?cat=00%E5%90%8E" data-cat="00后">00后</a><span class="line">|</span>
</dd>
</dl>

View File

@ -18,6 +18,8 @@ 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 #
后期:
@ -29,6 +31,11 @@ node index --utils lyric --min 0 --max 400000000
被删除的aritst和album回头再通过其他表中的数据反查回来
说明:
song表中data_version=1的音乐是第一次爬取的时候存在但是后面再爬取时不存在的音乐
后续分区(不能在现有表上修改,只能重新查出数据到新表)
alter table song add partition (
PARTITION p1 VALUES LESS THAN ( 50000000),