Skip to content

Commit e7d99be

Browse files
authored
fix: Novelight Chapter URLs (#1950)
1 parent fef50e7 commit e7d99be

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

plugins/english/novelight.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { storage } from '@libs/storage';
1010
class Novelight implements Plugin.PagePlugin {
1111
id = 'novelight';
1212
name = 'Novelight';
13-
version = '1.1.2';
13+
version = '1.1.3';
1414
icon = 'src/en/novelight/icon.png';
1515
site = 'https://novelight.net/';
1616

@@ -187,7 +187,10 @@ class Novelight implements Plugin.PagePlugin {
187187
} catch (error) {}
188188

189189
const chapterName = isLocked ? '🔒 ' + title : title;
190-
const chapterUrl = ele.attribs.href;
190+
let chapterUrl = ele.attribs.href;
191+
if (chapterUrl.charAt(0) == '/') {
192+
chapterUrl = chapterUrl.substring(1);
193+
}
191194
chapter.push({
192195
name: chapterName,
193196
path: chapterUrl,
@@ -201,6 +204,9 @@ class Novelight implements Plugin.PagePlugin {
201204
}
202205

203206
async parseChapter(chapterPath: string): Promise<string> {
207+
if (chapterPath.charAt(0) == '/') {
208+
chapterPath = chapterPath.substring(1);
209+
}
204210
const rawBody = await fetchApi(this.site + chapterPath).then(r => {
205211
const res = r.text();
206212
return res;

0 commit comments

Comments
 (0)