Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bilibili: update decryption #1027

Merged
merged 6 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions web/src/engine/websites/BilibiliManhua.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
import type { Chapter, Manga, Page } from '../providers/MangaPlugin';
import { DecoratableMangaScraper, type MangaPlugin } from '../providers/MangaPlugin';
import type { Priority } from '../taskpool/DeferredTask';
import type { Priority } from '../taskpool/TaskPool';
type PageParameters = {
drm: DRMProvider;
};
declare class DRMProvider {
private static readonly profiles;
private static readonly sizeSalt;
private static readonly keyExchangeAlgorithm;
private readonly keyExchange;
/**
* Get the Base64 encoded raw public key used for boxing the symmetric key
*/
GetPublicKey(): Promise<string>;
private GetPrivateKey;
private DeriveLegacyDecryptionKey;
private DeriveDecryptionKey;
/**
* ...
* @param contextData - Base64 encoded cipher context data for decryption (containing the initialization-vector or counter-block)
* @param containerData - Contains the encrypted image data and a secret box with information about the symmetric decryption algorithm and key
*/
ExtractImageData(contextData: string, containerData: ArrayBuffer): Promise<ArrayBuffer>;
}
export default class extends DecoratableMangaScraper {
private readonly mangasSequentialTaskPool;
constructor();
get Icon(): any;
ValidateMangaURL(url: string): boolean;
FetchManga(provider: MangaPlugin, url: string): Promise<Manga>;
FetchMangas(provider: MangaPlugin): Promise<Manga[]>;
private GetMangasFromPage;
FetchChapters(manga: Manga): Promise<Chapter[]>;
FetchPages(chapter: Chapter): Promise<Page[]>;
FetchImage(page: Page, priority: Priority, signal: AbortSignal): Promise<Blob>;
private DecryptImage;
FetchPages(chapter: Chapter): Promise<Page<PageParameters>[]>;
FetchImage(page: Page<PageParameters>, priority: Priority, signal: AbortSignal): Promise<Blob>;
private GetImageSizeByQuality;
private FetchTwirp;
}
export {};
Loading