@@ -30,11 +30,14 @@ class MVLEMPYRPlugin implements Plugin.PluginBase {
3030 name = 'MVLEMPYR' ;
3131 icon = 'src/en/mvlempyr/icon.png' ;
3232 site = 'https://www.mvlempyr.io/' ;
33- version = '1.0.14 ' ;
33+ version = '1.0.15 ' ;
3434
3535 _chapSite = 'https://chap.heliosarchive.online/' ;
3636 _allNovels : ( Plugin . NovelItem & ExtraNovelData ) [ ] | undefined ;
3737 _allNovelsPromise : Promise < ( Plugin . NovelItem & ExtraNovelData ) [ ] > | undefined ;
38+ private headers = {
39+ 'Cache-Control' : 'no-store' ,
40+ } ;
3841
3942 checkCaptcha ( loadedCheerio : CheerioAPI ) {
4043 const title = loadedCheerio ( 'title' ) . text ( ) ;
@@ -100,23 +103,24 @@ class MVLEMPYRPlugin implements Plugin.PluginBase {
100103 ) ;
101104 return u ;
102105 }
103-
104106 async parseNovel ( novelPath : string ) : Promise < Plugin . SourceNovel > {
105107 const url = this . site + novelPath ;
106- const result = await fetchApi ( url ) ;
108+ const result = await fetchApi ( url , { headers : this . headers } ) ;
109+
107110 const body = await result . text ( ) ;
108111
109112 const loadedCheerio = parseHTML ( body ) ;
110-
111113 this . checkCaptcha ( loadedCheerio ) ;
112114
113115 const code = loadedCheerio ( '#novel-code' ) . text ( ) ;
114116 const newNovelId = this . convertNovelId ( BigInt ( parseInt ( code ) ) ) ;
117+
115118 const firstPostsReq = await fetchApi (
116119 this . _chapSite +
117120 'wp-json/wp/v2/posts?tags=' +
118121 newNovelId +
119122 '&per_page=500&page=1' ,
123+ { headers : this . headers } ,
120124 ) ;
121125
122126 const pages = parseInt ( firstPostsReq . headers . get ( 'X-Wp-Totalpages' ) ) || 1 ;
@@ -134,6 +138,7 @@ class MVLEMPYRPlugin implements Plugin.PluginBase {
134138 newNovelId +
135139 '&per_page=500&page=' +
136140 page ,
141+ { headers : this . headers } ,
137142 ) . then ( res => res . json ( ) ) ,
138143 ) ,
139144 ) ) ,
0 commit comments