mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Update src/components/WatchVideo.vue
This commit is contained in:
parent
a861a8b95d
commit
c4b8824f68
1 changed files with 8 additions and 8 deletions
|
@ -462,14 +462,14 @@ export default {
|
||||||
this.channelId = this.video.uploaderUrl.split("/")[2];
|
this.channelId = this.video.uploaderUrl.split("/")[2];
|
||||||
if (!this.isEmbed) this.fetchSubscribedStatus();
|
if (!this.isEmbed) this.fetchSubscribedStatus();
|
||||||
|
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const xmlDoc = parser.parseFromString(this.video.description, "text/html");
|
const xmlDoc = parser.parseFromString(this.video.description, "text/html");
|
||||||
xmlDoc.querySelectorAll("a").forEach(elem => {
|
xmlDoc.querySelectorAll("a").forEach(elem => {
|
||||||
if (!elem.innerText.match(/(?:[\d]{1,2}:)?(?:[\d]{1,2}):(?:[\d]{1,2})/))
|
if (!elem.innerText.match(/(?:[\d]{1,2}:)?(?:[\d]{1,2}):(?:[\d]{1,2})/))
|
||||||
elem.outerHTML = elem.getAttribute("href");
|
elem.outerHTML = elem.getAttribute("href").replace(/https:\/\/www\.youtube\.com\/watch\?v=/, "/watch?v=");
|
||||||
});
|
});
|
||||||
xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n"));
|
xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n"));
|
||||||
this.video.description = rewriteDescription(xmlDoc.querySelector("body").innerHTML);
|
this.video.description = rewriteDescription(xmlDoc.querySelector("body").innerHTML);
|
||||||
this.updateWatched(this.video.relatedStreams);
|
this.updateWatched(this.video.relatedStreams);
|
||||||
|
|
||||||
this.fetchDeArrowContent(this.video.relatedStreams);
|
this.fetchDeArrowContent(this.video.relatedStreams);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue