UNPKG

@wahaha216/koishi-plugin-jmcomic

Version:

下载JM本子,无需python。支持pdf、zip加密。

67 lines (66 loc) 2.76 kB
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"; import { JMAppBlog } from "./JMAppBlog"; import Puppeteer from "koishi-plugin-puppeteer"; export declare class JMAppClient extends JMClientAbstract { /** * koishi 配置项 */ private config; /** * koishi 日志 */ private logger; /** * koishi http */ private http; private puppeteer; constructor(root: string, http: HTTP, config: Config, logger: Logger, puppeteer: Puppeteer); /** * 登录,未完成 * @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>; getBlogById(id: string): Promise<JMAppBlog>; downloadByAlbum(album: JMAppAlbum): Promise<void>; downloadByPhoto(photo: JMAppPhoto, type?: "photo" | "album", albumId?: string, single?: boolean): Promise<void>; downloadFirstImageByAlbum(album: JMAppAlbum): Promise<string>; downloadAndDecodeFirstImageByPhoto(photo: JMAppPhoto, type?: "photo" | "album", albumId?: string, single?: boolean): Promise<string>; 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>; blogToPdf(blog: JMAppBlog, password?: string): Promise<string>; private writeBlogPdf; albumToZip(album: JMAppAlbum, password?: string, level?: number): Promise<string>; photoToZip(photo: JMPhotoAbstract, zipName: string, password?: string, level?: number): Promise<string>; blogToZip(blog: JMAppBlog, 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; }