mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-11-26 15:17:00 +00:00
parser: 蓝奏 folder pagination with cursor and rate-limit handling
filemoreajax keeps paging state per t/k token, so the next page is fetched with the previous page's form (nextCursor). zt=4 "请刷新,重试" is upstream pacing, not the end: retry the same page twice 2s apart, then fail with a retryable error. Only zt=2 or a short page ends the list. Without a cursor, walk at most 6 pages 1.5s apart. Keeps PR307's mobile-UA folder page and risk-page detection. Co-authored-by: qaiu <[email protected]>
This commit is contained in:
5 files changed
+879
-67
No files matched your search
@@ -0,0 +1,116 @@
|
||||
package cn.qaiu.parser.impl;
|
||||
|
||||
import cn.qaiu.util.CommonUtils;
|
||||
import io.vertx.core.json.JsonObject;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 蓝奏目录「下一页」游标。
|
||||
* <p>
|
||||
* filemoreajax 的 t/k 由分享页下发,上游按这组令牌记录已翻到第几页:同一组令牌可以取
|
||||
* 「已取过的最大页 + 1」以内的任意页;换一组新令牌直接跳到第 N 页会返回 zt=4「请刷新,重试」。
|
||||
* 所以加载更多时把上一页用过的表单(不含密码和页码)交还给客户端,下次直接续翻。
|
||||
* <p>
|
||||
* 游标来自客户端,不可信:只用于表单字段,POST 主机仍由服务端按分享链接决定;
|
||||
* 分享 key、页码、路径对不上一律当作没有游标,回退到从第 1 页顺序翻。
|
||||
*/
|
||||
final class LzFolderCursor {
|
||||
|
||||
private static final int VERSION = 1;
|
||||
private static final Pattern PATH = Pattern.compile("/filemoreajax\\.php\\?file=(\\d+)");
|
||||
private static final Pattern KEY = Pattern.compile("\\w{1,32}");
|
||||
private static final int MAX_VALUE_LENGTH = 256;
|
||||
private static final int MAX_FIELDS = 32;
|
||||
|
||||
final String path;
|
||||
final Map<String, String> form;
|
||||
final String webpage;
|
||||
|
||||
private LzFolderCursor(String path, Map<String, String> form, String webpage) {
|
||||
this.path = path;
|
||||
this.form = form;
|
||||
this.webpage = webpage;
|
||||
}
|
||||
|
||||
static String encode(String shareKey, String path, Map<String, String> form, int nextPage, String webpage) {
|
||||
JsonObject f = new JsonObject();
|
||||
form.forEach((k, v) -> {
|
||||
if (!"pwd".equals(k) && !"pg".equals(k)) {
|
||||
f.put(k, v);
|
||||
}
|
||||
});
|
||||
JsonObject json = new JsonObject()
|
||||
.put("v", VERSION)
|
||||
.put("s", shareKey)
|
||||
.put("p", path)
|
||||
.put("n", nextPage)
|
||||
.put("f", f);
|
||||
if (webpage != null && !webpage.isBlank()) {
|
||||
json.put("w", webpage);
|
||||
}
|
||||
return CommonUtils.urlBase64Encode(json.encode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 校验通过的游标;任何不匹配或格式问题都返回 null
|
||||
*/
|
||||
static LzFolderCursor decode(String raw, String shareKey, int page) {
|
||||
if (raw == null || raw.isBlank() || raw.length() > 4096) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JsonObject json = new JsonObject(CommonUtils.urlBase64Decode(raw));
|
||||
if (json.getInteger("v", 0) != VERSION) {
|
||||
return null;
|
||||
}
|
||||
if (shareKey == null || !shareKey.equals(json.getString("s"))) {
|
||||
return null;
|
||||
}
|
||||
if (json.getInteger("n", -1) != page) {
|
||||
return null;
|
||||
}
|
||||
String path = json.getString("p");
|
||||
var m = path == null ? null : PATH.matcher(path);
|
||||
if (m == null || !m.matches()) {
|
||||
return null;
|
||||
}
|
||||
JsonObject f = json.getJsonObject("f");
|
||||
if (f == null || f.size() > MAX_FIELDS) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> form = new LinkedHashMap<>();
|
||||
for (String key : f.fieldNames()) {
|
||||
Object v = f.getValue(key);
|
||||
if (!KEY.matcher(key).matches() || v == null) {
|
||||
return null;
|
||||
}
|
||||
String s = String.valueOf(v);
|
||||
if (s.length() > MAX_VALUE_LENGTH || s.chars().anyMatch(c -> c < 0x20)) {
|
||||
return null;
|
||||
}
|
||||
form.put(key, s);
|
||||
}
|
||||
if (!m.group(1).equals(form.get("fid")) || !form.containsKey("t") || !form.containsKey("k")) {
|
||||
return null;
|
||||
}
|
||||
String webpage = json.getString("w");
|
||||
if (webpage != null && (webpage.length() > MAX_VALUE_LENGTH || !webpage.matches("[\\w\\-=.%]+"))) {
|
||||
webpage = null;
|
||||
}
|
||||
return new LzFolderCursor(path, form, webpage);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 本次请求用的表单:游标字段 + 当前密码 + 目标页。 */
|
||||
Map<String, String> formFor(String pwd, int page) {
|
||||
Map<String, String> out = new LinkedHashMap<>(form);
|
||||
out.put("pg", String.valueOf(page));
|
||||
out.put("pwd", pwd == null ? "" : pwd);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package cn.qaiu.parser.impl;
|
||||
import cn.qaiu.WebClientVertxInit;
|
||||
import cn.qaiu.entity.FileInfo;
|
||||
import cn.qaiu.entity.ShareLinkInfo;
|
||||
import cn.qaiu.parser.FolderPaging;
|
||||
import cn.qaiu.parser.PanBase;
|
||||
import cn.qaiu.util.*;
|
||||
import io.netty.handler.codec.http.cookie.DefaultCookie;
|
||||
@@ -11,6 +12,7 @@ import io.vertx.core.Handler;
|
||||
import io.vertx.core.MultiMap;
|
||||
import io.vertx.core.Promise;
|
||||
import io.vertx.core.buffer.Buffer;
|
||||
import io.vertx.core.json.JsonArray;
|
||||
import io.vertx.core.json.JsonObject;
|
||||
import io.vertx.core.net.ProxyOptions;
|
||||
import io.vertx.core.net.ProxyType;
|
||||
@@ -25,9 +27,11 @@ import java.io.ByteArrayInputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -73,6 +77,17 @@ public class LzTool extends PanBase {
|
||||
"https://www.lanzoux.com",
|
||||
"https://wwww.lanzoux.com"
|
||||
);
|
||||
/** filemoreajax.php 每页条数(含 id=-1 占位项),不足即最后一页。 */
|
||||
static final int LZ_FOLDER_PAGE_SIZE = 50;
|
||||
/** 目录页不渲染的占位项 id。 */
|
||||
static final String LZ_PLACEHOLDER_ID = "-1";
|
||||
/** 同一组 t/k 两次 filemoreajax 间隔不足约 1.5 秒时返回 zt=4「请刷新,重试」。 */
|
||||
static final int LZ_ZT_REFRESH = 4;
|
||||
static final long LZ_PAGE_INTERVAL_MS = 1500;
|
||||
static final long LZ_REFRESH_RETRY_DELAY_MS = 2000;
|
||||
static final int LZ_REFRESH_RETRIES = 2;
|
||||
/** 无游标时从第 1 页顺序翻的最大页数,保证一次请求能在路由超时(默认 15 秒)内完成。 */
|
||||
static final int LZ_MAX_WALK_PAGES = 6;
|
||||
/** 分享页 / ajax 请求超时 */
|
||||
private static final long REQUEST_TIMEOUT = 8000;
|
||||
/** 下载域跳转与二次验证超时,链路更长 */
|
||||
@@ -1085,7 +1100,7 @@ public class LzTool extends PanBase {
|
||||
private static String originOf(String url, String fallback) {
|
||||
try {
|
||||
URL u = new URL(url);
|
||||
return u.getProtocol() + "://" + u.getHost();
|
||||
return u.getProtocol() + "://" + u.getHost() + (u.getPort() == -1 ? "" : ":" + u.getPort());
|
||||
} catch (Exception e) {
|
||||
return fallback;
|
||||
}
|
||||
@@ -1164,16 +1179,69 @@ public class LzTool extends PanBase {
|
||||
|
||||
final String sUrl = resolveShareUrl();
|
||||
final String pwd = shareLinkInfo.getSharePassword();
|
||||
final int page;
|
||||
try {
|
||||
page = FolderPaging.pageOrFirst(shareLinkInfo);
|
||||
} catch (IllegalArgumentException e) {
|
||||
listPromise.fail(baseMsg() + e.getMessage());
|
||||
return listPromise.future();
|
||||
}
|
||||
|
||||
// 目录页用移动端 UA。桌面 Chrome 访问旧目录(如 /b66477)常返回空白风控页,
|
||||
// 页面里没有 filemoreajax,随后会被误报成「获取失败1,可能分享已失效」。
|
||||
getWithArg1Retry(sUrl, folderPageHeaders(sUrl))
|
||||
.onSuccess(html -> handleFileListParse(html, pwd, sUrl, listPromise))
|
||||
.onFailure(listPromise::fail);
|
||||
LzFolderCursor cursor = page > 1
|
||||
? LzFolderCursor.decode(FolderPaging.cursor(shareLinkInfo), shareLinkInfo.getShareKey(), page)
|
||||
: null;
|
||||
if (cursor == null) {
|
||||
if (page > LZ_MAX_WALK_PAGES) {
|
||||
listPromise.fail(baseMsg() + walkLimitMessage(page));
|
||||
return listPromise.future();
|
||||
}
|
||||
loadFolderPage(sUrl, pwd, page, listPromise);
|
||||
return listPromise.future();
|
||||
}
|
||||
if (cursor.webpage != null) {
|
||||
shareLinkInfo.getOtherParam().put("webpage", cursor.webpage);
|
||||
}
|
||||
AjaxCall call = new AjaxCall(cursor.path, cursor.formFor(pwd, page));
|
||||
postFolderPage(sUrl, call, page, 0, reply -> {
|
||||
if (reply.zt() == 1) {
|
||||
finishFolderPage(call, page, reply, listPromise);
|
||||
} else if (reply.zt() == 2) {
|
||||
finishEmptyFolderPage(page, listPromise);
|
||||
} else if (reply.zt() == LZ_ZT_REFRESH) {
|
||||
fallbackFromCursor(sUrl, pwd, page, reply.info(), listPromise);
|
||||
} else {
|
||||
listPromise.tryFail(baseMsg() + "蓝奏云目录第 " + page + " 页获取失败: " + reply.info());
|
||||
}
|
||||
}, err -> fallbackFromCursor(sUrl, pwd, page, err.getMessage(), listPromise));
|
||||
return listPromise.future();
|
||||
}
|
||||
|
||||
private void handleFileListParse(String html, String pwd, String sUrl, Promise<List<FileInfo>> listPromise) {
|
||||
/** 游标过期(令牌约 10 分钟)或被拒:页码不大时整段重翻,否则让调用方从第 1 页重新加载。 */
|
||||
private void fallbackFromCursor(String sUrl, String pwd, int page, String reason,
|
||||
Promise<List<FileInfo>> listPromise) {
|
||||
log.debug("蓝奏目录游标不可用 page={} reason={}", page, reason);
|
||||
if (page > LZ_MAX_WALK_PAGES) {
|
||||
listPromise.tryFail(baseMsg() + "蓝奏云目录分页游标已失效(" + reason + "),请从第 1 页重新加载");
|
||||
return;
|
||||
}
|
||||
loadFolderPage(sUrl, pwd, page, listPromise);
|
||||
}
|
||||
|
||||
private static String walkLimitMessage(int page) {
|
||||
return "蓝奏云目录需按顺序翻页:第 " + page + " 页请带上一页返回的 nextCursor 请求"
|
||||
+ "(无游标最多直接取到第 " + LZ_MAX_WALK_PAGES + " 页)";
|
||||
}
|
||||
|
||||
private void loadFolderPage(String sUrl, String pwd, int page, Promise<List<FileInfo>> listPromise) {
|
||||
// 目录页用移动端 UA。桌面 Chrome 访问旧目录(如 /b66477)常返回空白风控页,
|
||||
// 页面里没有 filemoreajax,随后会被误报成「获取失败1,可能分享已失效」。
|
||||
getWithArg1Retry(sUrl, folderPageHeaders(sUrl))
|
||||
.onSuccess(html -> handleFileListParse(html, pwd, sUrl, page, listPromise))
|
||||
.onFailure(listPromise::fail);
|
||||
}
|
||||
|
||||
private void handleFileListParse(String html, String pwd, String sUrl, int page,
|
||||
Promise<List<FileInfo>> listPromise) {
|
||||
if (!isLzFolderShare(sUrl, html)) {
|
||||
listPromise.fail(baseMsg() + "该链接为蓝奏云文件分享,请使用文件解析接口");
|
||||
return;
|
||||
@@ -1193,14 +1261,105 @@ public class LzTool extends PanBase {
|
||||
}
|
||||
log.debug("解析参数: {}", call.form());
|
||||
|
||||
postAjaxWithFallback(sUrl, call, folderListHeaders(sUrl),
|
||||
body -> handleFileListResponse(body, listPromise),
|
||||
listPromise::fail);
|
||||
walkFolderPages(sUrl, call, 1, page, listPromise);
|
||||
} catch (ScriptException | NoSuchMethodException | RuntimeException e) {
|
||||
listPromise.fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同一组 t/k 从第 {@code pg} 页顺序翻到 {@code target} 页。新令牌不能跳页,
|
||||
* 两次请求间隔不足约 1.5 秒会返回 zt=4,所以逐页间隔 {@link #LZ_PAGE_INTERVAL_MS};
|
||||
* 次数受 {@link #LZ_MAX_WALK_PAGES} 限制。
|
||||
*/
|
||||
private void walkFolderPages(String sUrl, AjaxCall call, int pg, int target,
|
||||
Promise<List<FileInfo>> listPromise) {
|
||||
postFolderPage(sUrl, call, pg, 0, reply -> {
|
||||
if (reply.zt() == 1) {
|
||||
if (pg == target) {
|
||||
finishFolderPage(call, target, reply, listPromise);
|
||||
} else if (reply.rawCount() < LZ_FOLDER_PAGE_SIZE) {
|
||||
finishEmptyFolderPage(target, listPromise);
|
||||
} else {
|
||||
WebClientVertxInit.get().setTimer(LZ_PAGE_INTERVAL_MS,
|
||||
id -> walkFolderPages(sUrl, call, pg + 1, target, listPromise));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (target == 1) {
|
||||
listPromise.tryFail(baseMsg() + reply.info());
|
||||
} else if (reply.zt() == 2) {
|
||||
finishEmptyFolderPage(target, listPromise);
|
||||
} else {
|
||||
listPromise.tryFail(baseMsg() + "蓝奏云目录第 " + pg + " 页获取失败: " + reply.info()
|
||||
+ ";未取到第 " + target + " 页,目录列表不完整,请稍后重试");
|
||||
}
|
||||
}, listPromise::tryFail);
|
||||
}
|
||||
|
||||
/** 取一页;zt=4(请求过快)时同一令牌等一会儿重试,最多 {@link #LZ_REFRESH_RETRIES} 次。 */
|
||||
private void postFolderPage(String sUrl, AjaxCall call, int pg, int attempt,
|
||||
Handler<FolderReply> onReply, Handler<Throwable> onFailure) {
|
||||
call.form().put("pg", String.valueOf(pg));
|
||||
postAjaxWithFallback(sUrl, call, folderListHeaders(sUrl), body -> {
|
||||
FolderReply reply = FolderReply.parse(body);
|
||||
if (reply == null) {
|
||||
onFailure.handle(new RuntimeException(baseMsg() + "目录列表返回非JSON"));
|
||||
return;
|
||||
}
|
||||
if (reply.zt() == LZ_ZT_REFRESH && attempt < LZ_REFRESH_RETRIES) {
|
||||
log.debug("蓝奏目录第 {} 页返回 {},{}ms 后重试", pg, reply.info(), LZ_REFRESH_RETRY_DELAY_MS);
|
||||
WebClientVertxInit.get().setTimer(LZ_REFRESH_RETRY_DELAY_MS,
|
||||
id -> postFolderPage(sUrl, call, pg, attempt + 1, onReply, onFailure));
|
||||
return;
|
||||
}
|
||||
onReply.handle(reply);
|
||||
}, onFailure);
|
||||
}
|
||||
|
||||
private void finishEmptyFolderPage(int page, Promise<List<FileInfo>> listPromise) {
|
||||
FolderPaging.pageInfo(shareLinkInfo, page, LZ_FOLDER_PAGE_SIZE, false, null, null, null);
|
||||
listPromise.tryComplete(new ArrayList<>());
|
||||
}
|
||||
|
||||
private void finishFolderPage(AjaxCall call, int page, FolderReply reply, Promise<List<FileInfo>> listPromise) {
|
||||
try {
|
||||
List<FileInfo> list = toFolderFileInfos(reply.items());
|
||||
boolean hasMore = reply.rawCount() >= LZ_FOLDER_PAGE_SIZE;
|
||||
String next = hasMore
|
||||
? LzFolderCursor.encode(shareLinkInfo.getShareKey(), call.path(), call.form(), page + 1,
|
||||
currentWebpage())
|
||||
: null;
|
||||
FolderPaging.pageInfo(shareLinkInfo, page, LZ_FOLDER_PAGE_SIZE, hasMore, null, null, next);
|
||||
listPromise.tryComplete(list);
|
||||
} catch (Exception e) {
|
||||
listPromise.tryFail(e);
|
||||
}
|
||||
}
|
||||
|
||||
/** filemoreajax.php 单页响应;text 不是数组时 items 为空。 */
|
||||
record FolderReply(int zt, String info, List<JsonObject> items, int rawCount) {
|
||||
static FolderReply parse(String body) {
|
||||
JsonObject json = parseLzJson(body);
|
||||
if (json == null) {
|
||||
return null;
|
||||
}
|
||||
Integer zt = jsonInt(json, "zt");
|
||||
Object info = json.getValue("info");
|
||||
List<JsonObject> items = new ArrayList<>();
|
||||
Object text = json.getValue("text");
|
||||
if (text instanceof JsonArray arr) {
|
||||
for (Object o : arr) {
|
||||
if (o instanceof JsonObject item) {
|
||||
items.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new FolderReply(zt == null ? -1 : zt, info == null ? null : String.valueOf(info),
|
||||
items, items.size());
|
||||
}
|
||||
}
|
||||
|
||||
/** 正则匹配不到 filemoreajax 块时,回退到执行页面 JS 取参数。 */
|
||||
private AjaxCall folderAjaxFromJs(String html, String pwd) throws ScriptException, NoSuchMethodException {
|
||||
String jsText = getJsByPwd(pwd, html, "var urls =window.location.href");
|
||||
@@ -1293,66 +1452,59 @@ public class LzTool extends PanBase {
|
||||
return u;
|
||||
}
|
||||
|
||||
private void handleFileListResponse(String responseBody, Promise<List<FileInfo>> listPromise) {
|
||||
try {
|
||||
JsonObject fileListJson = parseLzJson(responseBody);
|
||||
if (fileListJson == null) {
|
||||
listPromise.fail(baseMsg() + "目录列表返回非JSON");
|
||||
return;
|
||||
/**
|
||||
* 目录页 JS 不渲染 id 为 -1 的占位项(如「***.apk」),这里同样跳过;它仍计入每页 50 条。
|
||||
* 同一页里重复的 id 只保留第一条。
|
||||
*/
|
||||
private List<FileInfo> toFolderFileInfos(List<JsonObject> items) {
|
||||
List<FileInfo> list = new ArrayList<>();
|
||||
Set<String> seen = new HashSet<>();
|
||||
for (JsonObject fileJson : items) {
|
||||
/*
|
||||
{
|
||||
"icon": "apk",
|
||||
"t": 0,
|
||||
"id": "iULV2n4361c",
|
||||
"name_all": "xx.apk",
|
||||
"size": "49.8 M",
|
||||
"time": "2021-03-19",
|
||||
"duan": "in4361",
|
||||
"p_ico": 0
|
||||
}
|
||||
Integer zt = fileListJson.getInteger("zt");
|
||||
if (zt == null || zt != 1) {
|
||||
listPromise.fail(baseMsg() + fileListJson.getString("info"));
|
||||
return;
|
||||
*/
|
||||
String id = fileJson.getString("id");
|
||||
if (id == null || id.isBlank() || LZ_PLACEHOLDER_ID.equals(id) || !seen.add(id)) {
|
||||
continue;
|
||||
}
|
||||
List<FileInfo> list = new ArrayList<>();
|
||||
fileListJson.getJsonArray("text").forEach(item -> {
|
||||
/*
|
||||
{
|
||||
"icon": "apk",
|
||||
"t": 0,
|
||||
"id": "iULV2n4361c",
|
||||
"name_all": "xx.apk",
|
||||
"size": "49.8 M",
|
||||
"time": "2021-03-19",
|
||||
"duan": "in4361",
|
||||
"p_ico": 0
|
||||
}
|
||||
*/
|
||||
JsonObject fileJson = (JsonObject) item;
|
||||
FileInfo fileInfo = new FileInfo();
|
||||
String size = fileJson.getString("size");
|
||||
Long sizeNum = FileSizeConverter.convertToBytes(size);
|
||||
String panType = shareLinkInfo.getType();
|
||||
String id = fileJson.getString("id");
|
||||
String fileName = fileJson.getString("name_all");
|
||||
// 构建 base64 参数,用于 /v2/redirectUrl 接口
|
||||
JsonObject paramJson = new JsonObject()
|
||||
.put("id", id)
|
||||
.put("fileName", fileName)
|
||||
.put("shareKey", shareLinkInfo.getShareKey());
|
||||
String webpage = currentWebpage();
|
||||
if (webpage != null) {
|
||||
paramJson.put("webpage", webpage);
|
||||
}
|
||||
String param = CommonUtils.urlBase64Encode(paramJson.encode());
|
||||
fileInfo.setFileName(fileName)
|
||||
.setFileId(id)
|
||||
.setCreateTime(fileJson.getString("time"))
|
||||
.setFileType(fileJson.getString("icon"))
|
||||
.setSizeStr(fileJson.getString("size"))
|
||||
.setSize(sizeNum)
|
||||
.setPanType(panType)
|
||||
.setParserUrl(String.format("%s/v2/redirectUrl/%s/%s", getDomainName(), panType, param))
|
||||
.setPreviewUrl(String.format("%s/v2/view/%s/%s", getDomainName(),
|
||||
shareLinkInfo.getType(), id));
|
||||
log.debug("文件信息: {}", fileInfo);
|
||||
list.add(fileInfo);
|
||||
});
|
||||
listPromise.complete(list);
|
||||
} catch (Exception e) {
|
||||
listPromise.fail(e);
|
||||
FileInfo fileInfo = new FileInfo();
|
||||
String size = fileJson.getString("size");
|
||||
Long sizeNum = FileSizeConverter.convertToBytes(size);
|
||||
String panType = shareLinkInfo.getType();
|
||||
String fileName = fileJson.getString("name_all");
|
||||
// 构建 base64 参数,用于 /v2/redirectUrl 接口
|
||||
JsonObject paramJson = new JsonObject()
|
||||
.put("id", id)
|
||||
.put("fileName", fileName)
|
||||
.put("shareKey", shareLinkInfo.getShareKey());
|
||||
String webpage = currentWebpage();
|
||||
if (webpage != null) {
|
||||
paramJson.put("webpage", webpage);
|
||||
}
|
||||
String param = CommonUtils.urlBase64Encode(paramJson.encode());
|
||||
fileInfo.setFileName(fileName)
|
||||
.setFileId(id)
|
||||
.setCreateTime(fileJson.getString("time"))
|
||||
.setFileType(fileJson.getString("icon"))
|
||||
.setSizeStr(fileJson.getString("size"))
|
||||
.setSize(sizeNum)
|
||||
.setPanType(panType)
|
||||
.setParserUrl(String.format("%s/v2/redirectUrl/%s/%s", getDomainName(), panType, param))
|
||||
.setPreviewUrl(String.format("%s/v2/view/%s/%s", getDomainName(),
|
||||
shareLinkInfo.getType(), id));
|
||||
log.debug("文件信息: {}", fileInfo);
|
||||
list.add(fileInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user