Copy Video Links from Youtube Watch Later for later downloading
当前为
// ==UserScript==
// @name Copy Video Links from Youtube Watch Later
// @namespace ktaragorn
// @description Copy Video Links from Youtube Watch Later for later downloading
// @include https://www.youtube.com/playlist?list=WL
// @version 1
// @grant none
// ==/UserScript==
function getUrls(){
return JSON.stringify(Array.prototype.slice.call(document.querySelectorAll(".pl-video-title-link")).map(function(a){return a.href.replace(/&list=.*/g,'').replace(/&index=.*/g,'')}))
}
window.linkClick= function(){
if(confirm("Have you revealed all videos(click show more at the bottom)??")){
prompt("Copy to clipboard", getUrls());
alert("Now copy these videos to another playlist, delete from WL, delete the other playlist")
}
}
function createLink(){
document.getElementsByClassName("pl-header-content")[0].innerHTML += '<a href="javascript:window.linkClick();">'+"Click to get all urls"+'</a>'
}
createLink();