mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +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();
|
||||
|
||||
const lyricSections = $('div[class^=Lyrics__Container]')
|
||||
.map((_, e) => $(e).text())
|
||||
const lyricSections = $('div[data-lyrics-container="true"]')
|
||||
.map((_, e) => {
|
||||
$(e).find('[data-exclude-from-selection="true"]').remove();
|
||||
return $(e).text();
|
||||
})
|
||||
.toArray()
|
||||
.join('\n');
|
||||
return lyricSections;
|
||||
|
|
@ -204,7 +207,7 @@ async function getSongId(
|
|||
return {
|
||||
artist: hit.artist_names,
|
||||
id: hit.url,
|
||||
name: hit.full_title,
|
||||
name: hit.title,
|
||||
source: LyricSource.GENIUS,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue