Genius scraping working again

This commit is contained in:
James Barnsley
2020-01-22 16:19:57 +13:00
parent f33e37a1d1
commit f581d683bc
6 changed files with 13 additions and 15 deletions

View File

@ -157,11 +157,11 @@ export function getTrackLyrics(uri, path) {
(response, status, xhr) => {
dispatch(uiActions.stopLoading(loader_key));
if (response && response.result) {
const html = $('<div/>').html(response.result).contents();
const html = $(response.result);
let lyrics = html.find('.lyrics');
if (lyrics.length > 0) {
lyrics = lyrics.first();
lyrics.find('a').replaceWith(() => this.innerHTML);
lyrics.find('a').replaceWith((item) => item.innerHTML);
let lyrics_html = lyrics.html();
lyrics_html = lyrics_html.replace(/(\[)/g, '<span class="mid_grey-text">[');