mirror of
https://github.com/naiyQAQ/fanqie-assistant.git
synced 2026-10-21 10:24:47 +00:00
feat: 支持使用app的搜索接口。修复app接口漫画加载失败,修复漫画切章不加载,修复用户菜单错误注入到了排行榜里,修复gzip压缩的章节无法加载
This commit is contained in:
1 parent
d77d4edfd6
commit
16e3180712
24 files changed
+3822
-505
No files matched your search
@@ -1,10 +1,12 @@
|
||||
import { defaultConfig, type DeviceConfig } from "../config";
|
||||
import { b64decode, getSubtle, unhex } from ".";
|
||||
import { gunzip } from "../utils/compress";
|
||||
|
||||
// 正文算法: AES/CBC/PKCS5Padding
|
||||
// 返回 string(xhtml/html) | 章节 JSON 对象 | undefined(解析失败)
|
||||
export async function decryptChapter(
|
||||
encrypted: string,
|
||||
rawData?: any,
|
||||
config: DeviceConfig = defaultConfig,
|
||||
): Promise<string | unknown> {
|
||||
if (!encrypted) {
|
||||
@@ -29,7 +31,10 @@ export async function decryptChapter(
|
||||
{ name: "AES-CBC", iv },
|
||||
cryptoKey,
|
||||
data,
|
||||
).then((decrypted) => {
|
||||
).then(async (decrypted) => {
|
||||
if (rawData && rawData?.compress_status === 1) {
|
||||
decrypted = await gunzip(decrypted);
|
||||
}
|
||||
const decoder = new TextDecoder();
|
||||
const plain = decoder.decode(decrypted);
|
||||
if (plain.trim().startsWith("<")) { // xhtml || html
|
||||
|
||||
Reference in new issue
Block a user