Fix special characters breaking search in most sources (#1557)

This commit is contained in:
Adam Kemish
2025-03-15 15:35:31 +08:00
committed by GitHub
parent 3a10e24545
commit ea7965bdda
28 changed files with 103 additions and 73 deletions
+6 -2
View File
@@ -25,7 +25,7 @@ class IfreedomPlugin implements Plugin.PluginBase {
this.name = metadata.sourceName;
this.icon = `multisrc/ifreedom/${metadata.id.toLowerCase()}/icon.png`;
this.site = metadata.sourceSite;
this.version = '1.0.1';
this.version = '1.0.2';
this.filters = metadata.filters;
}
@@ -166,7 +166,11 @@ class IfreedomPlugin implements Plugin.PluginBase {
page: number | undefined = 1,
): Promise<Plugin.NovelItem[]> {
const url =
this.site + '/vse-knigi/?searchname=' + searchTerm + '&bpage=' + page;
this.site +
'/vse-knigi/?searchname=' +
encodeURIComponent(searchTerm) +
'&bpage=' +
page;
const result = await fetchApi(url).then(res => res.text());
const loadedCheerio = parseHTML(result);