forked from mengzonefire/baidupan-rapidupload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
143 lines (137 loc) · 6.44 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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
<title>百度网盘秒传链接转存</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/5.0.2/css/bootstrap.min.css" />
<meta name="description" content="百度网盘秒传链接在线转存/生成/转换,支持iOS/Android/PC and more" />
<script src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/5.0.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./common/Tools.js?version=0.8"></script>
<script type="text/javascript">
function inital() {
document.getElementById("savePath").value = localStorage.getItem("Blink_savePath");
checkUpdate();
}
function submitLink() {
var savePath = document.getElementById("savePath").value;
if (!checkPath(savePath)) return;
if (savePath.charAt(savePath.length - 1) !== "/") savePath += "/"; // 补全路径结尾的 "/"
var api = $('#api input:radio:checked').val();
var data = DuParser.parse(document.getElementById("link").value);
if (!data.length) alert("未检测到有效的秒传链接");
else if (data.length !== 1) alert('含多个链接,请使用批量转存');
else {
data = data[0];
if (api === "api1")
saveFile(
data.md5,
data.md5s,
data.size,
savePath + data.path
);
else if (api === "api2")
saveFile2(
data.md5,
data.size,
savePath + data.path
);
}
}
function submitData() {
var savePath = document.getElementById("savePath").value;
if (savePath.charAt(savePath.length - 1) !== "/") savePath += "/";
var api = $('#api input:radio:checked').val();
if (api === "api1")
saveFile(
document.getElementById("md5").value,
document.getElementById("md5s").value,
document.getElementById("size").value,
savePath + document.getElementById("path").value
);
else if (api === "api2")
saveFile2(
document.getElementById("md5").value,
document.getElementById("size").value,
savePath + document.getElementById("path").value
);
}
window.addEventListener("DOMContentLoaded", inital);
</script>
</head>
<body>
<div id="app">
<div id="container" class="container">
<div class="row">
<div class="col-sm-8 offset-sm-2 col-md-6 offset-md-3 text-center">
<h1>百度网盘秒传链接转存</h1>
<p id="version">v0.8 mengzonefire version</p>
<p><b>请先阅读 <a href='./manual.html' target=_blank>使用教程</b></a></br></p>
<p><a href='./multisave.html'>批量转存</a> <a href='./gen.html'>秒传生成</a> <a href='./convert.html'>秒传转换</a></p>
</div>
<div class="col-sm-8 offset-sm-2 col-md-6 offset-md-3 text-center">
<p>若转存显示 {"errno":-6,"request_id":...}:</p>
<p>请在此浏览器<b>打开或刷新</b><a href='https://pan.baidu.com/' target=_blank>度盘页面</a>(若未登陆请登陆)再重试</p>
<p>若转存显示 {"errno":-6} 或 {"errno":2,"request_id":...}:</p>
<p>请更换浏览器<b>(chrome/edge/火狐/安卓kiwi)</b></p>
</div>
<div id="body" class="col-sm-8 offset-sm-2 col-md-6 offset-md-3 text-center">
<div id="api">
<p>秒传转存接口:
<label class="checkbox-inline" style="cursor:pointer; margin-left: 10px;">
<input type="radio" name="inlineRadioOptions" value="api1" checked> 常规接口
</label>
<label class="checkbox-inline" style="cursor:pointer; margin-left: 6px;">
<input type="radio" name="inlineRadioOptions" value="api2"> 备用接口
(常规接口显示404时使用)</label>
</p>
</div>
<div>
<label for="savePath">转存路径</label>
<p><input name="savePath" class="form-control" id="savePath"
placeholder='不能含有字符\":*?<>|, 示例: /GTA5/, 留空保存在根目录'></p>
</div>
<div>
<label for="link">秒传链接</label>
<p><input name="link" id="link" class="form-control"
placeholder="bdpan... / BaiduPCS-Go ... / 5b1...#b3a... "></p>
</div>
<p><button onclick="submitLink()" class="btn btn-primary">解析链接并转存</button>
</p>
<a data-toggle="collapse" data-parent="#body" href="#collapseOne">
<p>手动输入文件属性</p>
</a>
<div id="collapseOne" class="panel-collapse collapse in">
<div>
<label>文件名</label>
<input name="path" class="form-control" id="path" placeholder="/数理化.doc">
</div>
<div>
<label>文件大小</label>
<input name="size" class="form-control" id="size" placeholder="1710630793">
</div>
<div>
<label>文件MD5</label>
<input name="md5" class="form-control" id="md5" placeholder="b3a90c47ea23b00aad062a09e33d6ce7">
</div>
<div>
<label>前256KB分片MD5</label>
<input name="md5s" class="form-control" id="md5s" placeholder="5b1cfe5072aabc737e6facce6d1c3be8">
</div>
</br>
<p><button onclick="submitData()" class="btn btn-primary">转存</button></p>
</div>
<p>转存弹窗显示的"errno"(错误码)的对应提示:</br>{"errno":2}(常规接口): 浏览器不兼容/单文件大小超过20G(请使用备用接口)</br>{"errno":404}(常规接口)
{"errno":31190}(备用接口)
为秒传无效</br>{"errno":-8}
为路径下存在同名文件/文件夹</br>{"errno":-7} 为转存路径含有非法字符</br>{"errno":-10} 为网盘容量已满</br>{"errno":0}
为转存成功</br>
<b>所有请求在用户端进行,服务器不保存任何数据</b>
</p>
</div>
</div>
</div>
</div>
</body>
</html>