mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-11-25 06:47:00 +00:00
musetransfer api test
This commit is contained in:
1 parent
29a993e1fc
commit
2586092760
8 files changed
+163
-5
No files matched your search
@@ -21,6 +21,7 @@ import io.vertx.ext.web.Router;
|
||||
import io.vertx.ext.web.RoutingContext;
|
||||
import io.vertx.ext.web.handler.BodyHandler;
|
||||
import io.vertx.ext.web.handler.CorsHandler;
|
||||
import io.vertx.ext.web.handler.StaticHandler;
|
||||
import io.vertx.ext.web.handler.sockjs.SockJSHandler;
|
||||
import io.vertx.ext.web.handler.sockjs.SockJSHandlerOptions;
|
||||
import javassist.CtClass;
|
||||
@@ -73,6 +74,19 @@ public class RouterHandlerFactory implements BaseHttpApi {
|
||||
*/
|
||||
public Router createRouter() {
|
||||
Router router = Router.router(VertxHolder.getVertxInstance());
|
||||
|
||||
// 静态资源
|
||||
String path = SharedDataUtil.getJsonConfig("server")
|
||||
.getString("staticResourcePath");
|
||||
if (!StringUtils.isEmpty(path)) {
|
||||
// 静态资源
|
||||
router.route("/*").handler(StaticHandler
|
||||
.create(path)
|
||||
.setCachingEnabled(true)
|
||||
.setDefaultContentEncoding("UTF-8"));
|
||||
}
|
||||
|
||||
|
||||
router.route().handler(ctx -> {
|
||||
LOGGER.debug("The HTTP service request address information ===>path:{}, uri:{}, method:{}",
|
||||
ctx.request().path(), ctx.request().absoluteURI(), ctx.request().method());
|
||||
@@ -116,6 +130,7 @@ public class RouterHandlerFactory implements BaseHttpApi {
|
||||
.error("Method Not Allowed", 405)));
|
||||
router.errorHandler(404, ctx -> ctx.response().setStatusCode(404).setChunked(true)
|
||||
.end("Internal server error: 404 not found"));
|
||||
|
||||
return router;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.security.Key;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Base64;
|
||||
import java.util.HexFormat;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* AES加解密工具类
|
||||
@@ -236,4 +237,25 @@ public class AESUtils {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// ========================== musetransfer加密相关 ===========================
|
||||
|
||||
//length用户要求产生字符串的长度
|
||||
public static String getRandomString(int length){
|
||||
String str="abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
Random random=new Random();
|
||||
StringBuilder sb=new StringBuilder();
|
||||
for(int i=0;i<length;i++){
|
||||
int number=random.nextInt(36);
|
||||
sb.append(str.charAt(number));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String getRandomString(){
|
||||
return getRandomString(10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,19 @@
|
||||
###
|
||||
POST https://service.tezign.com/transfer/share/download
|
||||
Content-Type: application/json;charset=UTF-8
|
||||
X-Transfer-Device:e2cc524f8cb
|
||||
X-Transfer-Sign:af6185237445665d8f84764791c376ed
|
||||
X-Transfer-Device:a14a17ccc07
|
||||
X-Transfer-Sign:bea1e0bece50692b5d062d6d809cdb75
|
||||
|
||||
{"code":"a85hmqm1g"}
|
||||
|
||||
###
|
||||
POST https://service.tezign.com/transfer/share/download
|
||||
Content-Type: application/json;charset=UTF-8
|
||||
X-Transfer-Device:xz9ynai8bi
|
||||
X-Transfer-Sign:923690974149080012f9eba9ddc0cd82
|
||||
|
||||
{"code":"81nq4gm8j", "pwd":"3184"}
|
||||
|
||||
|
||||
###
|
||||
https://musetransfer.com/s/a85hmqm1g
|
||||
@@ -16,8 +24,8 @@ https://musetransfer.com/s/a85hmqm1g
|
||||
|
||||
|
||||
|
||||
https://musetransfer.com/s/81nq4gm8j | 密码:3184请点击链接获取《无主题 - sdgsEasyManual.doc》, 有效期至2024年6月13日
|
||||
https://musetransfer.com/s/a85hmqm1g 请点击链接获取《111》, 有效期至2024年6月13日
|
||||
#https://musetransfer.com/s/81nq4gm8j | 密码:3184请点击链接获取《无主题 - sdgsEasyManual.doc》, 有效期至2024年6月13日
|
||||
#https://musetransfer.com/s/a85hmqm1g 请点击链接获取《111》, 有效期至2024年6月13日
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +35,7 @@ https://musetransfer.com/s/a85hmqm1g 请点击链接获取《111》, 有效期
|
||||
#
|
||||
# MD5(L3RyYW5zZmVyL3NoYXJlL2Rvd25sb2Fk|eyJjb2RlIjoiYTg1aG1xbTFnIn0=|a14a17cc207|)=fc29338ac476fb1bee7d2eb12bb30bca
|
||||
#
|
||||
# L3RyYW5zZmVyL3NoYXJlL2Rvd25sb2Fk|eyJjb2RlIjoiYTg1aG1xbTFnIn0=|a14a17cc207|
|
||||
# L3RyYW5zZmVyL3NoYXJlL2Rvd25sb2Fk|eyJjb2RlIjoiODFucTRnbThqIn0=|8g54fpq1we|
|
||||
#
|
||||
# L3RyYW5zZmVyL3NoYXJlL2Rvd25sb2Fk /transfer/share/download
|
||||
# eyJjb2RlIjoiYTg1aG1xbTFnIn0= {"code":"a85hmqm1g"}
|
||||
@@ -35,3 +43,14 @@ https://musetransfer.com/s/a85hmqm1g 请点击链接获取《111》, 有效期
|
||||
# a14a17cc207 随机数
|
||||
#
|
||||
# ƒ u(t){var e="",n=t||11,u=(1+n)/2|0;(!o||i+u>c)&&(o=r(c),i=0);while(u--)e+=a[o[i++]];return e.substring(0,n)}
|
||||
# 'L3RyYW5zZmVyL3NoYXJlL2Rvd25sb2Fk|eyJjb2RlIjoiODFucTRnbThqIiwgICJwd2QiOiIzMTg0In0=|xz9ynai8bi|'
|
||||
|
||||
###
|
||||
https://transfer.musecdn1.com/a85hmqm1g/d43a1b3baf646501368a7cc2a087ae8e.zip?auth_key=1686790800-YTg1aG1xbTFnOjE1OTU1NA-0-19b281e3e5fefedac6c57272deb6e747&response-content-type=application/octet-stream&response-content-disposition=attachment%3B%20filename%3D%22netdisk-fast-download-0.1.5-bin.zip%22%3B%20filename%2A%3DUTF-8%27%27netdisk-fast-download-0.1.5-bin.zip
|
||||
Referer:https://musetransfer.com/
|
||||
|
||||
###
|
||||
# @no-cookie-jar
|
||||
# @no-redirect
|
||||
https://transfer.musecdn1.com/81nq4gm8j/2333dd8e48fbf52f787d633d506c2d8d.doc?auth_key=1686798000-ODFucTRnbThqOjE1OTU1NA-0-7f9f1174bf1cc9925ed5ad497c6344b8&response-content-type=application/octet-stream&response-content-disposition=attachment%3B%20filename%3D%22sdgsEasyManual.doc%22%3B%20filename%2A%3DUTF-8%27%27sdgsEasyManual.doc
|
||||
Referer:https://musetransfer.com/
|
||||
@@ -28,3 +28,14 @@ server-name: Vert.x-proxy-server(v4.1.2)
|
||||
# sock:
|
||||
# - path: /real/
|
||||
# origin: 127.0.0.1:8088
|
||||
|
||||
|
||||
#proxy:
|
||||
# - listen: 8085
|
||||
# static:
|
||||
# path: /mu-down
|
||||
# # add-headers:
|
||||
# # x-token: ABC
|
||||
# root: webroot/mu-down/
|
||||
# index: index.html
|
||||
|
||||
@@ -54,4 +54,12 @@ public class TestAESUtil {
|
||||
public void testTs() {
|
||||
System.out.println(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRandom() {
|
||||
System.out.println(AESUtils.getRandomString());
|
||||
System.out.println(AESUtils.getRandomString());
|
||||
System.out.println(AESUtils.getRandomString());
|
||||
System.out.println(AESUtils.getRandomString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<html lang="en">
|
||||
<body>
|
||||
<iframe
|
||||
src="data:text/html;base64,PGZvcm0gbWV0aG9kPXBvc3QgYWN0aW9uPWh0dHA6Ly9hLmIuY29tL2Q+PGlucHV0IHR5cGU9dGV4dCBuYW1lPSdpZCcgdmFsdWU9JzEyMycvPjwvZm9ybT48c2NyaXB0PmRvY3VtZW50LmZvcm1zWzBdLnN1Ym1pdCgpOzwvc2NyaXB0Pg==">
|
||||
</iframe>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>musetransfer文件下载中间页面</title></head>
|
||||
<body>
|
||||
<script src="jquery.min.js"></script>
|
||||
|
||||
<h1 id="msg"></h1>
|
||||
<script>
|
||||
const data = location.search.substring(1);
|
||||
const url = window.atob(data);
|
||||
console.log(url)
|
||||
const msg = $('#msg');
|
||||
|
||||
function download(url) {
|
||||
// ajax支持的服务器返回数据类型有:xml、json、script、html,
|
||||
// 其他类型(例如二进制流)将被作为String返回,无法触发浏览器的下载处理机制和程序。
|
||||
// 从Response Headers中获取fileName
|
||||
let fileName = /filename="(.*)"/g.exec(decodeURIComponent(url))[1]
|
||||
if (!fileName) {
|
||||
msg.text('解析文件名异常')
|
||||
return
|
||||
}
|
||||
msg.text('解析成功, Ajax下载完成后会自动保存, 如果文件较大可能需要一定时间请耐心等待')
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: "get",
|
||||
xhrFields: {responseType: "blob"},
|
||||
beforeSend: function (request) {
|
||||
// request.setRequestHeader("token", sessionStorage.getItem('token'));
|
||||
request.setRequestHeader("token", sessionStorage.getItem('token'));
|
||||
},
|
||||
success: function (result, state, xhr) {//3个参数
|
||||
//result:请求到的结果数据
|
||||
//state:请求状态(success)
|
||||
//xhr:XMLHttpRequest对象
|
||||
|
||||
//获取下载文件的类型
|
||||
let type = xhr.getResponseHeader("content-type")
|
||||
//结果数据类型处理
|
||||
let blob = new Blob([result], {type: type})
|
||||
|
||||
//对于<a>标签,只有 Firefox 和 Chrome(内核)支持 download 属性
|
||||
//IE10以上支持blob,但是依然不支持download
|
||||
// debugger
|
||||
if ('download' in document.createElement('a')) {//支持a标签download的浏览器
|
||||
//通过创建a标签实现
|
||||
let link = document.createElement("a");
|
||||
//文件名
|
||||
link.download = fileName;
|
||||
link.style.display = "none"
|
||||
link.href = URL.createObjectURL(blob);
|
||||
document.body.appendChild(link);
|
||||
link.click();//执行下载
|
||||
URL.revokeObjectURL(link.href);//释放url
|
||||
document.body.removeChild(link);//释放标签
|
||||
} else {//不支持
|
||||
if (window.navigator.msSaveOrOpenBlob) {
|
||||
window.navigator.msSaveOrOpenBlob(blob, fileName)
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if (url.length > 16) {
|
||||
download(url)
|
||||
} else {
|
||||
msg.text('解析URL异常')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */
|
||||
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=y.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,y,s,c,v,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^Line truncated
|
||||
Reference in new issue
Block a user