@@ -15,7 +15,7 @@ const BASE = "https://rainofsnow.com"
1515
1616export const RainOfSnowInfo : SourceInfo = {
1717 icon : "icon.png" ,
18- version : "1.3.3 " ,
18+ version : "1.4.0 " ,
1919 name : "RainOfSnow" ,
2020 author : "PythonCoderAS" ,
2121 authorWebsite : "https://github.com/PythonCoderAS" ,
@@ -95,11 +95,39 @@ export class RainOfSnow extends Source {
9595 } ) ;
9696 let response = await this . requestManager . schedule ( options , 1 ) ;
9797 let $ = this . cheerio . load ( response . data ) ;
98+ let more : boolean = true ;
99+ let pages : string [ ] = this . parser . parsePages ( $ , $ ( "div.bb-item[style=\"display: block;\"]" ) . first ( ) . toArray ( ) [ 0 ] )
100+ let more_data = this . parser . parseMoreData ( $ ) ;
101+ let offset ;
102+ if ( ! more_data ) {
103+ more = false ;
104+ } else {
105+ offset = more_data . offset ;
106+ }
107+ while ( more ) {
108+ const ajax : Request = createRequestObject ( {
109+ url : `${ BASE } /wp-admin/admin-ajax.php` ,
110+ method : 'POST' ,
111+ data : Object . entries ( this . urlEncodeObject ( {
112+ action : "my_repeater_show_more" ,
113+ post_id : Number ( more_data ?. post_id ) ,
114+ offset : Number ( offset ) ,
115+ nonce : more_data ?. nonce
116+ } ) ) . map ( e => e . join ( '=' ) ) . join ( '&' )
117+ // This is important because otherwise it gives me a 400, and I don't know why
118+ } ) ;
119+ let ajaxResponse = await this . requestManager . schedule ( ajax , 1 ) ;
120+ let ajaxData = typeof ajaxResponse . data === "string" ? JSON . parse ( ajaxResponse . data ) : ajaxResponse . data
121+ let $ajax = this . cheerio . load ( ajaxData . content ) ;
122+ pages = pages . concat ( this . parser . parsePages ( $ajax , $ajax . root ( ) . toArray ( ) [ 0 ] ) )
123+ more = ajaxData . more ;
124+ offset = ajaxData . offset ;
125+ }
98126 return createChapterDetails ( {
99127 id : chapterId ,
100128 longStrip : true ,
101129 mangaId : mangaId ,
102- pages : this . parser . parsePages ( $ )
130+ pages : pages
103131 } )
104132 }
105133
0 commit comments