mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-16 20:33:03 +00:00
1. 动态UA
This commit is contained in:
@@ -77,7 +77,11 @@ public class ShareLinkInfo {
|
||||
|
||||
public String getCacheKey() {
|
||||
// 将type和shareKey组合成一个字符串作为缓存key
|
||||
return type + ":" + shareKey;
|
||||
String key = type + ":" + shareKey;
|
||||
if (type.equals("p115")) {
|
||||
key += ("_" + otherParam.get("UA").toString().hashCode());
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
public ShareLinkInfo setOtherParam(Map<String, Object> otherParam) {
|
||||
|
||||
@@ -59,6 +59,7 @@ public class ParserApi {
|
||||
.apiLink(getDownLink(parserCreate, true))
|
||||
.shareLinkInfo(shareLinkInfo).build();
|
||||
// 解析次数统计
|
||||
shareLinkInfo.getOtherParam().put("UA",request.headers().get("user-agent"));
|
||||
cacheManager.getShareKeyTotal(shareLinkInfo.getCacheKey()).onSuccess(res -> {
|
||||
if (res != null) {
|
||||
build.setCacheHitTotal(res.get("hit_total") == null ? 0: res.get("hit_total"));
|
||||
|
||||
@@ -63,6 +63,7 @@ cache:
|
||||
mne: 30
|
||||
mqq: 30
|
||||
mkg: 30
|
||||
p115: 5
|
||||
|
||||
# httpClient静态代理服务器配置(外网代理)
|
||||
proxy:
|
||||
|
||||
Reference in New Issue
Block a user