-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
158 lines (139 loc) · 5.1 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!--
* @Description:
* @Author: Zhang Hao
* @Date: 2020-07-06 13:57:35
* @LastEditors: Zhang Hao
* @LastEditTime: 2020-08-06 22:03:49
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>抖音无水印下载解析</title>
<meta name="keywords" content="抖音,抖音无水印视频下载,抖音无水印,抖音下载,抖音视频下载,抖音无水印解析">
<meta name="Description " content="简单、便捷、功能强大的抖音无水印视频下载工具">
<meta name="author" content="mokevip">
<link rel="stylesheet" href="css/layui.css">
<link rel="manifest" href="manifest.json" />
<style>
body {
/*background-size: 100% 100%;*/
background-image: url("images/bg.png");
}
input[type=file] {
display: none;
}
button {
position: relative;
}
.layui-row div,
.layui-row button,
#by,
body {
margin-top: 10px;
}
#result {
display: none;
}
.layui-btn {
padding: 0;
}
@media only screen and (min-width: 700px) {
input[type=text] {
text-align: center;
}
}
.layui-layer-shade {
background: rgba(0,0,0,0.4)!important;
opacity: 1 !important;
}
</style>
</head>
<body>
<div class="content layui-container">
<div class="layui-row">
<h1 align="center">抖音无水印下载解析</h1>
<p id="by" class="layui-col-md8 layui-col-md-offset2 layui-col-xs12">Copyright © 2020 <a href="http://blog.mokevip.top">mokevip的个人博客</a></p>
</div>
<hr>
<div class="layui-row">
<div class="layui-col-md8 layui-col-md-offset2 layui-col-xs12">
<div class="layui-col-md12 layui-col-xs12">
<input type="text" placeholder="请粘贴抖音分享链接地址" id="url" class="AL layui-input url-input">
</div>
<button onclick="urlDecode(document.getElementById('url').value)" class="btn layui-btn layui-col-md12 layui-col-xs12">解析下载地址</button>
</div>
</div>
<div class="layui-row">
<div id="result" class="layui-col-md8 layui-col-md-offset2 layui-col-xs12">
<div class="layui-col-md9 layui-col-xs12">
<input type="text" placeholder="" id="resultText" class="AL layui-input url-input">
</div>
<button class="btn layui-btn layui-btn-normal layui-col-md3 layui-col-xs12" id="copy">点击复制视频下载地址</button>
</div>
</div>
<!-- js代码部分 -->
<script src="layui.js"></script>
<script src="js/jquery.min.js"></script>
<script>
if (navigator.serviceWorker != null) {
navigator.serviceWorker.register('sw.js')
.then(function(registration) {
console.log('Registered events at scope: ', registration.scope);
});
}
var cacheStorageKey = 'minimal-pwa-1'
var cacheList = [
'./layui.js',
'./js/jquery.min.js',
"./index.html",
"./css/layui.css",
"icon.png"
]
self.addEventListener('install', e => {
e.waitUntil(
caches.open(cacheStorageKey)
.then(cache => cache.addAll(cacheList))
.then(() => self.skipWaiting())
)
})
</script>
<script>
layui.use(['layer', 'form'], function() {
layer = layui.layer;
});
document.getElementById('url').addEventListener("input", function(e) {
var val = e.target.value;
if (/复制此链接/.test(val)) {
val = val.match(/https:\/\/.+?\/.+?\//)
e.target.value = val
}
})
function urlDecode(url) {
$.ajax({
url: "./api.php?url=" + url,
success: function(res) {
layer.closeAll();
$("#result").show();
$("#resultText").val(res)
layer.msg("生成成功!");
$("#copy").on("click", function() {
$("#resultText").select();
document.execCommand('copy');
layer.msg("复制成功!");
})
},
beforeSend:function(){
layer.load(1);
},
complate:function(){
layer.closeAll();
}
})
}
</script>
</body>
</html>