批量取关UP主
把要取关的up主移动到一个分组,F12打开开发者工具,点击Console,复制粘贴下面的代码,回车就可以批量取关了。
$(".be-pager-next:contains('下一页')").click();$(".be-dropdown-item:contains('取消关注')").click();
删除全部动态
打开个人动态页,F12打开开发者工具,点击Console,复制粘贴下面的代码,回车就可以删除全部动态了。
document.cookie+=";";
var uid = document.cookie.match(/(?<=DedeUserID=).+?(?=;)/)[0];
$.ajax({
url: "//api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=" + uid + "&type=268435455",
type: "get",
xhrFields: {
withCredentials: true
},
success: function (res) {
var cards = res.data.cards;
var csrf_token = document.cookie.match(/(?<=bili_jct=).+?(?=;)/)[0];
for (var i = 0; i < cards.length; i++) {
if (cards[i].desc.uid == uid) {
$.ajax({
url: '//api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic',
type: "post",
xhrFields: {
withCredentials: true
},
data: {
'dynamic_id': cards[i].desc.dynamic_id_str,
'csrf_token': csrf_token
}
});
}
}
}
});
批量删除粉丝
打开粉丝页,F12打开开发者工具,点击Console,复制粘贴下面的代码,回车就可以自动删除粉丝了,不过会很慢,粉丝多的话要删很久。
var count=0;a=function(){$(".be-dropdown-item").each(function(a,b){ if("移除粉丝"==b.innerHTML) {b.click();return false;}})};b=function(){$(".modal").each(function(a,b){$c=$(b).find(".modal-title");if($c[0].innerText=="确认移除粉丝"){console.log("正在删除粉丝:"+$(b).find("em").get(0).innerText);$(b).find(".btn-content").get(0).click()}});};function timeout(){setTimeout(function(){if(count%2==0){a();}else{b();};count++;timeout();}, 2100);};timeout();
取消全部关注
unfollow_by_id = (id) => {
let unfollow_data = {
'fid': id,
'act': 2,
're_src': 11,
'jsonp': 'jsonp',
'csrf': getCookie('bili_jct'),
}
let form_data = new URLSearchParams();
for(let key in unfollow_data) {
form_data.append(key, unfollow_data[key]);
}
fetch('https://api.bilibili.com/x/relation/modify', {
method: 'POST',
body: form_data.toString(),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json, text/plain, */*',
},
credentials: 'include'
}).then(res => {
if(res.ok) {
return res.json();
}else {
throw new Error(`Error: ${res.status} ${res.statusText}`);
}
}).then(result => {
if(result.code === 0) {
console.log('取关成功');
}else {
throw new Error(`未知错误: ${JSON.stringify(result)}`);
}
}).catch(error => {
console.log(error);
})
}
unfollowing = (following_users) => {
if(following_users.length === 0) {
console.log('全部取关成功');
return;
}
unfollow_by_id(following_users.pop())
setTimeout(unfollowing, 1500, following_users)
}
let following_users = [];
fetch_following = (pn) => {
let fetch_following_data = {
'vmid': _bili_space_mid,
'pn': pn,
'ps': 50,
'order': 'desc',
}
fetch('https://api.bilibili.com/x/relation/followings?' + new URLSearchParams(fetch_following_data),
{
method: 'GET',
credentials: 'include',
})
.then(res => {
if(res.ok) {
return res.json();
}else {
throw new Error(`Error: ${res.status} ${res.statusText}`);
}
}).then(data => {
if(data && data.data && data.data.list) {
let following_list = data.data.list;
for(let user of following_list) {
let mid = user.mid;
following_users.push(mid);
}
if(following_list.length > 0) {
fetch_following(pn + 1);
}else {
if(following_users.length === 0) {
console.log('你没有关注任何人');
return;
}
unfollowing(following_users);
}
}else {
throw new Error(`未知错误: ${JSON.stringify(data)}`)
}
}).catch(error => {
console.log(error);
})
}
main = () => {
fetch_following(1);
}
main();
删除抽奖动态 删除转发动态 取消全部关注
安装油猴插件,再安装一个脚本就可以了。
油猴插件下载地址https://www.tampermonkey.net/
脚本下载地址https://greasyfork.org/zh-CN/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。
https://www.bilibili.com/read/cv4787009/
出处: bilibili