@@ -15,7 +15,7 @@ const BASE = "https://rainofsnow.com"
15
15
16
16
export const RainOfSnowInfo : SourceInfo = {
17
17
icon : "icon.png" ,
18
- version : "1.3.3 " ,
18
+ version : "1.4.0 " ,
19
19
name : "RainOfSnow" ,
20
20
author : "PythonCoderAS" ,
21
21
authorWebsite : "https://github.com/PythonCoderAS" ,
@@ -95,11 +95,39 @@ export class RainOfSnow extends Source {
95
95
} ) ;
96
96
let response = await this . requestManager . schedule ( options , 1 ) ;
97
97
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
+ }
98
126
return createChapterDetails ( {
99
127
id : chapterId ,
100
128
longStrip : true ,
101
129
mangaId : mangaId ,
102
- pages : this . parser . parsePages ( $ )
130
+ pages : pages
103
131
} )
104
132
}
105
133
0 commit comments