调用接口实现,快速还原BV为AV号,现在替换BILIBILI视频网页链接中的BV号为AV号依旧可以访问。
官方接口:https://api.bilibili.com/x/web-interface/archive/stat?bvid=
新建index.html文件并放入下面的代码:
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8">
<meta name="Author" content="Noah">
<meta name="Keywords" content="">
<meta name="Description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<title>BV号还原AV号 - 利熙网络</title>
<link rel="shortcut icon" href="./favicon.ico">
<style type="text/css">
@font-face {
font-family: "iconfont";
src: url('//at.alicdn.com/t/font_1706200_3sgw4esvyq9.eot?t=1584846914425');
/* IE9 */
src: url('//at.alicdn.com/t/font_1706200_3sgw4esvyq9.eot?t=1584846914425#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAPcAAsAAAAACEAAAAOQAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDMgqDVIMaATYCJAMUCwwABCAFhG0HUhswBxEVnPHIfiZkcgn7O+8oo66bEbK2OpSJxjfBA+X1vslMtll8iBW0KuzdSry1J/JGpwASAA0EaO7O95urXT4WOkKV5Nojj7b4hwrpy2SO/v97p78xLfvYuvYslzWHLex8DDAOpEDHnGQljg3TC+cUPEjbIQAHqRRD1GvQzI2BgvQTgBjYr083jJQNVcMRGEZbyVSVKhajY2hztCvAIv178YYywgANXUJ2atW7fk9qmZi1ZMCSjnILC8fbDUAHJFAMUCCGl/oGIm2uGBKHP1RRC3BgoKGZmLxVUbOWZcWqHRkc9A8PBBKFBsIGKXUBUAvlFZhwBAGmhiDBLIqgwKyVRwPuKwAOWAjCWUxL9mpIWOWKcikVmuwiF0+49sx9/bnn5gvfDdO/at6eQHTP5dHLd8Z6V67btSPG061Q523w0S5OzYETx4QbT9zXbnmuP/bdvOsL9lwR2D031utePndvMM7nXRncNy/G4xvlEveE69fc4Tdu+AbcnOdxa4E98/bFyZV75+5WxGRRnfY0cEulpaqbVCzNtxTEU1P1m2J4tFGwJ7VcytpevcrWOXd44oCjAyZu3DXRvQxryi09PV2/BcVQIlRxZPWvAFhMXkb1qQ3bHPFvOVXxWI1TjTLPFjtT5smFsAtxVqK82CcvekwcsbMOHDh4wOBxYw4eZI+NVR+A6Vmx4bGz1ZI0XFw1r0mlXm20lW5RpWd+s0u/ijYZwarmHJsZVi+tXKjMlU2rm186Hlk6tFxaPfwAWLPk3380K2u4Qm6xtmaprTL4b/dj0Nu/F+qwat8MpwLgzvpfdbSsPbbVBj9Ijy//kxa1tAb7qAqUxK4rT8490qpVpxGATiESBDT4aTX/LxTJg3H0MbPIZMAgJgaNIqSAxCCbpGjFQMdJObBhUBMcFKXhbCdRDEcilB0oZAYAQTiHQCOU4yAJ5ypJ0e6DTizvwEa4kODAK6KWdJIrLP1uHgWtYqDuj3zPi2FOvTHlb7BpaiWp1NwvSPRJKrMiW3zFAhljRPy2laohIzzTC9gN08S0Cgf0mjnV9ZLnpuxDWc/z5oZHQasYqPsj3/NiZGO9yX3/DTZNrdQQ+qJfkOjbpzIrWpBedUsrwrXcEr9tpWrICM/0AjyYaI5pLe8U0GvmemTWS47qmba6bH7D/IybAAdkZV1oQgoldGHjYViCYPl3WKxb86g+On/sE/+kc/CLtS1vNg==') format('woff2'),
url('//at.alicdn.com/t/font_1706200_3sgw4esvyq9.woff?t=1584846914425') format('woff'),
url('//at.alicdn.com/t/font_1706200_3sgw4esvyq9.ttf?t=1584846914425') format('truetype'),
/* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_1706200_3sgw4esvyq9.svg?t=1584846914425#iconfont') format('svg');
/* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-querenzhengque:before {
content: "\e600";
}
.icon-tishi:before {
content: "\e640";
}
.icon-cuowu:before {
content: "\e602";
}
.icon-jinggao:before {
content: "\e62b";
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-weight: 300;
}
body {
font-family: "Source Sans Pro", sans-serif;
color: white;
font-weight: 300;
}
body ::-webkit-input-placeholder {
/* WebKit browsers */
font-family: "Source Sans Pro", sans-serif;
color: white;
font-weight: 300;
}
body :-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
font-family: "Source Sans Pro", sans-serif;
color: white;
opacity: 1;
font-weight: 300;
}
body ::-moz-placeholder {
/* Mozilla Firefox 19+ */
font-family: "Source Sans Pro", sans-serif;
color: white;
opacity: 1;
font-weight: 300;
}
body :-ms-input-placeholder {
/* Internet Explorer 10+ */
font-family: "Source Sans Pro", sans-serif;
color: white;
font-weight: 300;
}
.wrapper {
background: #0396FF;
background: -webkit-linear-gradient(top left, #0396FF 0%, #ABDCFF 100%);
background: -moz-linear-gradient(top left, #0396FF 0%, #ABDCFF 100%);
background: -o-linear-gradient(top left, #0396FF 0%, #ABDCFF 100%);
background: linear-gradient(to bottom right, #0396FF 0%, #ABDCFF 100%);
position: absolute;
/* top: 50%; */
left: 0;
width: 100%;
height: 100%;
/* margin-top: -200px; */
overflow: hidden;
}
.bg-container {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 400px;
margin-top: -200px;
overflow: hidden;
}
.wrapper.form-success .container h1 {
transform: translatey(85px);
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 80px 0;
height: 400px;
text-align: center;
}
.container h1 {
font-size: 40px;
transition-duration: 1s;
transition-timing-function: ease-in-put;
font-weight: 200;
}
form {
padding: 20px 0;
position: relative;
z-index: 2;
}
form input {
display: block;
appearance: none;
outline: 0;
border: 1px solid rgba(255, 255, 255, 0.4);
background-color: rgba(255, 255, 255, 0.2);
width: 250px;
border-radius: 3px;
padding: 10px 15px;
margin: 0 auto 10px auto;
display: block;
text-align: center;
font-size: 18px;
color: white;
transition-duration: 0.25s;
font-weight: 300;
}
form input:hover {
background-color: rgba(255, 255, 255, 0.4);
}
form input:focus {
background-color: white;
width: 300px;
color: #ABDCFF;
}
form button {
appearance: none;
outline: 0;
background-color: white;
border: 0;
padding: 10px 15px;
color: #ABDCFF;
border-radius: 3px;
width: 250px;
cursor: pointer;
font-size: 18px;
transition-duration: 0.25s;
}
form button:hover {
background-color: #f5f7f9;
}
.bg-bubbles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.bg-bubbles li {
position: absolute;
list-style: none;
display: block;
width: 40px;
height: 40px;
background-color: rgba(255, 255, 255, 0.15);
bottom: -160px;
-webkit-animation: square 25s infinite;
animation: square 25s infinite;
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
}
.bg-bubbles li:nth-child(1) {
left: 10%;
}
.bg-bubbles li:nth-child(2) {
left: 20%;
width: 80px;
height: 80px;
animation-delay: 2s;
animation-duration: 17s;
}
.bg-bubbles li:nth-child(3) {
left: 25%;
animation-delay: 4s;
}
.bg-bubbles li:nth-child(4) {
left: 40%;
width: 60px;
height: 60px;
animation-duration: 22s;
background-color: rgba(255, 255, 255, 0.25);
}
.bg-bubbles li:nth-child(5) {
left: 70%;
}
.bg-bubbles li:nth-child(6) {
left: 80%;
width: 120px;
height: 120px;
animation-delay: 3s;
background-color: rgba(255, 255, 255, 0.2);
}
.bg-bubbles li:nth-child(7) {
left: 32%;
width: 160px;
height: 160px;
animation-delay: 7s;
}
.bg-bubbles li:nth-child(8) {
left: 55%;
width: 20px;
height: 20px;
animation-delay: 15s;
animation-duration: 40s;
}
.bg-bubbles li:nth-child(9) {
left: 25%;
width: 10px;
height: 10px;
animation-delay: 2s;
animation-duration: 40s;
background-color: rgba(255, 255, 255, 0.3);
}
.bg-bubbles li:nth-child(10) {
left: 90%;
width: 160px;
height: 160px;
animation-delay: 11s;
}
@-webkit-keyframes square {
0% {
transform: translatey(0);
}
100% {
transform: translatey(-700px) rotate(600deg);
}
}
@keyframes square {
0% {
transform: translatey(0);
}
100% {
transform: translatey(-700px) rotate(600deg);
}
}
@media (max-width:500px) {
.container h1 {
font-size: 60px;
}
form input,
form button {
width: 500px;
}
}
</style>
</head>
<body>
<div id="all">
<div class="wrapper">
<div class="bg-container">
<div class="container">
<h1 style="margin: 0;" id="bar">Welcome</h1>
<form class="form" id="fm">
<input id="bvinput" type="text" placeholder="请填写blue video" value name="bv"/>
<input id="avinput" type="text" placeholder="给你变adult video" value name="av"/>
<button type="button" id="login-button">变变变</button><br/><br/>
<a id="tips">本网页套用官方接口,暂时不会失效。站点由利熙网络(liitk.com)免费提供</a>
</form>
</div>
</div>
<ul class="bg-bubbles">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
<script>
$("#login-button").click(function (event) { //少轻狂编写
event.preventDefault();
$("#bar").text("转变中")
$('#tips').fadeOut(500);
$('form').fadeOut(500);
$('.wrapper').addClass('form-success');
$.ajax({
url: 'https://danmu.u2sb.top/api/other/bilibili/queryaid/',
type: 'get',
dataType: "text",
crossDomain: true,
success: function (data) {
var rd = JSON.parse(data)
$('.wrapper').removeClass('form-success');
$("#bar").text("转变成功")
$('form').fadeIn(500);
$('#tips').fadeIn(500);
$("#avinput").val("av"+rd.data.aid)
$("#tips").attr("href","https://www.bilibili.com/video/"+"av"+rd.data.aid);
$("#tips").text("点击我打开AV号的视频链接")
},
error: function (error) {
alert(error)
},
data: {
bvid: $("#bvinput").val()
}
});
});
</script>
</body>
</html>
声明:本站文章原创有部分资源来源于网络,如无特殊说明或标注。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系 admin@liitk.com 进行删除处理!。
评论(0)