Skip to content

Commit

Permalink
fixed mangadex page numbers (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
riimuru authored Nov 13, 2022
1 parent e959ddb commit 9900189
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/providers/manga/mangadex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MangaDex extends MangaParser {
for (const id of res.data.chapter.data) {
pages.push({
img: `${res.data.baseUrl}/data/${res.data.chapter.hash}/${id}`,
page: parseInt(id.split('-')[0]),
page: parseInt(/x(.*)-/g.exec(id)![1]),
});
}
return pages;
Expand Down Expand Up @@ -152,4 +152,11 @@ class MangaDex extends MangaParser {
};
}

(async () => {
const mangadex = new MangaDex();

const pages = await mangadex.fetchChapterPages('e1bdc8ef-54fa-499f-8553-0aef745e1230');
console.log(pages);
})();

export default MangaDex;

0 comments on commit 9900189

Please sign in to comment.