Last active
August 9, 2025 12:41
-
Star
(477)
You must be signed in to star a gist -
Fork
(78)
You must be signed in to fork a gist
Revisions
-
astamicu renamed this gist
Nov 22, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
astamicu renamed this gist
Nov 22, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
astamicu revised this gist
Nov 22, 2022 . 1 changed file with 21 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,27 @@ UPDATED 22.11.2022 It's been two years since the last update, so here's the updated working script as per the comments below. Thanks to [BryanHaley](https://gist.github.com/BryanHaley) for this. ```javascript setInterval(function () { video = document.getElementsByTagName('ytd-playlist-video-renderer')[0]; video.querySelector('#primary button[aria-label="Action menu"]').click(); var things = document.evaluate( '//span[contains(text(),"Remove from")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); for (var i = 0; i < things.snapshotLength; i++) { things.snapshotItem(i).click(); } }, 500); ``` Non-english users will need to change "Action menu" and "Remove from" to what YouTube uses for their localization. -
astamicu revised this gist
Dec 3, 2020 . 1 changed file with 21 additions and 37 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,40 +1,24 @@ UPDATED 3.12.2020 The old version of youtube with "disable_polymer" is not working anymore, so the script also stopped working. Thanks to [JanTheDeveloper](https://gist.github.com/JanTheDeveloper) we have a new working script. Big up! I just changed the `'//span[contains(text(),"Watch later")]',` to `'//span[contains(text(),"Remove from")]',` and it should work for any playlist, not just the watch later one. (thanks to [hudsonite](https://gist.github.com/hudsonite) for the tip) ```javascript setInterval(function () { document.querySelector('#primary button[aria-label="Action menu"]').click(); var things = document.evaluate( '//span[contains(text(),"Remove from")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); for (var i = 0; i < things.snapshotLength; i++) { things.snapshotItem(i).click(); } }, 1000); ``` I moved the old working code to another [gist](https://gist.github.com/astamicu/e35e7088a8e1253863915ff1067fd6d0) -
astamicu revised this gist
Oct 17, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ UPDATE 17.10.2019 Only works on old youtube skin. //added "&disable_polymer=true" after playlist link Also, saw this now, there is a "remove watched" button. 1. Open [your watch later playlist](https://www.youtube.com/playlist?list=WL&disable_polymer=true) on youtube. -
astamicu revised this gist
Oct 17, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ UPDATE 17.10.2019 Only works on old youtube skin. //added "&disable_polymer=true" after playlist link Also, saw this now, there is a "remove watched" button. -
astamicu revised this gist
Oct 17, 2019 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,9 @@ UPDATE 17.10.2019 Only works on old youtube skin. //added "&disable_polymer=true" after playlist link Also, saw this now, there is a "remove watched" button. 1. Open [your watch later playlist](https://www.youtube.com/playlist?list=WL&disable_polymer=true) on youtube. 2. Open the development console for your browser ( Ctrl+Shift+J for chrome, Ctrl+Shift+K for firefox ) 3. paste this script into the console ``` javascript -
Ash revised this gist
Jul 3, 2017 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,24 +2,24 @@ 2. Open the development console for your browser ( Ctrl+Shift+J for chrome, Ctrl+Shift+K for firefox ) 3. paste this script into the console ``` javascript var interval = setInterval(removeOne, 30) // execute removeOne() every 30 milliseconds var lastNumVideos = 0 // the number of displayed videos in the last execution of removeOne() function removeOne () { var numVideos = document.querySelectorAll('.pl-video-edit-remove').length // number of videos displayed if (numVideos === lastNumVideos) { return // skip removal if the previously removed video is still present } if (numVideos < 1) { try { document.querySelector('.browse-items-load-more-button').click() // click load more if there are no displayed videos } catch (err) { console.log('Load More button is missing. Refresh the page and restart the script to remove more videos.') clearInterval(interval) // stop repeating removeOne() } } else { document.querySelector('.pl-video-edit-remove').click() // remove top most video lastNumVideos = numVideos } } -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,4 @@ function removeOne () { If you need to stop the script simply close or refresh the playlist's tab in your browser. I haven't tried, but this should work on other playlists as well. -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,18 +11,18 @@ function removeOne () { if (numVideos === lastNumVideos) { return } if (numVideos < 1) { try { document.querySelector('.browse-items-load-more-button').click() } catch (err) { console.log('Load More button is missing. Refresh the page and restart the script to remove more videos.') clearInterval(interval) } } else { document.querySelector('.pl-video-edit-remove').click() lastNumVideos = numVideos } } ``` 4. Press the enter key 5. Watch your watch later playlist empty in realtime :D -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ 2. Open the development console for your browser ( Ctrl+Shift+J for chrome, Ctrl+Shift+K for firefox ) 3. paste this script into the console ``` javascript var interval = setInterval(removeOne, 30) var lastNumVideos = 0 @@ -20,7 +20,7 @@ function removeOne () { } } document.querySelector('.pl-video-edit-remove').click() lastNumVideos = numVideos } ``` -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function removeOne () { 4. Press the enter key 5. Watch your watch later playlist empty in realtime :D If you need to stop the script simply close or refresh the playlist's tab in your browser. Enjoy! :D -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,4 @@ If you need to stop the script simply close or refresh the playlists's tab in yo Enjoy! :D I haven't tried, but this should work on other playlists as well. -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ function removeOne () { if (numVideos === lastNumVideos) { return } if (numVideos < 2) { try { document.querySelector('.browse-items-load-more-button').click() } catch (err) { -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 18 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,20 +2,27 @@ 2. Open the development console for your browser ( Ctrl+Shift+J for chrome, Ctrl+Shift+K for firefox ) 3. paste this script into the console ``` javascript var interval = setInterval(removeOne, 750) var lastNumVideos = 0 function removeOne () { var numVideos = document.querySelectorAll('.pl-video-edit-remove').length if (numVideos === lastNumVideos) { return } if (numVideos < 1) { try { document.querySelector('.browse-items-load-more-button').click() } catch (err) { console.log('Load More button is missing. Refresh the page and restart the script to remove more videos.') clearInterval(interval) } } document.querySelector('.pl-video-edit-remove').click() lastNum = numVideos } ``` 4. Press the enter key 5. Watch your watch later playlist empty in realtime :D -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,5 +24,6 @@ If you need to stop the script simply close or refresh the playlists's tab in yo Enjoy! :D I haven't tried, but this should work on other playlists as well. The script can be left open forever without flooding youtube with requests, it will just make lots of unnecessary DOM queries, which shouldn't be a real problem. -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,15 +5,15 @@ var lastNumVideos function removeOne() { var numVideos = document.querySelectorAll('.pl-video-edit-remove').length if (numVideos === lastNumVideos) { return } if (numVideos < 10) { document.querySelector('.browse-items-load-more-button').click() } document.querySelector('.pl-video-edit-remove').click() lastNum = numVideos } setInterval(removeOne, 30) ``` -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ 1. Open [your watch later playlist](https://www.youtube.com/playlist?list=WL) on youtube. 2. Open the development console for your browser ( Ctrl+Shift+J for chrome, Ctrl+Shift+K for firefox ) 3. paste this script into the console ``` javascript var lastNumVideos -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ function removeOne() { } if (numVideos < 10) { document.querySelector('.browse-items-load-more-button').click() } document.querySelector('.pl-video-edit-remove').click() lastNum = numVideos } -
Ash revised this gist
Jul 2, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,10 @@ function removeOne() { var numVideos = document.querySelectorAll('.pl-video-edit-remove').length if (numVideos === lastNumVideos) { return } if (numVideos < 10) { document.querySelector('.browse-items-load-more-button').click() } document.querySelector('.pl-video-edit-remove').click() lastNum = numVideos } -
Ash revised this gist
Jul 2, 2017 . No changes.There are no files selected for viewing
-
Ash created this gist
Jul 2, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ 1. Open [your watch later playlist](https://www.youtube.com/playlist?list=WL) on youtube. 2. Open the development console for your browser ( Ctrl+Shift+J for chrome ) 3. paste this script into the console ``` javascript var lastNumVideos function removeOne() { var numVideos = document.querySelectorAll('.pl-video-edit-remove').length if (numVideos === lastNumVideos) { return } if (numVideos < 10) { document.querySelector('.browse-items-load-more-button').click() } document.querySelector('.pl-video-edit-remove').click() lastNum = numVideos } setInterval(removeOne, 30) ``` 4. Press the enter key 5. Watch your watch later playlist empty in realtime :D If you need to stop the script simply close or refresh the playlists's tab in your browser. Enjoy! :D The script can be left open forever without flooding youtube with requests, it will just make lots of unnecessary DOM queries, which shouldn't be a real problem.