-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (59 loc) · 3.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>av-BV</title>
<style>
.d{
margin:48px 12px;
}
.d_a{
/*text-decoration:none;*/
color:#00aa66;
}
.d_b{
height:24px;
}
.d_d_tc{
float:left;
width:24px;
height:96px;
}
.d_p{
padding-left: 24px;
}
</style>
</head>
<body style="width:768px;">
<div class="d">
<h3>示例</h3><div class="d_d_tc"></div>
<a id="sl_a" class="d_a">示例</a> <- 可将此类文本拖到书签栏,以实现快速使用<br/><br/>
<input type="button" class="d_fb" value="复制" onclick="b_复制(sl_b)"> <- 若不能拖到书签栏,可点击复制并手动添加到书签<br/>
<textarea readonly="" id="sl_b" class="d_b">javascript:(function(){alert('这是一个示例')})()</textarea> <- 若不能点击复制,可手动复制文本框中的内容并添加到书签
<p class="d_p" style="white-space:nowrap;">说明文本</p>
</div>
<div class="d">
<h3>BV号转为av号</h3><div class="d_d_tc"></div>
<a id="ba_a" class="d_a">BV->av</a><br/><br/>
<input type="button" class="d_fb" value="复制" onclick="b_复制(ba_b)"><br/>
<textarea readonly="" id="ba_b" class="d_b">javascript:(function(){var aid=0;var x;try{if(typeof bvid=='string')x=bvid;else ah1}catch{x=prompt('输入BV号')}if(x){if(x.length!=12){if(x.length==10)x='BV'+x;else return 0}/*算法原作者:mcfx,有删改 https://www.zhihu.com/question/381784377/answer/1099438784 */r=0;for(i=0;i<6;i++)r+={'f':0,'Z':1,'o':2,'d':3,'R':4,'9':5,'X':6,'Q':7,'D':8,'S':9,'U':10,'m':11,'2':12,'1':13,'y':14,'C':15,'k':16,'r':17,'6':18,'z':19,'B':20,'q':21,'i':22,'v':23,'e':24,'Y':25,'a':26,'h':27,'8':28,'b':29,'t':30,'4':31,'x':32,'s':33,'W':34,'p':35,'H':36,'n':37,'J':38,'E':39,'7':40,'j':41,'L':42,'5':43,'V':44,'G':45,'3':46,'g':47,'u':48,'M':49,'T':50,'K':51,'N':52,'P':53,'A':54,'w':55,'c':56,'F':57}[x[[11,10,3,8,4,6][i]]]*58**i;aid=(r-8728348608)^177451812}if(aid&&confirm(aid)){window.open('javascript:window.name;','<script>location.replace("'+'https://www.bilibili.com/av'+aid+'")<\/script>')}})()</textarea>
<p class="d_p">在b站视频播放页打开,可提示其av号,点击 确定 可跳转到该视频av号的播放页.<br/>在其他地方打开,可输入BV号,点击 确定 可提示其av号,再点击 确定 可跳转到该视频av号的播放页</p>
</div>
<div class="d">
<h3>av号转为BV号</h3><div class="d_d_tc"></div>
<a id="ab_a" class="d_a">av->BV</a><br/><br/>
<input type="button" class="d_fb" value="复制" onclick="b_复制(ab_b)"><br/>
<textarea readonly="" id="ab_b" class="d_b">javascript:(function(){var bvid=0;var x;try{if(typeof aid=='string')x=aid;else ah1}catch{x=prompt('输入av号')}if(x){if(typeof x=='string'){if(x.substr(0,2)=='av'||x.substr(0,2)=='AV')if(parseInt(x.substr(2)))x=parseInt(x.substr(2));}/*算法原作者:mcfx,有删改 https://www.zhihu.com/question/381784377/answer/1099438784 */x=(x^177451812)+8728348608;r=['B','V','1',' ',' ','4',' ','1',' ','7',' ',' '];for(i=0;i<6;i++)r[[11,10,3,8,4,6][i]]='fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF'[parseInt(x/58**i%2558/*%要换成%25*/)];bvid=r.join('')}if(bvid&&confirm(bvid)){window.open('javascript:window.name;','<script>location.replace("'+'https://www.bilibili.com/'+bvid+'")<\/script>')}})()</textarea>
<p class="d_p">在b站视频播放页打开,可提示其BV号,点击 确定 可跳转到该视频BV号的播放页.<br/>在其他地方打开,可输入av号,点击 确定 可提示其BV号,再点击 确定 可跳转到该视频BV号的播放页</p>
</div>
<script>
sl_a.href=sl_b.value
ba_a.href=ba_b.value
ab_a.href=ab_b.value
function b_复制(id){
id.select();
document.execCommand('copy');
alert('复制成功');
}
</script>
</body>
</html>