Add TopLiba (#1003)

* test

* cleanup

deleted unused `fetchFile` import
replaced fetch with `fetchApi`

* eslint

* fix

* fix multi

* Hmm, what to do next.

* test URLSearchParams

* fix
This commit is contained in:
Rider21
2024-06-30 07:28:11 +03:00
committed by GitHub
parent 938e3b16a3
commit fae73534dd
121 changed files with 10534 additions and 8079 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import { Plugin } from '@typings/plugin';
import { fetchApi, fetchFile } from '@libs/fetch';
import { fetchApi } from '@libs/fetch';
import { FilterTypes, Filters } from '@libs/filterInputs';
import { load as parseHTML } from 'cheerio';
@@ -25,7 +25,7 @@ class WTRLAB implements Plugin.PluginBase {
link += `&page=${page}`; //TODO Genre & Advance Searching Filter. Ez to implement, too much manual work, too lazy.
if (showLatestNovels) {
const response = await fetch('https://wtr-lab.com/api/home/recent', {
const response = await fetchApi(this.site + 'api/home/recent', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -148,7 +148,7 @@ class WTRLAB implements Plugin.PluginBase {
}
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {
const response = await fetch(this.site + 'api/search', {
const response = await fetchApi(this.site + 'api/search', {
headers: {
'Content-Type': 'application/json',
Referer: this.site + this.sourceLang,