B站删除抽奖动态方法总结

F12 控制台
var needDelDeled = true,
delay = 1000,
scrolls = 800;
var w='', d='', r=0;
function getLuckyDraw(){
w.css("background-color","#f1c40f");
w = w.parents(".card");
w.css("background-color","#2ecc71");
w[w.length - 1].querySelectorAll(".child-button")[1].click();
setTimeout(clickDel,delay);
}
function getDel(){
d.css("background-color","#8e44ad");
d= d.parents(".card");
d.css("background-color","#2ecc71");
d[d.length - 1].querySelectorAll(".child-button")[1].click();
setTimeout(clickDel,delay);
}
function clickDel(){
//点删除
$(".popup-content-ctnr")[$(".popup-content-ctnr").length-2].querySelector(".bl-button").click();//点确定
r += scrolls;
$('html,body').animate({ scrollTop:r },30);
$(".fold-text").click()
$(".expand-btn").click();
w = $(".main-content").find('span[click-title="抽奖详情"]');
d = $(".main-content").find('.deleted-text');
if(d.length && needDelDeled)setTimeout(getDel,delay);
else setTimeout(getLuckyDraw,delay);
}
if(/dynamic/.test(window.location.href) && confirm("是不是要删除抽奖动态")){
r += scrolls;
$('html,body').animate({ scrollTop:r },30);
$(".fold-text").click()
$(".expand-btn").click();
w = $(".main-content").find('span[click-title="抽奖详情"]');//*互动抽奖内容定位
d = $(".main-content").find('.deleted-text');//*已删除内容定位
if(d.length && needDelDeled) setTimeout(getDel,delay);
else setTimeout(getLuckyDraw,delay);
}
百度油猴脚本
https://greasyfork.org/zh-TW/scripts/387046-%E6%8A%BD%E5%A5%96%E5%8A%A8%E6%80%81%E5%88%A0%E9%99%A4-%E5%8F%96%E5%85%B3
做个整理半天找,找到代码疯狂报错最后还自己写了一遍,真的呆呆,评论还吃代码
油猴脚本省多了,防止以后有s&b和我一样