mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-16 20:33:03 +00:00
0.0 前端优化,302标识短链添加/d前缀
This commit is contained in:
@@ -189,6 +189,13 @@ bash service-install.sh
|
|||||||
如果不想使用服务运行可以直接运行run.bat
|
如果不想使用服务运行可以直接运行run.bat
|
||||||
> 注意: 如果jdk环境变量的java版本不是17请修改nfd-service-template.xml中的java命令的路径改为实际路径
|
> 注意: 如果jdk环境变量的java版本不是17请修改nfd-service-template.xml中的java命令的路径改为实际路径
|
||||||
|
|
||||||
|
## 相关配置说明
|
||||||
|
|
||||||
|
resources目录下包含服务端配置文件 配置文件自带说明,具体请查看配置文件内容,
|
||||||
|
app-dev.yml 可以配置解析服务相关信息, 包括端口,域名,缓存时长等
|
||||||
|
server-proxy.yml 可以配置代理服务运行的相关信息, 包括前端反向代理端口,路径等
|
||||||
|
|
||||||
|
|
||||||
## 0.1.9 开发计划
|
## 0.1.9 开发计划
|
||||||
- 超星网盘解析 doing
|
- 超星网盘解析 doing
|
||||||
- 带Referer头的js请求下载 doing
|
- 带Referer头的js请求下载 doing
|
||||||
|
|||||||
@@ -132,8 +132,9 @@ public enum PanDomainTemplate {
|
|||||||
"https://www.kugou.com/mixsong/{shareKey}.html",
|
"https://www.kugou.com/mixsong/{shareKey}.html",
|
||||||
MkgsTool.MkgTool.class),
|
MkgsTool.MkgTool.class),
|
||||||
// https://kuwo.cn/play_detail/395500809
|
// https://kuwo.cn/play_detail/395500809
|
||||||
|
// https://m.kuwo.cn/newh5app/play_detail/318448522
|
||||||
MKWS("酷我音乐分享*",
|
MKWS("酷我音乐分享*",
|
||||||
compile("https://kuwo\\.cn/play_detail/(?<KEY>.+)"),
|
compile("https://(m\\.)?kuwo\\.cn/(newh5app/)?play_detail/(?<KEY>.+)"),
|
||||||
"https://kuwo.cn/play_detail/{shareKey}",
|
"https://kuwo.cn/play_detail/{shareKey}",
|
||||||
MkwTool.class),
|
MkwTool.class),
|
||||||
// https://music.migu.cn/v3/music/song/6326951FKBJ?channelId=001002H
|
// https://music.migu.cn/v3/music/song/6326951FKBJ?channelId=001002H
|
||||||
@@ -148,7 +149,7 @@ public enum PanDomainTemplate {
|
|||||||
// https://pan.huang1111.cn/s/xxx
|
// https://pan.huang1111.cn/s/xxx
|
||||||
// 通用域名([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}
|
// 通用域名([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}
|
||||||
CE("Cloudreve",
|
CE("Cloudreve",
|
||||||
compile("https://([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\\.)+[a-zA-Z]{2,}(/s)?/(?<KEY>.+)"),
|
compile("http(s)?://([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\\.)+[a-zA-Z]{2,}(/s)?/(?<KEY>.+)"),
|
||||||
"https://{any}/s/{shareKey}",
|
"https://{any}/s/{shareKey}",
|
||||||
CeTool.class),
|
CeTool.class),
|
||||||
// 可道云自定义域名解析
|
// 可道云自定义域名解析
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class ParserCreate {
|
|||||||
public String genPathSuffix() {
|
public String genPathSuffix() {
|
||||||
|
|
||||||
String path;
|
String path;
|
||||||
if (panDomainTemplate == PanDomainTemplate.CE) {
|
if (panDomainTemplate.ordinal() >= PanDomainTemplate.CE.ordinal()) {
|
||||||
// 处理Cloudreve(ce)类: pan.huang1111.cn_s_wDz5TK _ -> /
|
// 处理Cloudreve(ce)类: pan.huang1111.cn_s_wDz5TK _ -> /
|
||||||
path = this.shareLinkInfo.getType() + "/"
|
path = this.shareLinkInfo.getType() + "/"
|
||||||
+ this.shareLinkInfo.getShareUrl()
|
+ this.shareLinkInfo.getShareUrl()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import java.util.regex.Pattern;
|
|||||||
/**
|
/**
|
||||||
* 酷我音乐分享
|
* 酷我音乐分享
|
||||||
* <a href="https://kuwo.cn/play_detail/395500809">分享示例</a>
|
* <a href="https://kuwo.cn/play_detail/395500809">分享示例</a>
|
||||||
|
* <a href="https://m.kuwo.cn/newh5app/play_detail/318448522">分享示例</a>
|
||||||
*/
|
*/
|
||||||
public class MkwTool extends PanBase {
|
public class MkwTool extends PanBase {
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getInfo() {
|
getInfo() {
|
||||||
// 初始化统计信息
|
// 初始化统计信息
|
||||||
axios.get('/n1/statisticsInfo').then(
|
axios.get('/v2/statisticsInfo').then(
|
||||||
response => {
|
response => {
|
||||||
if (response.data.success) {
|
if (response.data.success) {
|
||||||
this.node1Info = response.data.data
|
this.node1Info = response.data.data
|
||||||
|
|||||||
@@ -15,12 +15,8 @@ module.exports = {
|
|||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: 6444,
|
port: 6444,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/': {
|
||||||
target: 'http://127.0.0.1:6400', // 请求本地
|
target: 'http://127.0.0.1:6400', // 请求本地
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
'^/api': '/' //本身的接口地址没有 '/api' 这种通用前缀,所以要rewrite,如果本身有则去掉
|
|
||||||
},
|
|
||||||
ws: true
|
ws: true
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cn.qaiu.lz.web.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qaiu.vx.core.annotaions.RouteHandler;
|
||||||
|
import cn.qaiu.vx.core.annotaions.RouteMapping;
|
||||||
|
import cn.qaiu.vx.core.enums.RouteMethod;
|
||||||
|
import io.vertx.ext.web.RoutingContext;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@RouteHandler(value = "/d", order = 99)
|
||||||
|
@Slf4j
|
||||||
|
public class DownRedirect {
|
||||||
|
@RouteMapping(value = "/:type/:key", method = RouteMethod.GET)
|
||||||
|
public void parseKey(RoutingContext ctx, String type, String key) {
|
||||||
|
ctx.reroute("/" + type + "/" + key);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,12 +68,12 @@ public class ParserApi {
|
|||||||
|
|
||||||
private static String getDownLink(ParserCreate create, boolean isJson) {
|
private static String getDownLink(ParserCreate create, boolean isJson) {
|
||||||
|
|
||||||
String linkPrefix = SharedDataUtil.getJsonConfig("server")
|
String linkPrefix = SharedDataUtil.getJsonConfig("server").getString("domainName");
|
||||||
.getString("domainName");
|
|
||||||
if (StringUtils.isBlank(linkPrefix)) {
|
if (StringUtils.isBlank(linkPrefix)) {
|
||||||
linkPrefix = "http://127.0.0.1";
|
linkPrefix = "http://127.0.0.1";
|
||||||
}
|
}
|
||||||
return linkPrefix + (isJson ? "/json/" : "/") + create.genPathSuffix();
|
// 下载短链前缀 /d
|
||||||
|
return linkPrefix + (isJson ? "/json/" : "/d/") + create.genPathSuffix();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ server:
|
|||||||
# 使用数据库
|
# 使用数据库
|
||||||
enableDatabase: true
|
enableDatabase: true
|
||||||
# 服务域名或者IP 生成二维码链接时需要
|
# 服务域名或者IP 生成二维码链接时需要
|
||||||
domainName: https://lz.qaiu.top
|
domainName: http://127.0.0.1:6401
|
||||||
|
|
||||||
# 反向代理服务器配置路径(不用加后缀)
|
# 反向代理服务器配置路径(不用加后缀)
|
||||||
proxyConf: server-proxy
|
proxyConf: server-proxy
|
||||||
@@ -40,11 +40,13 @@ dataSource:
|
|||||||
username: root
|
username: root
|
||||||
password: '123456'
|
password: '123456'
|
||||||
|
|
||||||
# 缓存配置
|
# 直链缓存相关配置
|
||||||
cache:
|
cache:
|
||||||
|
# 该配置未使用,后续加入其他Cache实现时,区分类型
|
||||||
type: h2db
|
type: h2db
|
||||||
# 默认时长: 单位分钟, 实际有效期分钟-1
|
# 默认时长: 单位分钟,大部分网盘未严格验证,建议不要太大
|
||||||
defaultDuration: 59
|
defaultDuration: 59
|
||||||
|
# 具体网盘的缓存配置,如果不加配置则不缓存,每次请求都会请求网盘API,格式:网盘标识: 时长
|
||||||
duration:
|
duration:
|
||||||
ce:
|
ce:
|
||||||
cow:
|
cow:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ GET http://127.0.0.1:6400/json/parser?url=https://wwsd.lanzoue.com/iLany1e9bbbi
|
|||||||
GET http://127.0.0.1:6400/json/lz/i6SqHmp1yfc
|
GET http://127.0.0.1:6400/json/lz/i6SqHmp1yfc
|
||||||
### 蓝奏云https://acgtools.lanzoui.com/iUr7Qnu3sxc https://wwn.lanzouy.com/tp/ihLkw1gezutg https://wwn.lanzouy.com/ihLkw1gezutg
|
### 蓝奏云https://acgtools.lanzoui.com/iUr7Qnu3sxc https://wwn.lanzouy.com/tp/ihLkw1gezutg https://wwn.lanzouy.com/ihLkw1gezutg
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
GET http://127.0.0.1:6400/lz/ihLkw1gezutg
|
GET http://127.0.0.1:6400/d/lz/ihLkw1gezutg
|
||||||
|
|
||||||
### 蓝奏云
|
### 蓝奏云
|
||||||
# @no-redirect
|
# @no-redirect
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ proxy:
|
|||||||
# 1.origin代理地址端口后有目录(包括 / ),转发后地址:代理地址+访问URL目录部分去除location匹配目录
|
# 1.origin代理地址端口后有目录(包括 / ),转发后地址:代理地址+访问URL目录部分去除location匹配目录
|
||||||
# 2.origin代理地址端口后无任何,转发后地址:代理地址+访问URL目录部
|
# 2.origin代理地址端口后无任何,转发后地址:代理地址+访问URL目录部
|
||||||
location:
|
location:
|
||||||
- path: ~^/(json/|v2/|parser|ye/|lz/|cow/|ec/|fj/|fc/|le/|qq/|ws/|iz/|ce|mne|mqq|mkg/).*
|
- path: ~^/(json/|v2/|d/|parser|ye/|lz/|cow/|ec/|fj/|fc/|le/|qq/|ws/|iz/|ce/).*
|
||||||
origin: 127.0.0.1:6400
|
origin: 127.0.0.1:6400
|
||||||
|
|
||||||
# json/parser -> xxx/parser
|
# json/parser -> xxx/parser
|
||||||
|
|||||||
Reference in New Issue
Block a user