Plugins fixed (#903)
* test * fast fix * fix * fix * Update ranobelib.ts
This commit is contained in:
@@ -25,7 +25,7 @@ class RulatePlugin implements Plugin.PluginBase {
|
||||
this.name = metadata.sourceName;
|
||||
this.icon = `multisrc/rulate/${metadata.id.toLowerCase()}/icon.png`;
|
||||
this.site = metadata.sourceSite;
|
||||
this.version = '1.0.0';
|
||||
this.version = '1.0.1';
|
||||
this.filters = metadata.filters;
|
||||
}
|
||||
|
||||
@@ -80,12 +80,10 @@ class RulatePlugin implements Plugin.PluginBase {
|
||||
formData.append('path', novelPath);
|
||||
formData.append('ok', 'Да');
|
||||
|
||||
await fetchApi(result.url, {
|
||||
result = await fetchApi(result.url, {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
});
|
||||
|
||||
result = await fetchApi(this.site + novelPath);
|
||||
}
|
||||
const body = await result.text();
|
||||
const loadedCheerio = parseHTML(body);
|
||||
@@ -183,14 +181,13 @@ class RulatePlugin implements Plugin.PluginBase {
|
||||
let result = await fetchApi(this.site + chapterPath);
|
||||
if (result.url.includes('mature?path=')) {
|
||||
const formData = new FormData();
|
||||
formData.append('path', chapterPath.split('/').slice(0, 3).join('/'));
|
||||
formData.append('ok', 'Да');
|
||||
|
||||
await fetchApi(result.url, {
|
||||
result = await fetchApi(result.url, {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
});
|
||||
|
||||
result = await fetchApi(this.site + chapterPath);
|
||||
}
|
||||
const body = await result.text();
|
||||
const loadedCheerio = parseHTML(body);
|
||||
@@ -208,12 +205,11 @@ class RulatePlugin implements Plugin.PluginBase {
|
||||
|
||||
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {
|
||||
const novels: Plugin.NovelItem[] = [];
|
||||
const result = await fetchApi(
|
||||
const result: response[] = await fetchApi(
|
||||
this.site + '/search/autocomplete?query=' + searchTerm,
|
||||
);
|
||||
const json = (await result.json()) as response[];
|
||||
).then(res => res.json());
|
||||
|
||||
json.forEach(novel => {
|
||||
result.forEach(novel => {
|
||||
const name = novel.title_one + ' / ' + novel.title_two;
|
||||
if (!novel.url) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user