mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
Remove unnecessary sections from Genius lyrics (#1154)
* remove unnecessary sections in genius lyrics * made variable names camelCase * used title instead of full title
This commit is contained in:
parent
ce1d37479c
commit
947cad451c
1 changed files with 6 additions and 3 deletions
|
|
@ -109,8 +109,11 @@ export async function getLyricsBySongId(url: string): Promise<null | string> {
|
||||||
|
|
||||||
if (lyricsDiv.length > 0) return lyricsDiv.text().trim();
|
if (lyricsDiv.length > 0) return lyricsDiv.text().trim();
|
||||||
|
|
||||||
const lyricSections = $('div[class^=Lyrics__Container]')
|
const lyricSections = $('div[data-lyrics-container="true"]')
|
||||||
.map((_, e) => $(e).text())
|
.map((_, e) => {
|
||||||
|
$(e).find('[data-exclude-from-selection="true"]').remove();
|
||||||
|
return $(e).text();
|
||||||
|
})
|
||||||
.toArray()
|
.toArray()
|
||||||
.join('\n');
|
.join('\n');
|
||||||
return lyricSections;
|
return lyricSections;
|
||||||
|
|
@ -204,7 +207,7 @@ async function getSongId(
|
||||||
return {
|
return {
|
||||||
artist: hit.artist_names,
|
artist: hit.artist_names,
|
||||||
id: hit.url,
|
id: hit.url,
|
||||||
name: hit.full_title,
|
name: hit.title,
|
||||||
source: LyricSource.GENIUS,
|
source: LyricSource.GENIUS,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue