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
02f5d35c57
commit
9b2fec0646
1 changed files with 3 additions and 1 deletions
|
@ -466,7 +466,9 @@ export default {
|
|||
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=");
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue