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
// this script copies a youtube playlist to the "watch later" list, so you can easily clone the | |
// list by creating a new one off the watch later list. You must run this on a playlist overview | |
// page like http://www.youtube.com/playlist?list=xxxxxxxxx | |
// this script is meant to be converted into a bookmarklet, using something like http://mrcoles.com/bookmarklet/ | |
// after conversion, it becomes this: | |
// javascript:(function()%7Bvar%20buttons%20%3D%20document.querySelectorAll(%22button.addto-watch-later-button%22)%3Bvar%20videos%20%3D%20document.querySelectorAll(%22.playlist-video-item%22)%3Bif%20(videos.length%20!%3D%20buttons.length)%20%7Balert(%22Some%20videos%20are%20already%20in%20watch%20later!%20Found%20%22%20%2B%20videos.length%20%2B%20%22%20videos%20but%20%22%20%2B%20buttons.length%20%2B%20%22%20buttons.%20Abort%20now.%22)%3B%7D%20else%20%7Bif%20(confirm(%22Add%20%22%20%2B%20buttons.length%20%2B%20%22%20videos%3F%22))%20%7Bvar%20dialog%20%3D%20document.createElement(%22h1%22)%3Bdialog.innerHTML%20%3D |