forked from mengzonefire/baidupan-rapidupload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multisave.html
107 lines (102 loc) · 4.87 KB
/
multisave.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
<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" />
<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 {
data.forEach(function (file) {
if (api === "api1")
saveFile(
file.md5,
file.md5s,
file.size,
savePath + file.path
);
else if (api === "api2")
saveFile2(
file.md5,
file.size,
savePath + file.path
);
});
}
}
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='./index.html'>秒传转存</a> <a href='./gen.html'>秒传生成</a> <a href='./convert.html'>秒传转换</a>
</p>
<p><b>批量转存必读</b>
</br>
<b>请允许本站弹出多个窗口以实现批量请求</b></br>
<img src="https://s1.ax1x.com/2020/05/10/Y1OqX9.png" height="212">
</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><textarea name="link" id="link" class="form-control"
placeholder="bdpan... / BaiduPCS-Go ... / 5b1...#b3a... 一行一条" rows=6></textarea></p>
</div>
<p><button onclick="submitLink()" class="btn btn-primary">解析链接并转存</button></p>
</div>
<div id="footer" class="col-sm-8 offset-sm-2 col-md-6 offset-md-3 text-center">
<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>
</div>
</body>
</html>