Last active
August 30, 2017 03:16
-
-
Save ktaragorn/9c0d8fd8feffa73a4d6de4ee09c917d6 to your computer and use it in GitHub Desktop.
Copy Video Links from Youtube Watch Later
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 2 | |
// @grant none | |
// ==/UserScript== | |
function getUrls(){ | |
return JSON.stringify(Array.prototype.slice.call(document.querySelectorAll("a.ytd-playlist-video-renderer")).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.getElementById("title").innerHTML += '<a href="javascript:window.linkClick();">'+"Click to get all urls"+'</a>' | |
} | |
createLink(); |
Updated to new version of youtube UI
"Polymer version" version 1 can be used by adding &disable_polymer=true
to the url
This file is redundant. It is far simpler to move Watch later videos to a public playlist and directly download that via youtube-dl
since it handles playlists natively
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a user script wrapping https://gist.github.com/ktaragorn/a0ff7153a8eab6521fa49ac8276c9083