@wahaha216/koishi-plugin-jmcomic
Version:
下载JM本子,无需python。支持pdf、zip加密。
70 lines (69 loc) • 2.56 kB
TypeScript
import { Config } from "..";
import { Logger, HTTP } from "koishi";
import { IJMUser, IJMSearchResult } from "../types/JMClient";
import { JMClientAbstract } from "../abstract/JMClientAbstract";
import { JMAppPhoto } from "./JMAppPhoto";
import { JMAppAlbum } from "./JMAppAlbum";
import { JMPhotoAbstract } from "../abstract/JMPhotoAbstract";
export declare class JMAppClient extends JMClientAbstract {
static APP_VERSION: string;
static APP_TOKEN_SECRET: string;
static APP_TOKEN_SECRET_2: string;
static APP_DATA_SECRET: string;
/**
* koishi 配置项
*/
private config;
/**
* koishi 日志
*/
private logger;
/**
* koishi http
*/
private http;
constructor(root: string, http: HTTP, config: Config, logger: Logger);
/**
* 登录,未完成
* @param username 用户名
* @param password 密码
* @returns 用户信息
*/
login(username: string, password: string): Promise<IJMUser>;
search(keyword: string): Promise<IJMSearchResult>;
getAlbumById(id: string): Promise<JMAppAlbum>;
getPhotoById(id: string): Promise<JMAppPhoto>;
downloadByAlbum(album: JMAppAlbum): Promise<void>;
downloadByPhoto(photo: JMAppPhoto, type?: "photo" | "album", albumId?: string, single?: boolean): Promise<void>;
decodeByPhoto(photo: JMPhotoAbstract, type?: "photo" | "album", albumId?: string, single?: boolean): Promise<void>;
albumToPdf(album: JMAppAlbum, password?: string): Promise<string | string[]>;
photoToPdf(photo: JMAppPhoto, pdfName: string, type?: "photo" | "album", albumId?: string, single?: boolean, password?: string): Promise<string>;
albumToZip(album: JMAppAlbum, password?: string, level?: number): Promise<string>;
photoToZip(photo: JMPhotoAbstract, zipName: string, password?: string, level?: number): Promise<string>;
/**
* 获取时间戳
* @returns 时间戳
*/
getTimeStamp(): number;
/**
* 获取Scramble ID
* @param id JM本子ID
*/
requestScrambleId(id: number): Promise<number>;
/**
* 获取请求时所需的token和tokenparam
* @param timestamp 时间戳
* @param version APP版本
* @param secret 密钥
* @returns 请求时所需的token和tokenparam
*/
private getTokenAndTokenParam;
/**
* 解密加密字符串
* @param timestamp 请求时传递的时间戳
* @param base64 待解密的字符串
* @param secret
* @returns 解密结果,JSON
*/
private decodeBase64;
}