From a77a600f31a03e76e49468ec050082c5d4181095 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sat, 5 Aug 2023 12:44:14 +0000 Subject: [PATCH] Update src/components/WatchVideo.vue --- src/components/WatchVideo.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index aa14c5af..943c6bdb 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -462,17 +462,17 @@ export default { this.channelId = this.video.uploaderUrl.split("/")[2]; if (!this.isEmbed) this.fetchSubscribedStatus(); - const parser = new DOMParser(); - const xmlDoc = parser.parseFromString(this.video.description, "text/html"); - xmlDoc.querySelectorAll("a").forEach(elem => { - if (!elem.innerText.match(/(?:[\d]{1,2}:)?(?:[\d]{1,2}):(?:[\d]{1,2})/)) - elem.outerHTML = elem - .getAttribute("href") - .replace(/https:\/\/www\.youtube\.com\/watch\?v=/, "/watch?v="); - }); - xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n")); - this.video.description = rewriteDescription(xmlDoc.querySelector("body").innerHTML); - this.updateWatched(this.video.relatedStreams); + const parser = new DOMParser(); + const xmlDoc = parser.parseFromString(this.video.description, "text/html"); + xmlDoc.querySelectorAll("a").forEach(elem => { + if (!elem.innerText.match(/(?:[\d]{1,2}:)?(?:[\d]{1,2}):(?:[\d]{1,2})/)) + elem.outerHTML = elem + .getAttribute("href") + .replace(/https:\/\/www\.youtube\.com\/watch\?v=/, "/watch?v="); + }); + xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n")); + this.video.description = rewriteDescription(xmlDoc.querySelector("body").innerHTML); + this.updateWatched(this.video.relatedStreams); this.fetchDeArrowContent(this.video.relatedStreams); }