|
javascript: (function(){ |
|
let success = true; |
|
const interval = setInterval(function(){ |
|
const progress = 'contains(@style, "width: 100%;")' |
|
+ ' or contains(@style,"width: 99%;") or contains(@style,"width: 98%;")' |
|
+ ' or contains(@style,"width: 97%;") or contains(@style,"width: 96%;")' |
|
+ ' or contains(@style,"width: 95%;") or contains(@style,"width: 94%;")' |
|
+ ' or contains(@style,"width: 93%;") or contains(@style,"width: 92%;")' |
|
+ ' or contains(@style,"width: 91%;") or contains(@style,"width: 90%;")'; |
|
const menu = document.evaluate('//*[*[contains(@class,"ytd-thumbnail")]['+progress+']' |
|
+ ' or a[@id="video-title"][@title="[Private video]" or @title="[Deleted video]"]]' |
|
+ '/ancestor-or-self::div[@id="container"]/../../div[@id="menu"]//button[@id="button"]', |
|
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; |
|
if (menu == null) { return clearInterval(interval); } |
|
menu.click(); |
|
const remove = document.evaluate('//*[@slot="dropdown-content"]//*[@role="listbox"]' |
|
+ '//*[@role="menuitem"]//*[@role="option"]//span[contains(text(), "Remove from")]', |
|
document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; |
|
if (remove == null && !success) { return clearInterval(interval); } |
|
if (remove != null) { remove.click(); } |
|
success = remove != null; |
|
}, 1000); |
|
})(); |