From 09a0c05dc8a52c7adf35d1ee3117b72021674b06 Mon Sep 17 00:00:00 2001 From: Shiny Nematoda Date: Sun, 26 Nov 2023 06:52:59 +0000 Subject: [PATCH] unescape ampersand for hls url (fixes #153) --- src/stores/player.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stores/player.js b/src/stores/player.js index 64cef81..da2b16a 100644 --- a/src/stores/player.js +++ b/src/stores/player.js @@ -22,15 +22,16 @@ export const useData = defineStore('data', () => { async function getSong(e) { const hash = new URLSearchParams(e.substring(e.indexOf('?'))).get('v'), - json = await getJsonPiped('/streams/' + hash); + json = await getJsonPiped('/streams/' + hash), + unamp = txt => txt.replace(AMP, '&'); - state.art = json.thumbnailUrl.replace(AMP, '&'); + state.art = unamp(json.thumbnailUrl); state.description = json.description; - state.title = json.title.replace(AMP, '&'); - state.artist = json.uploader.replace(' - Topic', '').replace(AMP, '&'); + state.title = unamp(json.title); + state.artist = unamp(json.uploader.replace(' - Topic', '')); state.artistUrl = json.uploaderUrl; player.state.duration = json.duration; - player.state.hls = json.hls; + player.state.hls = unamp(json.hls); player.state.streams = json.audioStreams; state.url = e;