Feat: resolveUrl, add neobook (#803)
* neobook * add qs * fix * / * fix * expandURL -> resolveUrl * fix Agitoon * Update ranobelib.ts --------- Co-authored-by: nyagami <hoangquan05112002@gmail.com>
This commit is contained in:
@@ -87,3 +87,14 @@ export const parseChapter = async (
|
||||
|
||||
export const fetchImage = async (pluginRequirePath: string, url: string) =>
|
||||
(await getPlugin(pluginRequirePath))?.fetchImage(url);
|
||||
|
||||
export const resolveUrl = async (
|
||||
pluginRequirePath: string,
|
||||
path: string,
|
||||
isNovel?: boolean,
|
||||
) => {
|
||||
const plugin = await getPlugin(pluginRequirePath);
|
||||
if (!plugin) return path;
|
||||
if (plugin.resolveUrl) return plugin.resolveUrl(path, isNovel);
|
||||
return plugin.site + path;
|
||||
};
|
||||
Reference in New Issue
Block a user