Skip to content

Commit

Permalink
Update request.dev.js
Browse files Browse the repository at this point in the history
  • Loading branch information
VirgilClyne committed Nov 1, 2024
1 parent 3e2d91d commit 55382b7
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/request.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,22 @@ log(`⚠ FORMAT: ${FORMAT}`, "");
switch (infoGroup.type) {
case "PGC":
if (infoGroup.locales.length !== 0) $request = await availableFetch($request, Settings.Proxies, Settings.Locales, infoGroup.locales);
else ({ request: $request } = await mutiFetch($request, Settings.Proxies, Settings.Locales));
else ({ request: $request, response: $response } = await mutiFetch($request, Settings.Proxies, Settings.Locales));
break;
case "UGC":
default:
log("⚠ 不是 PGC, 跳过", "");
break;
}
switch (
$platform // 直通模式,不处理,否则无法进http-response
) {
/*
switch ($platform) {
// 直通模式,不处理,否则无法进http-response
case "Shadowrocket":
case "Quantumult X":
$request.policy = undefined;
break;
}
*/
break;
case "/all": // 搜索-全部结果-html(综合)
case "/bilibili.polymer.app.search.v1.Search/SearchAll": // 搜索-全部结果-proto(综合)
Expand All @@ -410,15 +411,12 @@ log(`⚠ FORMAT: ${FORMAT}`, "");
}
break;
}
if (!$response) {
// 无(构造)回复数据
switch ($platform) {
// 已有指定策略的请求,根据策略fetch
case "Shadowrocket":
case "Quantumult X":
if ($request.policy) $response = await fetch($request);
break;
}
switch ($platform) {
// 已有指定策略的请求,根据策略fetch
case "Shadowrocket":
case "Quantumult X":
if ($request.policy && !$response) $response = await fetch($request); // 无(构造)回复数据
break;
}
break;
}
Expand Down

0 comments on commit 55382b7

Please sign in to comment.