chore: remove NetEase lyrics fallback from Android and web
NetEase returned wrong/unsynced results. lrclib with exact + fuzzy search is sufficient; no third-party Chinese platform needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
eb5b0ea360
commit
0272b9e99f
2 files changed
+2
-68
No files matched your search
@@ -204,30 +204,6 @@ async function _loadNpLyrics(songId) {
|
||||
|
||||
if(token !== _lyricsLoadToken) return;
|
||||
|
||||
// NetEase fallback — good for Asian/Japanese music
|
||||
if(!result?.syncedLyrics && !result?.plainLyrics) {
|
||||
try {
|
||||
const q = encodeURIComponent(`${artist} ${title}`.trim());
|
||||
const sd = await safeJson(fetch(`https://music.163.com/api/search/get?s=${q}&type=1&limit=5`, {
|
||||
headers: { Referer: 'https://music.163.com' }, signal: SIG(),
|
||||
}));
|
||||
const songs = sd?.result?.songs || [];
|
||||
const durMs = dur * 1000;
|
||||
const song = dur
|
||||
? [...songs].sort((a, b) => Math.abs(a.duration - durMs) - Math.abs(b.duration - durMs))
|
||||
.find(s => Math.abs(s.duration - durMs) <= 5000)
|
||||
: songs[0];
|
||||
if(song && token === _lyricsLoadToken) {
|
||||
const ld = await safeJson(fetch(
|
||||
`https://music.163.com/api/song/lyric?id=${song.id}&lv=1&kv=1&tv=-1`,
|
||||
{ headers: { Referer: 'https://music.163.com' }, signal: SIG() },
|
||||
));
|
||||
const lrc = ld?.lrc?.lyric;
|
||||
if(lrc) result = { syncedLyrics: lrc };
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
if(token !== _lyricsLoadToken) return;
|
||||
_lyricsCache.set(cacheKey, result ?? null);
|
||||
content.innerHTML = '';
|
||||
|
||||
Reference in new issue
Block a user