Feat: ImageRequestInit (#979)

* add ImageRequestInit & fix Hako

* remove multisrc fetchFile

* remove plugins fetchFile

* update docs and template file
This commit is contained in:
nyagami
2024-06-08 20:09:33 +07:00
committed by GitHub
parent 6062f51460
commit 60d95fb8d2
85 changed files with 441 additions and 692 deletions
+5 -8
View File
@@ -9,6 +9,11 @@ class NovelBin implements Plugin.PluginBase {
icon = 'src/en/novelbin/icon.png';
site = 'https://binnovel.com/';
version = '1.0.1';
imageRequestInit?: Plugin.ImageRequestInit | undefined = {
headers: {
'referrer': this.site,
},
};
parseNovels(loadedCheerio: CheerioAPI) {
const novels: Plugin.NovelItem[] = [];
@@ -143,14 +148,6 @@ class NovelBin implements Plugin.PluginBase {
return this.parseNovels(loadedCheerio);
}
async fetchImage(url: string): Promise<string | undefined> {
return fetchFile(url, {
headers: {
'referrer': this.site,
},
});
}
filters = {
sort: {
value: 'popular-novels',