@@ -6,6 +6,7 @@ class WetriedTlsParser extends Parser {
66 constructor ( ) {
77 super ( ) ;
88 this . minimumThrottle = 2000 ;
9+ this . chaptersSourceTitleMap = new Map ( ) ;
910 }
1011
1112 async getChapterUrls ( ) {
@@ -21,10 +22,12 @@ class WetriedTlsParser extends Parser {
2122 const seriesUrl =
2223 "https://wetriedtls.com/series/" + chapter . series . series_slug ;
2324
24- return {
25+ const mapObj = {
2526 sourceUrl : `${ seriesUrl } /${ chapter . chapter_slug } ` ,
2627 title : chapter . chapter_title ,
2728 } ;
29+ this . chaptersSourceTitleMap . set ( mapObj . sourceUrl , mapObj . title ) ;
30+ return mapObj ;
2831 } ) ;
2932
3033 return chapters ;
@@ -50,7 +53,6 @@ class WetriedTlsParser extends Parser {
5053
5154 this . id = novelData . id ;
5255 this . title = novelData . title ;
53- this . author = novelData . author ;
5456 this . thumbnail = novelData . thumbnail ;
5557 this . description = novelData . description ;
5658 return ;
@@ -80,7 +82,9 @@ class WetriedTlsParser extends Parser {
8082 ( [ type , data ] ) =>
8183 type === 1 &&
8284 typeof data === "string" &&
83- / < p > | < d i v > | < b r > | < \/ ? s t r o n g > / . test ( data ) && // looks like HTML
85+ / < p \b [ ^ > ] * > | < d i v \b [ ^ > ] * > | < b r \b [ ^ > ] * > | < \/ ? s t r o n g \b [ ^ > ] * > / i. test (
86+ data
87+ ) && // looks like HTML
8488 data . length > 1000 // avoid short status chunks
8589 ) ;
8690
@@ -104,8 +108,17 @@ class WetriedTlsParser extends Parser {
104108 return this . title . trim ( ) ;
105109 }
106110
107- extractAuthor ( ) {
108- return this . author ;
111+ extractAuthor ( dom ) {
112+ if ( ! dom ) return super . extractAuthor ( dom ) ;
113+
114+ const authorLabel = Array . from (
115+ dom . querySelectorAll ( "span.text-muted-foreground" )
116+ ) . find ( ( el ) => el . innerText . trim ( ) === "Author" ) ;
117+ const authorValue = authorLabel ?. parentElement ?. querySelector (
118+ ":scope span:last-child"
119+ ) ;
120+
121+ return authorValue ?. innerText || super . extractAuthor ( dom ) ;
109122 }
110123
111124 extractDescription ( ) {
@@ -115,4 +128,8 @@ class WetriedTlsParser extends Parser {
115128 findCoverImageUrl ( ) {
116129 return this . thumbnail ;
117130 }
131+
132+ findChapterTitle ( dom ) {
133+ return this . chaptersSourceTitleMap . get ( dom . baseURI ) ;
134+ }
118135}
0 commit comments