Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitddf82d3

Browse files
committed
Fix parsing
1 parent006ffbd commitddf82d3

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

‎src/CatManga/CatManga.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BASE = "https://catmanga.org"
1515

1616
exportconstCatMangaInfo:SourceInfo={
1717
icon:"icon.png",
18-
version:"1.0.0",
18+
version:"1.0.1",
1919
name:"CatManga",
2020
author:"PythonCoderAS",
2121
authorWebsite:"https://github.com/PythonCoderAS",
@@ -38,7 +38,7 @@ export class CatManga extends Source {
3838
sectionCallback(createHomeSection({
3939
id:"featured",
4040
title:"Featured",
41-
items:this.parser.parseFeatured($)
41+
items:this.parser.parseFeatured($,BASE)
4242
}))
4343
sectionCallback(createHomeSection({
4444
id:"latest",

‎src/CatManga/CatMangaParser.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export class CatMangaParser {
2727
returnmangaTiles;
2828
}
2929

30-
parseFeatured($:CheerioStatic){
30+
parseFeatured($:CheerioStatic,base:string){
3131
constseen:string[]=[];
3232
constmangaTiles:MangaTile[]=[];
33-
$("ul.slider").map((index,element)=>{
33+
$("ul.slider li.slide").map((index,element)=>{
3434
constlink=$("a",element);
3535
constlinkId=link.attr("href")
3636
if(linkId){
@@ -42,7 +42,7 @@ export class CatMangaParser {
4242
title:createIconText({
4343
text:$("h1",element).first().text().trim()
4444
}),
45-
image:$("img",element).attr("src")||"",
45+
image:base+$("img",element).attr("src")||"",
4646
primaryText:createIconText({
4747
text:$("div p",$("a",element).parent()).first().text().trim()
4848
})
@@ -61,13 +61,18 @@ export class CatMangaParser {
6161
parseChapterList($:CheerioStatic,mangaId:string){
6262
constchapters:Chapter[]=[];
6363
$('a[class^="chaptertile_element"]').map((index,element)=>{
64-
constchapNum=Number($("p",element).first().text().replace("Chapter ",""));
64+
constchapNumString=$("p",element).first().text().replace("Chapter ","")
65+
constchapNum=Number(chapNumString)||0;
66+
lettitle:string|null=null;
67+
if(chapNum===0){
68+
title=chapNumString
69+
}
6570
constdata:Chapter={
6671
chapNum:chapNum,
6772
id:String(chapNum),
6873
langCode:LanguageCode.ENGLISH,
6974
mangaId:mangaId,
70-
name:$("p",element).last().text().trim()
75+
name:title||$("p",element).last().text().trim()
7176
};
7277
chapters.push(createChapter(data));
7378
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp