@@ -31,7 +31,7 @@ class WtrlabParser extends Parser {
3131 try {
3232 let terms = ( await HttpClient . fetchJson ( "https://wtr-lab.com/api/v2/user/config" ) ) . json ;
3333 terms = terms ?. config ?. terms . filter ( a => ( a [ 4 ] == null ) || ( a [ 4 ] . includes ( serie_id ) ) ) ;
34- terms = terms . map ( a => ( { from :a [ 2 ] . split ( "|" ) , to :a [ 1 ] } ) ) ;
34+ terms = terms . map ( a => ( { from :a [ 2 ] . split ( "|" ) . filter ( a => a != "" ) , to :a [ 1 ] } ) ) ;
3535 let index = 0 ;
3636 this . termsuser = [ ] ;
3737 for ( let i = 0 ; i < terms . length ; i ++ ) {
@@ -142,6 +142,9 @@ class WtrlabParser extends Parser {
142142 return this . buildChapter ( json , url ) ;
143143 }
144144 isCustomError ( response ) {
145+ if ( response . json ?. code == "CHAPTER_LOCKED" ) {
146+ return true ;
147+ }
145148 if ( response . json . data ?. data ?. body ?false :true ) {
146149 return true ;
147150 }
@@ -152,6 +155,16 @@ class WtrlabParser extends Parser {
152155 }
153156
154157 setCustomErrorResponse ( url , wrapOptions , checkedresponse ) {
158+ if ( checkedresponse . json ?. code == "CHAPTER_LOCKED" ) {
159+ let newresp = { } ;
160+ newresp . wrapOptions = wrapOptions ;
161+ newresp . response = { } ;
162+ newresp . response . url = this . PostToUrl ( checkedresponse . response . url , JSON . parse ( wrapOptions . fetchOptions . body ) ) ;
163+ newresp . response . status = 999 ;
164+ newresp . response . retryDelay = [ ] ;
165+ newresp . errorMessage = "Fetch of URL '" + newresp . response . url + "' failed.\nThe Chapter isn't Ai translated." ;
166+ return newresp ;
167+ }
155168 if ( checkedresponse . json . requireTurnstile || checkedresponse . json . code == 1401 ) {
156169 let newresp = { } ;
157170 newresp . url = url ;
0 commit comments