chore: remove the lyrics in netease music.

This commit is contained in:
Yufan Sheng 2024-11-01 13:45:09 +08:00
parent 567bb45e1d
commit 6aa8be8386
Signed by: syhily
GPG Key ID: 9D18A22A7DCD5A9B
6 changed files with 64 additions and 127 deletions

148
package-lock.json generated
View File

@ -9,11 +9,11 @@
"version": "3.0.0",
"license": "MIT",
"dependencies": {
"@astrojs/mdx": "^3.1.8",
"@astrojs/mdx": "^3.1.9",
"@astrojs/rss": "^4.0.9",
"@zeabur/astro-adapter": "^1.0.6",
"astro": "^4.16.7",
"drizzle-orm": "^0.35.3",
"astro": "^4.16.8",
"drizzle-orm": "^0.36.0",
"fuse.js": "^7.0.0",
"lodash": "^4.17.21",
"luxon": "^3.5.0",
@ -28,7 +28,7 @@
"@napi-rs/canvas": "^0.1.59",
"@types/lodash": "^4.17.13",
"@types/luxon": "^3.4.2",
"@types/node": "^22.8.4",
"@types/node": "^22.8.6",
"@types/pg": "^8.11.10",
"@types/qrcode-svg": "^1.1.5",
"@types/unist": "^3.0.3",
@ -165,14 +165,14 @@
}
},
"node_modules/@astrojs/mdx": {
"version": "3.1.8",
"resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-3.1.8.tgz",
"integrity": "sha512-4o/+pvgoLFG0eG96cFs4t3NzZAIAOYu57fKAprWHXJrnq/qdBV0av6BYDjoESxvxNILUYoj8sdZVWtlPWVDLog==",
"version": "3.1.9",
"resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-3.1.9.tgz",
"integrity": "sha512-3jPD4Bff6lIA20RQoonnZkRtZ9T3i0HFm6fcDF7BMsKIZ+xBP2KXzQWiuGu62lrVCmU612N+SQVGl5e0fI+zWg==",
"license": "MIT",
"dependencies": {
"@astrojs/markdown-remark": "5.3.0",
"@mdx-js/mdx": "^3.0.1",
"acorn": "^8.12.1",
"@mdx-js/mdx": "^3.1.0",
"acorn": "^8.14.0",
"es-module-lexer": "^1.5.4",
"estree-util-visit": "^2.0.0",
"gray-matter": "^4.0.3",
@ -243,9 +243,9 @@
}
},
"node_modules/@babel/code-frame": {
"version": "7.26.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.0.tgz",
"integrity": "sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g==",
"version": "7.26.2",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
"integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
"license": "MIT",
"dependencies": {
"@babel/helper-validator-identifier": "^7.25.9",
@ -257,9 +257,9 @@
}
},
"node_modules/@babel/compat-data": {
"version": "7.26.0",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.0.tgz",
"integrity": "sha512-qETICbZSLe7uXv9VE8T/RWOdIE5qqyTucOt4zLYMafj2MRO271VGgLd4RACJMeBO37UPWhXiKMBk7YlJ0fOzQA==",
"version": "7.26.2",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.2.tgz",
"integrity": "sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@ -305,12 +305,12 @@
}
},
"node_modules/@babel/generator": {
"version": "7.26.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.0.tgz",
"integrity": "sha512-/AIkAmInnWwgEAJGQr9vY0c66Mj6kjkE2ZPB1PurTRaRAh3U+J45sAQMjQDJdh4WbR3l0x5xkimXBKyBXXAu2w==",
"version": "7.26.2",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz",
"integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.26.0",
"@babel/parser": "^7.26.2",
"@babel/types": "^7.26.0",
"@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.25",
@ -437,9 +437,9 @@
}
},
"node_modules/@babel/parser": {
"version": "7.26.1",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.1.tgz",
"integrity": "sha512-reoQYNiAJreZNsJzyrDNzFQ+IQ5JFiIzAHJg9bn94S3l+4++J7RsIhNMoB+lgP/9tpmiAQqspv+xfdxTSzREOw==",
"version": "7.26.2",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz",
"integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==",
"license": "MIT",
"dependencies": {
"@babel/types": "^7.26.0"
@ -1653,40 +1653,6 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@libsql/client-wasm": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@libsql/client-wasm/-/client-wasm-0.14.0.tgz",
"integrity": "sha512-gB/jtz0xuwrqAHApBv9e9JSew2030Fhj2edyZ83InZ4yPj/Q2LTUlEhaspEYT0T0xsAGqPy38uGrmq/OGS+DdQ==",
"bundleDependencies": [
"@libsql/libsql-wasm-experimental"
],
"license": "MIT",
"peer": true,
"dependencies": {
"@libsql/core": "^0.14.0",
"@libsql/libsql-wasm-experimental": "^0.0.2",
"js-base64": "^3.7.5"
}
},
"node_modules/@libsql/client-wasm/node_modules/@libsql/libsql-wasm-experimental": {
"version": "0.0.2",
"inBundle": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"sqlite-wasm": "bin/index.js"
}
},
"node_modules/@libsql/core": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@libsql/core/-/core-0.14.0.tgz",
"integrity": "sha512-nhbuXf7GP3PSZgdCY2Ecj8vz187ptHlZQ0VRc751oB2C1W8jQUXKKklvt7t1LJiUTQBVJuadF628eUk+3cRi4Q==",
"license": "MIT",
"peer": true,
"dependencies": {
"js-base64": "^3.7.5"
}
},
"node_modules/@mapbox/node-pre-gyp": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
@ -2554,9 +2520,9 @@
}
},
"node_modules/@types/node": {
"version": "22.8.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.4.tgz",
"integrity": "sha512-SpNNxkftTJOPk0oN+y2bIqurEXHTA2AOZ3EJDDKeJ5VzkvvORSvmQXGQarcOzWV1ac7DCaPBEdMDxBsM+d8jWw==",
"version": "22.8.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.6.tgz",
"integrity": "sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==",
"devOptional": true,
"license": "MIT",
"dependencies": {
@ -2930,23 +2896,23 @@
}
},
"node_modules/astro": {
"version": "4.16.7",
"resolved": "https://registry.npmjs.org/astro/-/astro-4.16.7.tgz",
"integrity": "sha512-nON+8MUEkWTFwXbS4zsQIq4t0Fs42eulM4x236AL+qNnWfqNAOOqAnFxO1dxfJ1q+XopIBbbT9Mtev+0zH47PQ==",
"version": "4.16.8",
"resolved": "https://registry.npmjs.org/astro/-/astro-4.16.8.tgz",
"integrity": "sha512-BRWFP0UQ8gkOr90KQW7oooedtgCk/j91pyv1WQUmgZwMUZk/v0HJRiddAZgvGCECOnmZFc9ZqRZnBsAMUgApNQ==",
"license": "MIT",
"dependencies": {
"@astrojs/compiler": "^2.10.3",
"@astrojs/internal-helpers": "0.4.1",
"@astrojs/markdown-remark": "5.3.0",
"@astrojs/telemetry": "3.1.0",
"@babel/core": "^7.25.8",
"@babel/plugin-transform-react-jsx": "^7.25.7",
"@babel/types": "^7.25.8",
"@babel/core": "^7.26.0",
"@babel/plugin-transform-react-jsx": "^7.25.9",
"@babel/types": "^7.26.0",
"@oslojs/encoding": "^1.1.0",
"@rollup/pluginutils": "^5.1.2",
"@rollup/pluginutils": "^5.1.3",
"@types/babel__core": "^7.20.5",
"@types/cookie": "^0.6.0",
"acorn": "^8.13.0",
"acorn": "^8.14.0",
"aria-query": "^5.3.2",
"axobject-query": "^4.1.0",
"boxen": "8.0.1",
@ -2984,18 +2950,18 @@
"prompts": "^2.4.2",
"rehype": "^13.0.2",
"semver": "^7.6.3",
"shiki": "^1.22.0",
"shiki": "^1.22.2",
"tinyexec": "^0.3.1",
"tsconfck": "^3.1.4",
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.3",
"vite": "^5.4.9",
"vite": "^5.4.10",
"vitefu": "^1.0.3",
"which-pm": "^3.0.0",
"xxhash-wasm": "^1.0.2",
"yargs-parser": "^21.1.1",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.3",
"zod-to-json-schema": "^3.23.5",
"zod-to-ts": "^1.2.0"
},
"bin": {
@ -3304,9 +3270,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001675",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001675.tgz",
"integrity": "sha512-/wV1bQwPrkLiQMjaJF5yUMVM/VdRPOCU8QZ+PmG6uW6DvYSrNY1bpwHI/3mOcUosLaJCzYDi5o91IQB51ft6cg==",
"version": "1.0.30001676",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001676.tgz",
"integrity": "sha512-Qz6zwGCiPghQXGJvgQAem79esjitvJ+CxSbSQkW9H/UX5hg8XM88d4lp2W+MEQ81j+Hip58Il+jGVdazk1z9cw==",
"funding": [
{
"type": "opencollective",
@ -3796,14 +3762,14 @@
"license": "MIT"
},
"node_modules/drizzle-orm": {
"version": "0.35.3",
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.35.3.tgz",
"integrity": "sha512-Uv6N+b36x4BaZlxc96e+ag7RnMapBLGhc4SSi2F7RDwqYJipWjaU/P68RUp1FbW9r+mxoDp8nMz2Eece8PJxfA==",
"version": "0.36.0",
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.36.0.tgz",
"integrity": "sha512-6BETYPdKSR7cDHC0ZfqZk2VrKJ8n/Rfd3ajFPsAbc69gi87nwZ6oBA2wUGMELHA0tQE4kUKN0Ds00LUZQ6Z69A==",
"license": "Apache-2.0",
"peerDependencies": {
"@aws-sdk/client-rds-data": ">=3",
"@cloudflare/workers-types": ">=3",
"@electric-sql/pglite": ">=0.1.1",
"@electric-sql/pglite": ">=0.2.0",
"@libsql/client": ">=0.10.0",
"@libsql/client-wasm": ">=0.10.0",
"@neondatabase/serverless": ">=0.1",
@ -3843,6 +3809,9 @@
"@libsql/client": {
"optional": true
},
"@libsql/client-wasm": {
"optional": true
},
"@neondatabase/serverless": {
"optional": true
},
@ -3934,9 +3903,9 @@
"license": "MIT"
},
"node_modules/electron-to-chromium": {
"version": "1.5.49",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz",
"integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==",
"version": "1.5.50",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.50.tgz",
"integrity": "sha512-eMVObiUQ2LdgeO1F/ySTXsvqvxb6ZH2zPGaMYsWzRDdOddUa77tdmI0ltg+L16UpbWdhPmuF3wIQYyQq65WfZw==",
"license": "ISC"
},
"node_modules/emmet": {
@ -5142,13 +5111,6 @@
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/js-base64": {
"version": "3.7.7",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz",
"integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==",
"license": "BSD-3-Clause",
"peer": true
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -7983,9 +7945,9 @@
}
},
"node_modules/rimraf/node_modules/lru-cache": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz",
"integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==",
"version": "11.0.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz",
"integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==",
"dev": true,
"license": "ISC",
"engines": {
@ -8577,9 +8539,9 @@
}
},
"node_modules/tslib": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz",
"integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==",
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"dev": true,
"license": "0BSD",
"optional": true

View File

@ -42,11 +42,11 @@
]
},
"dependencies": {
"@astrojs/mdx": "^3.1.8",
"@astrojs/mdx": "^3.1.9",
"@astrojs/rss": "^4.0.9",
"@zeabur/astro-adapter": "^1.0.6",
"astro": "^4.16.7",
"drizzle-orm": "^0.35.3",
"astro": "^4.16.8",
"drizzle-orm": "^0.36.0",
"fuse.js": "^7.0.0",
"lodash": "^4.17.21",
"luxon": "^3.5.0",
@ -61,7 +61,7 @@
"@napi-rs/canvas": "^0.1.59",
"@types/lodash": "^4.17.13",
"@types/luxon": "^3.4.2",
"@types/node": "^22.8.4",
"@types/node": "^22.8.6",
"@types/pg": "^8.11.10",
"@types/qrcode-svg": "^1.1.5",
"@types/unist": "^3.0.3",

View File

@ -75,7 +75,6 @@ for (const p of ps) {
artist: p.dataset.artist,
url: p.dataset.url,
cover: p.dataset.cover,
lrc: p.dataset.lrc,
theme: '#ebd0c2',
},
],

View File

@ -3,14 +3,14 @@ import { resolveSong, type MusicPlayerProps } from '@/components/player/resolver
interface Props extends MusicPlayerProps {}
const { name, artist, url, pic, lrc } = await resolveSong(Astro.props);
const { name, artist, url, pic } = await resolveSong(Astro.props);
---
{
url === '' ? (
<p>歌曲加载失败</p>
) : (
<div class="aplayer" data-name={name} data-artist={artist} data-url={url} data-cover={pic} data-lrc={lrc}>
<div class="aplayer" data-name={name} data-artist={artist} data-url={url} data-cover={pic}>
音乐正在加载中 ...
</div>
)

View File

@ -1,21 +0,0 @@
import { request } from './util.js';
export const get_lyric = async (id, cookie) => {
// query.cookie.os = 'ios'
const data = {
id: id,
tv: -1,
lv: -1,
rv: -1,
kv: -1,
};
const res = await request('POST', 'https://music.163.com/api/song/lyric?_nmclfl=1', data, {
crypto: 'api',
});
return {
lyric: res.lrc?.lyric || '',
tlyric: res.tlyric?.lyric || '',
};
};

View File

@ -1,12 +1,10 @@
import { get_lyric } from './netease/lyric';
import { get_song_info, get_song_url } from './netease/song';
import { get_song_info, get_song_url } from '@/components/player/netease/song';
export type Song = {
name: string;
artist: string;
url: string;
pic: string;
lrc: string;
};
// The props for music player. We support both netease music and direct linked music.
@ -15,7 +13,7 @@ export interface MusicPlayerProps {
song?: Song;
}
const emptySong = { name: '', artist: '', url: '', pic: '', lrc: '' };
const emptySong = { name: '', artist: '', url: '', pic: '' };
const song = async (props: MusicPlayerProps): Promise<Song> => {
const { netease, song } = props;
@ -23,10 +21,9 @@ const song = async (props: MusicPlayerProps): Promise<Song> => {
if (netease) {
const info = await get_song_info(netease);
const url = await get_song_url(netease);
const lrc = await get_lyric(netease);
// Check the return result.
return { name: info[0].title, artist: info[0].author, url: url, pic: info[0].pic, lrc: lrc.lyric };
return { name: info[0].title, artist: info[0].author, url: url, pic: info[0].pic };
}
if (song) {