Yokan / rebuild
Course 1 8624561

novelupdates-0.9.9.js

composeApp/src/desktopTest/resources/lnreader/novelupdates-0.9.9.js

test / fixture1 lines
1var e=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function l(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,s)}c((n=n.apply(e,t||[])).next())}))},t=this&&this.__generator||function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=s(0),l.throw=s(1),l.return=s(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(exports,"__esModule",{value:!0});var r=require("cheerio"),n=require("@libs/fetch"),a=require("@libs/filterInputs"),o=function(){function o(){this.id="novelupdates",this.name="Novel Updates",this.version="0.9.9",this.icon="src/en/novelupdates/icon.png",this.customCSS="src/en/novelupdates/customCSS.css",this.site="https://www.novelupdates.com/",this.filters={sort:{label:"Sort Results By",value:"popmonth",options:[{label:"Popular (Month)",value:"popmonth"},{label:"Popular (All)",value:"popular"},{label:"Last Updated",value:"sdate"},{label:"Rating",value:"srate"},{label:"Rank",value:"srank"},{label:"Reviews",value:"sreview"},{label:"Chapters",value:"srel"},{label:"Title",value:"abc"},{label:"Readers",value:"sread"},{label:"Frequency",value:"sfrel"}],type:a.FilterTypes.Picker},order:{label:"Order (Not for Popular)",value:"desc",options:[{label:"Descending",value:"desc"},{label:"Ascending",value:"asc"}],type:a.FilterTypes.Picker},storyStatus:{label:"Story Status (Translation)",value:"",options:[{label:"All",value:""},{label:"Completed",value:"2"},{label:"Ongoing",value:"3"},{label:"Hiatus",value:"4"}],type:a.FilterTypes.Picker},genre_operator:{label:"Genre (And/Or) (Not for Popular)",value:"and",options:[{label:"And",value:"and"},{label:"Or",value:"or"}],type:a.FilterTypes.Picker},genres:{label:"Genres",type:a.FilterTypes.ExcludableCheckboxGroup,value:{include:[],exclude:[]},options:[{label:"Action",value:"8"},{label:"Adult",value:"280"},{label:"Adventure",value:"13"},{label:"Comedy",value:"17"},{label:"Drama",value:"9"},{label:"Ecchi",value:"292"},{label:"Fantasy",value:"5"},{label:"Gender Bender",value:"168"},{label:"Harem",value:"3"},{label:"Historical",value:"330"},{label:"Horror",value:"343"},{label:"Josei",value:"324"},{label:"Martial Arts",value:"14"},{label:"Mature",value:"4"},{label:"Mecha",value:"10"},{label:"Mystery",value:"245"},{label:"Psychoical",value:"486"},{label:"Romance",value:"15"},{label:"School Life",value:"6"},{label:"Sci-fi",value:"11"},{label:"Seinen",value:"18"},{label:"Shoujo",value:"157"},{label:"Shoujo Ai",value:"851"},{label:"Shounen",value:"12"},{label:"Shounen Ai",value:"1692"},{label:"Slice of Life",value:"7"},{label:"Smut",value:"281"},{label:"Sports",value:"1357"},{label:"Supernatural",value:"16"},{label:"Tragedy",value:"132"},{label:"Wuxia",value:"479"},{label:"Xianxia",value:"480"},{label:"Xuanhuan",value:"3954"},{label:"Yaoi",value:"560"},{label:"Yuri",value:"922"}]},language:{label:"Language",value:[],options:[{label:"Chinese",value:"495"},{label:"Filipino",value:"9181"},{label:"Indonesian",value:"9179"},{label:"Japanese",value:"496"},{label:"Khmer",value:"18657"},{label:"Korean",value:"497"},{label:"Malaysian",value:"9183"},{label:"Thai",value:"9954"},{label:"Vietnamese",value:"9177"}],type:a.FilterTypes.CheckboxGroup},novelType:{label:"Novel Type (Not for Popular)",value:[],options:[{label:"Light Novel",value:"2443"},{label:"Published Novel",value:"26874"},{label:"Web Novel",value:"2444"}],type:a.FilterTypes.CheckboxGroup},reading_list_operator:{label:"Reading List (Include/Exclude) (Not for Popular)",value:"include",options:[{label:"Include",value:"include"},{label:"Exclude",value:"exclude"}],type:a.FilterTypes.Picker},reading_lists:{label:"Reading Lists (Not for Popular)",value:[],options:[{label:"All Reading Lists",value:"-1"}],type:a.FilterTypes.CheckboxGroup}}}return o.prototype.parseNovels=function(e){var t=this,r=[];return e("div.search_main_box_nu").each((function(n,a){var o=e(a).find(".search_title > a").attr("href");o&&r.push({name:e(a).find(".search_title > a").text(),cover:e(a).find("img").attr("src"),path:o.replace(t.site,"")})})),r},o.prototype.popularNovels=function(a,o){return e(this,arguments,void 0,(function(e,a){var o,l,s,c,i,u,p,h=a.showLatestNovels,d=a.filters;return t(this,(function(t){switch(t.label){case 0:return o=this.site,h?o+="series-finder/?sf=1&sort=sdate&order=desc":"popmonth"===(null==d?void 0:d.sort.value)||"popular"===(null==d?void 0:d.sort.value)?o+="series-ranking/?rank="+d.sort.value:(o+="series-finder/?sf=1",((null===(c=null==d?void 0:d.genres.value.include)||void 0===c?void 0:c.length)||(null===(i=null==d?void 0:d.genres.value.exclude)||void 0===i?void 0:i.length))&&(o+="&mgi="+d.genre_operator.value),(null==d?void 0:d.novelType.value.length)&&(o+="&nt="+d.novelType.value.join(",")),(null==d?void 0:d.reading_lists.value.length)&&(o+="&hd="+(null==d?void 0:d.reading_lists.value.join(",")),o+="&mRLi="+(null==d?void 0:d.reading_list_operator.value)),o+="&sort="+(null==d?void 0:d.sort.value),o+="&order="+(null==d?void 0:d.order.value)),(null==d?void 0:d.language.value.length)&&(o+="&org="+d.language.value.join(",")),(null===(u=null==d?void 0:d.genres.value.include)||void 0===u?void 0:u.length)&&(o+="&gi="+d.genres.value.include.join(",")),(null===(p=null==d?void 0:d.genres.value.exclude)||void 0===p?void 0:p.length)&&(o+="&ge="+d.genres.value.exclude.join(",")),(null==d?void 0:d.storyStatus.value)&&(o+="&ss="+d.storyStatus.value),o+="&pg="+e,[4,(0,n.fetchApi)(o)];case 1:return[4,t.sent().text()];case 2:return l=t.sent(),s=(0,r.load)(l),[2,this.parseNovels(s)]}}))}))},o.prototype.parseNovel=function(a){return e(this,void 0,void 0,(function(){var e,o,l,s,c,i,u,p,h,d,f,v,b,m=this;return t(this,(function(t){switch(t.label){case 0:return e=this.site+a,[4,(0,n.fetchApi)(e)];case 1:return[4,t.sent().text()];case 2:return o=t.sent(),l=(0,r.load)(o),(s={path:a,name:l(".seriestitlenu").text()||"Untitled",cover:l(".wpb_wrapper img").attr("src"),chapters:[]}).author=l("#authtag").map((function(e,t){return l(t).text().trim()})).toArray().join(", "),s.genres=l("#seriesgenre").children("a").map((function(e,t){return l(t).text()})).toArray().join(","),s.status=l("#editstatus").text().includes("Ongoing")?"Ongoing":"Completed",c=l("#showtype").text().trim(),i=l("#editdescription").text().trim(),s.summary=i+"\n\nType: ".concat(c),(u=null===(b=l(".seriesother .uvotes").text().match(/(\d+\.\d+) \/ \d+\.\d+/))||void 0===b?void 0:b[1])&&(s.rating=parseFloat(u)),p=l("input#mypostid").attr("value"),(h=new FormData).append("action","nd_getchapters"),h.append("mygrr","0"),h.append("mypostid",p),[4,(0,n.fetchApi)("".concat(this.site,"wp-admin/admin-ajax.php"),{method:"POST",body:h}).then((function(e){return e.text()}))];case 3:return d=t.sent(),f=(0,r.load)(d),v=[],f("li.sp_li_chp").each((function(e,t){var r=f(t).text().replace("v","volume ").replace("c"," chapter ").replace("part","part ").replace("ss","SS").replace(/\b\w/g,(function(e){return e.toUpperCase()})).trim(),n="https:"+f(t).find("a").first().next().attr("href");n&&v.push({name:r,path:n.replace(m.site,"")})})),s.chapters=v.reverse(),[2,s]}}))}))},o.prototype.getLocation=function(e){var t=e.match(/^(https?:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);return t&&"".concat(t[1],"//").concat(t[3])},o.prototype.getChapterBody=function(a,o,l){return e(this,void 0,void 0,(function(){var e,s,c,i,u,p,h,d,f,v,b,m,g,y,w,x,_,A,k,C,E,T,j,S,N,F,L,P,z,O,I,R,M,G,H,B,U,J,q,W,$,D,K,X,Y,V,Q,Z,ee,te,re,ne,ae,oe,le,se,ce,ie,ue,pe,he,de,fe,ve,be,me,ge,ye,we,xe,_e,Ae,ke,Ce,Ee,Te,je,Se,Ne,Fe,Le,Pe,ze;return t(this,(function(t){switch(t.label){case 0:switch(e="",s="",c="",i=["app","blogspot","casper","wordpress","www"],u=o.find((function(e){return!i.includes(e)})),u){case"akutranslations":return[3,1];case"asuratls":return[3,5];case"brightnovels":return[3,6];case"canonstory":return[3,7];case"daoist":return[3,11];case"dreamy-translations":return[3,12];case"fictionread":return[3,13];case"genesistudio":return[3,14];case"greenz":return[3,19];case"hiraethtranslation":return[3,25];case"hostednovel":return[3,26];case"infinitenoveltranslations":return[3,27];case"inoveltranslation":return[3,31];case"isotls":return[3,32];case"ko-fi":return[3,33];case"leafstudio":return[3,34];case"machineslicedbread":return[3,35];case"mirilu":return[3,39];case"mythoriatales":return[3,40];case"novelplex":return[3,45];case"novelshub":return[3,46];case"novelworldtranslations":return[3,52];case"patreon":return[3,53];case"r-p-d":return[3,54];case"raeitranslations":return[3,63];case"rainofsnow":return[3,65];case"readingpia":return[3,66];case"redoxtranslation":return[3,67];case"sacredtexttranslations":return[3,69];case"scribblehub":return[3,70];case"skydemonorder":return[3,71];case"stabbingwithasyringe":return[3,72];case"tinytranslation":return[3,76];case"tumblr":return[3,77];case"vampiramtl":return[3,78];case"wattpad":return[3,82];case"webnovel":return[3,83];case"wetriedtls":return[3,84];case"wuxiaworld":return[3,85];case"yoru":return[3,86]}return[3,89];case 1:return t.trys.push([1,4,,5]),te=l.replace("/novel","/api/novel"),[4,(0,n.fetchApi)(te)];case 2:return[4,(ye=t.sent()).json()];case 3:if(!(null==(Ce=t.sent())?void 0:Ce.content))throw new Error("Invalid API response structure.");return s=Ce.content.trim().split(/\n+/).map((function(e){return e.trim()})).filter((function(e){return e.length>0})).map((function(e){return"<p>".concat(e,"</p>")})).join("\n"),[3,89];case 4:throw p=t.sent(),new Error("Failed to parse AkuTranslations chapter: ".concat(p));case 5:return ge=a(".post-body div b").first(),e=ge.text(),ge.remove(),s=a(".post-body").html(),[3,89];case 6:h=function(e){[".ad-container","script","style"].forEach((function(t){return e(t).remove()}));var t,n=e("#app").attr("data-page");if(!n)throw new Error("data-page attribute not found on Bright Novels.");try{t=JSON.parse(n)}catch(e){throw new Error("Failed to parse data-page JSON for Bright Novels.")}var a=t.props.chapter.title,o=t.props.chapter.content,l=(0,r.load)(o);return l("script, style").remove(),o=l.html(),"<h2>".concat(a,"</h2><hr><br>").concat(o)};try{c=h(a)}catch(e){d=a("#app").html()||a("body").html()||"",(f=(0,r.load)(d))("script, style").remove(),d=f.html(),c=d}return[3,89];case 7:if(t.trys.push([7,10,,11]),(ve=l.split("/")).length<7)throw new Error("Invalid chapter URL structure");return Z=ve[4],ee=ve[6],ke="".concat(ve[0],"//").concat(ve[2],"/api/public/chapter-by-slug/").concat(Z,"/").concat(ee),[4,(0,n.fetchApi)(ke)];case 8:return[4,(ye=t.sent()).json()];case 9:if(Ce=t.sent(),!(null===(Ee=null==Ce?void 0:Ce.data)||void 0===Ee?void 0:Ee.currentChapter))throw new Error("Invalid API response structure.");return m=Ce.data.currentChapter,re=m.chapterNumber,Y=m.title,A=m.content,ge="Chapter ".concat(re),e=Y?"".concat(ge," - ").concat(Y):ge,s=A.replace(/\n/g,"<br>"),[3,89];case 10:throw v=t.sent(),new Error("Failed to parse Canon Story chapter: ".concat(v));case 11:return e=a(".chapter__title").first().text(),a("span.patreon-lock-icon").remove(),a("img[data-src]").each((function(e,t){var r=a(t),n=r.attr("data-src");n&&(r.attr("src",n),r.removeAttr("data-src"))})),s=a(".chapter__content").html(),[3,89];case 12:return e=a("h1 > span").first().text(),(A=a(".chapter-content > div").first()).children("em").wrap("<p></p>"),s=A.html(),[3,89];case 13:return[".content > style",".highlight-ad-container",".meaning",".word"].forEach((function(e){return a(e).remove()})),e=a(".title-image span").first().text(),a(".content").children().each((function(e,t){var r;if(null===(r=a(t).attr("id"))||void 0===r?void 0:r.includes("Chaptertitle-info"))return a(t).remove(),!1})),s=a(".content").html(),[3,89];case 14:ke="".concat(l,"/__data.json?x-sveltekit-invalidated=001"),t.label=15;case 15:return t.trys.push([15,17,,18]),[4,(0,n.fetchApi)(ke).then((function(e){return e.json()}))];case 16:for(x in Ce=t.sent(),b=Ce.nodes,m=b.filter((function(e){return"data"===e.type})).map((function(e){return e.data}))[0],g="content",y="notes",w="footnotes",m)if((_=m[x])&&"object"==typeof _&&g in _&&y in _&&w in _){A=m[String(_[g])],k=m[String(_[y])],C=m[String(_[w])],c=A+(k?"<h2>Notes</h2><br>".concat(k):"")+(null!=C?C:"");break}return[3,18];case 17:throw E=t.sent(),new Error("Failed to fetch chapter data: ".concat(E));case 18:return[3,89];case 19:ee=l.split("/").pop(),te="https://greenz.com/api/chapters/slug/".concat(ee),t.label=20;case 20:return t.trys.push([20,23,,24]),[4,(0,n.fetchApi)(te)];case 21:return[4,(ye=t.sent()).json()];case 22:return Ce=t.sent(),T=Ce.data.name,re=Ce.data.chapterNumber,j=(0,r.load)(Ce.data.content),e="Chapter ".concat(re," - ").concat(T),s=j.html(),[3,24];case 23:throw S=t.sent(),new Error("Failed to parse GreenzTL chapter: ".concat(S));case 24:return[3,89];case 25:return e=a("li.active").first().text(),s=a(".text-left").html(),[3,89];case 26:return e=a("#chapter-title").first().text(),s=a("#chapter-content").html(),[3,89];case 27:return(ke=a("article > p > a").first().attr("href"))?[4,(0,n.fetchApi)(ke)]:[3,30];case 28:return[4,(ye=t.sent()).text()];case 29:we=t.sent(),a=(0,r.load)(we),t.label=30;case 30:return s=a(".entry-content").html(),e=a(".entry-title").text(),[3,89];case 31:return["header","section"].forEach((function(e){return a(e).remove()})),c=a(".styles_content__JHK8G").html(),[3,89];case 32:return["footer","header","nav",".ezoic-ad",".ezoic-adpicker-ad",".ezoic-videopicker-video"].forEach((function(e){return a(e).remove()})),e=a("head title").first().text(),s=a("main article").html(),[3,89];case 33:return(N=null===(Te=a('script:contains("shadowDom.innerHTML")').html())||void 0===Te?void 0:Te.match(/shadowDom\.innerHTML \+= '(<div.*?)';/))&&N[1]&&(c=N[1]),[3,89];case 34:return e=a(".title").first().text(),s=a(".chapter_content").map((function(e,t){return a(t).prop("outerHTML")})).get().join(""),[3,89];case 35:if(F=l.split("/").filter(Boolean),L=F.slice(2),P=L.length,z=a,1!==P)return[3,38];if(!(O=a(".entry-content a").first().attr("href")))throw new Error("Chapter path not found.");return[4,(0,n.fetchApi)(O)];case 36:if(!(ye=t.sent()).ok)throw new Error("Failed to fetch chapter: ".concat(ye.status));return[4,ye.text()];case 37:we=t.sent(),z=(0,r.load)(we),t.label=38;case 38:return c=z(".entry-content").html(),[3,89];case 39:return["#jp-post-flair"].forEach((function(e){return a(e).remove()})),ge=a(".entry-content p strong").first(),e=ge.text(),ge.remove(),s=a(".entry-content").html(),[3,89];case 40:if(!(I=a('script:contains("script-2")').html()))throw new Error("Failed to find script-2");if(R=Array.from(I.matchAll(/"script-2.*?[^_]+([^\\]+)/g)),!(M=null===(je=R[1])||void 0===je?void 0:je[1]))throw new Error("Failed to extract script-2 URL");return G=new URL("/".concat(M),l).href,[4,(0,n.fetchApi)(G)];case 41:return[4,t.sent().text()];case 42:if(H=t.sent(),!(B=null===(Se=H.match(/[a-f0-9]{42}/))||void 0===Se?void 0:Se[0]))throw new Error("Failed to extract ACTION_HASH");return U=l.split("/"),J=[U[4],parseInt(U[6],10)],q=J[0],W=J[1],[4,(0,n.fetchApi)(l,{method:"POST",headers:{Accept:"text/x-component","Content-Type":"text/plain;charset=UTF-8","next-action":B},body:JSON.stringify([q,W])})];case 43:if(!(ye=t.sent()).ok)throw new Error("Failed to fetch chapter: ".concat(ye.status));return[4,ye.text()];case 44:if($=t.sent().replace(/(\d+:[{TE])/g,"\n$1"),Q=$.split(/\n(?=\d+:[{TE])/),!(D=Q.filter((function(e){return/^\d+:T/.test(e)&&!e.startsWith("0:")})).map((function(e){return e.replace(/^\d+:T[0-9a-f]+,/,"")})).join("")))throw new Error("Could not find the chapter content segment (2:T) in the stream.");if(0===(K=D.trim().split(/(?:\r?\n|\\n)+/).map((function(e){return e.trim()})).filter((function(e){return e.length>0}))).length)throw new Error("Parsed content is empty.");if(X=Q.find((function(e){return e.startsWith("1:")})))try{ce=JSON.parse(X.slice(2)),Y=null===(Fe=null===(Ne=null==ce?void 0:ce.data)||void 0===Ne?void 0:Ne.chapter)||void 0===Fe?void 0:Fe.title,V=null!==(ze=null===(Pe=null===(Le=null==ce?void 0:ce.data)||void 0===Le?void 0:Le.chapter)||void 0===Pe?void 0:Pe.chapterNumber)&&void 0!==ze?ze:W,Y&&(e="Chapter ".concat(V,": ").concat(Y))}catch(e){}return e||(e="Chapter ".concat(W)),s=(s=K.map((function(e){return"<p>".concat(e,"</p>")})).join("\n")).replace(/\[dialogue\s+speaker="([^"]*)"\](.*?)\[\/dialogue\]/gi,"$1: $2").replace(/\[sfx\].*?\[\/sfx\]/gi,"").replace(/\[\/?(dialogue|sfx)[^\]]*\]/gi,""),[3,89];case 45:return[".passingthrough_adreminder"].forEach((function(e){return a(e).remove()})),e=a(".halChap--jud").first().text(),s=a(".halChap--kontenInner ").html(),[3,89];case 46:Q=l.split("/"),Z=Q[Q.length-2],ee=Q[Q.length-1],te="https://api.novelshub.org/api/chapter?mangaslug=".concat(Z,"&chapterslug=").concat(ee),t.label=47;case 47:return t.trys.push([47,50,,51]),[4,(0,n.fetchApi)(te)];case 48:return[4,(ye=t.sent()).json()];case 49:return Ce=t.sent(),re=Ce.chapter.number,ne=(0,r.load)(Ce.chapter.content),e="Chapter ".concat(re),ne("div").each((function(e,t){var r=ne(t),n=r.attr("style");n&&(/border:.*#ff6b00/.test(n)?r.removeAttr("style").addClass("novels-hub_box_orange"):/color:.*#ff6b00.*text-transform:.*uppercase/.test(n)?r.removeAttr("style").addClass("novels-hub_box-title_orange"):/color:.*white.*border-top:.*#ff6b00/.test(n)?r.removeAttr("style").addClass("novels-hub_box-text_orange"):/border:.*#00ff88/.test(n)?r.removeAttr("style").addClass("novels-hub_box_green"):/color:.*#00ff88.*text-transform:.*uppercase/.test(n)?r.removeAttr("style").addClass("novels-hub_box-title_green"):/border-left:.*#00ff88/.test(n)?r.removeAttr("style").addClass("novels-hub_comment_green"):/border:.*#0066ff/.test(n)?r.removeAttr("style").addClass("novels-hub_box_blue"):/color:.*#0099ff.*text-transform:.*uppercase/.test(n)?r.removeAttr("style").addClass("novels-hub_box-title_blue"):/color:.*#d0d0d0/.test(n)&&r.removeAttr("style").addClass("novels-hub_box-text_blue"))})),ne("span").each((function(e,t){var r=ne(t),n=r.attr("style");n&&(/color:.*#ff6b6b/.test(n)?r.removeAttr("style").addClass("novels-hub_text_red"):/color:.*#4d9fff/.test(n)?r.removeAttr("style").addClass("novels-hub_text_blue"):/color:.*#a78bfa/.test(n)&&r.removeAttr("style").addClass("novels-hub_text_purple"))})),s=ne.html(),[3,51];case 50:throw ae=t.sent(),new Error("Failed to parse GreenzTL chapter: ".concat(ae));case 51:return[3,89];case 52:return[".separator img"].forEach((function(e){return a(e).remove()})),a(".entry-content a").filter((function(e,t){var r;return(null===(r=a(t).attr("href"))||void 0===r?void 0:r.includes("https://novelworldtranslations.blogspot.com"))||!1})).each((function(e,t){a(t).parent().remove()})),e=a(".entry-title").first().text(),s=a(".entry-content").html().replace(/&nbsp;/g,"").replace(/\n/g,"<br>"),(oe=(0,r.load)(s))("span, p, div").each((function(e,t){""===oe(t).text().trim()&&oe(t).remove()})),s=oe.html(),[3,89];case 53:return a('#track-click,[class*="hidden "]').remove(),e=a('h1[data-tag="post-title"]').text(),s=a('[data-tag="post-card"] [class*="PaddingTop"]').html(),[3,89];case 54:return ve=l.split("/"),[4,(0,n.fetchApi)("".concat(ve[0],"//").concat(ve[2],"/resolve?p=/").concat(ve.slice(3).join("/")))];case 55:return[4,t.sent().json()];case 56:return le=t.sent().location,ve=le.split("/"),se="".concat(ve[0],"//").concat(ve[2]),[4,(0,n.fetchApi)("".concat(se,"/api/chapter-meta?seriesSlug=").concat(ve[4],"&chapterSlug=").concat(ve[5])).then((function(e){return e.json()}))];case 57:return ce=t.sent(),ie=ce.chapter.id,[4,(0,n.fetchApi)("".concat(se,"/api/chapters/").concat(ie,"/parts-token")).then((function(e){return e.json()}))];case 58:ue=t.sent().token,pe=1,he=1,t.label=59;case 59:return he<=pe?[4,(0,n.fetchApi)("".concat(se,"/api/chapters/").concat(ie,"/parts?index=").concat(he,"&token=").concat(ue)).then((function(e){return e.json()}))]:[3,62];case 60:de=t.sent(),fe="<p>"+de.markdown.replace(/\n\n/g,"</p><p>")+"</p>",c+=fe,pe=de.total,t.label=61;case 61:return he++,[3,59];case 62:return[3,89];case 63:return ve=l.split("/"),ke="".concat(ve[0],"//api.").concat(ve[2],"/api/chapters/single?id=").concat(ve[3],"&num=").concat(ve[4]),[4,(0,n.fetchApi)(ke).then((function(e){return e.json()}))];case 64:return Ce=t.sent(),ge="Chapter ".concat(Ce.currentChapter.chapTag),e=Ce.currentChapter.chapTitle?"".concat(ge," - ").concat(Ce.currentChapter.chapTitle):ge,s=(s=[Ce.novelHead,"<br><hr><br>",Ce.currentChapter.body,"<br><hr><br>Translator's Note:<br>",Ce.currentChapter.note].join("")).replace(/\n/g,"<br>"),[3,89];case 65:return be=a(".bb-item").filter((function(){return"block"===a(this).css("display")})),me=(0,r.load)(be.html()),[".responsivevoice-button",".zoomdesc-cont p img",".zoomdesc-cont p noscript"].forEach((function(e){return me(e).remove()})),s=me(".zoomdesc-cont").html(),(ge=me(".scroller h2").first()).length&&(e=ge.text(),ge.remove(),s=me(".zoomdesc-cont").html()),[3,89];case 66:return[".ezoic-ad",".ezoic-adpicker-ad",".ez-video-wrap"].forEach((function(e){return a(e).remove()})),c=a(".chapter-body").html(),[3,89];case 67:return Ae=l.split("/").pop(),e="Chapter ".concat(Ae),ke="".concat(l.split("chapter")[0],"txt/").concat(Ae,".txt"),[4,(0,n.fetchApi)(ke).then((function(e){return e.text()})).then((function(e){return e.split("\n").map((function(e){return e.includes("{break}")?"<br> <p>****</p>":e=(e=e.replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>")).replace(/\+\+(.*?)\+\+/g,"<em>$1</em>")})).join("<br>")}))];case 68:return s=t.sent(),[3,89];case 69:return[".entry-content blockquote",".entry-content div",".reaction-buttons"].forEach((function(e){return a(e).remove()})),e=a(".entry-title").first().text(),s=a(".entry-content").html(),[3,89];case 70:return[".wi_authornotes"].forEach((function(e){return a(e).remove()})),e=a(".chapter-title").first().text(),s=a(".chp_raw").html(),[3,89];case 71:if(a("main").text().toLowerCase().includes("age verification required"))throw new Error("Age verification required, please open in webview.");return e="".concat(a("header .font-medium.text-sm").first().text().trim()),s=a("#chapter-body").html(),[3,89];case 72:return(ke=a(".entry-content a").attr("href"))?[4,(0,n.fetchApi)(ke)]:[3,75];case 73:return[4,(ye=t.sent()).text()];case 74:we=t.sent(),a=(0,r.load)(we),t.label=75;case 75:return[".has-inline-color",".wp-block-buttons",".wpcnt","#jp-post-flair"].forEach((function(e){return a(e).remove()})),s=a(".entry-content").html(),(ge=a(".entry-content h3").first()).length&&(e=ge.text(),ge.remove(),s=a(".entry-content").html()),[3,89];case 76:return[".content noscript",".google_translate_element",".navigate",".post-views","br"].forEach((function(e){return a(e).remove()})),e=a(".title-content").first().text(),a(".title-content").first().remove(),s=a(".content").html(),[3,89];case 77:return c=a(".post").html(),[3,89];case 78:return(ke=a(".entry-content a").attr("href"))?[4,(0,n.fetchApi)(l+ke)]:[3,81];case 79:return[4,(ye=t.sent()).text()];case 80:we=t.sent(),a=(0,r.load)(we),t.label=81;case 81:return e=a(".entry-title").first().text(),s=a(".entry-content").html(),[3,89];case 82:return e=a(".h2").first().text(),s=a(".part-content pre").html(),[3,89];case 83:return e=a(".cha-tit .pr .dib").first().text(),(s=a(".cha-words").html())||(s=a("._content").html()),[3,89];case 84:return(xe=a('script:contains("p dir=")').html()||a('script:contains("u003c")').html())&&(_e=xe.slice(xe.indexOf(".push(")+6,xe.lastIndexOf(")")),c=JSON.parse(_e)[1]),[3,89];case 85:return[".MuiLink-root"].forEach((function(e){return a(e).remove()})),e=a("h4 span").first().text(),s=a(".chapter-content").html(),[3,89];case 86:return Ae=l.split("/").pop(),ke="https://pxp-main-531j.onrender.com/api/v1/book_chapters/".concat(Ae,"/content"),[4,(0,n.fetchApi)(ke).then((function(e){return e.json()}))];case 87:return Ce=t.sent(),[4,(0,n.fetchApi)(Ce).then((function(e){return e.text()}))];case 88:return c=t.sent(),[3,89];case 89:return c||(c=e?"<h2>".concat(e,"</h2><hr><br>").concat(s):s),[2,c]}}))}))},o.prototype.parseChapter=function(a){return e(this,void 0,void 0,(function(){var e,o,l,s,c,i,u,p,h,d,f,v,b,m,g,y,w,x;return t(this,(function(t){switch(t.label){case 0:return[4,(0,n.fetchApi)(this.site+a)];case 1:return[4,(o=t.sent()).text()];case 2:if(l=t.sent(),s=o.url,c=s.toLowerCase().split("/")[2].split("."),i=(0,r.load)(l),u=["bot verification","just a moment...","redirecting...","un instant...","you are being redirected..."],p=i("title").text().trim().toLowerCase(),u.includes(p))throw new Error("Captcha detected, please open in webview.");if(!o.ok)throw new Error("Failed to fetch ".concat(o.url,": ").concat(o.status," ").concat(o.statusText));return d=[(h=function(e,t,r){var n=!1;return i(e).each((function(e,a){var o=t?i(a).attr(t):i(a).html()||i(a).text();if(o&&r.test(o.toLowerCase()))return n=!0,!1})),n})('meta[name="generator"]',"content",/wordpress|site kit/i),h("link, script, img","src",/\/wp-content\/|\/wp-includes\//i),h("link","href",/\/wp-content\/|\/wp-includes\//i),h('link[rel="https://api.w.org/"]',"href",/.*/),h('link[rel="EditURI"]',"href",/xmlrpc\.php/i),h("body","class",/wp-admin|wp-custom-logo|logged-in/i),h("script",null,/wp-embed|wp-emoji|wp-block/i)].some(Boolean),f=[h('meta[name="generator"]',"content",/blogger/i),h('meta[name="google-adsense-platform-domain"]',"content",/blogspot/i),h('link[rel="alternate"]',"href",/blogger\.com\/feeds|blogspot\.com\/feeds/i),h("link","href",/www\.blogger\.com\/static|www\.blogger\.com\/dyn-css/i),h("script",null,/_WidgetManager\._Init|_WidgetManager\._RegisterWidget/i)].some(Boolean),v=["asuratls","fictionread","hiraethtranslation","infinitenoveltranslations","leafstudio","machineslicedbread","mirilu","novelworldtranslations","sacredtexttranslations","stabbingwithasyringe","tinytranslation","vampiramtl"],c.some((function(e){return v.includes(e)}))&&(d=!1,f=!1),b={wordpress:{bloat:[".ad",".author-avatar",".chapter-warning",".entry-meta",".ezoic-ad",".mb-center",".modern-footnotes-footnote__note",".patreon-widget",".post-cats",".pre-bar",".sharedaddy",".sidebar",".swg-button-v2-light",".wp-block-buttons",".wp-dark-mode-switcher",".wp-next-post-navi","#hpk","#jp-post-flair","#textbox"],title:[".entry-title",".chapter__title",".title-content",".wp-block-post-title",".title_story","#chapter-heading",".chapter-title","head title","h1:first-of-type","h2:first-of-type",".active"],content:[".chapter__content",".entry-content",".text_story",".post-content",".contenta",".single_post",".main-content",".reader-content","#content","#the-content","article.post",".chp_raw"]},blogspot:{bloat:[".button-container",".ChapterNav",".ch-bottom",".separator"],title:[".entry-title",".post-title","head title"],content:[".content-post",".entry-content",".post-body"]}},d||f?[3,4]:[4,this.getChapterBody(i,c,s)];case 3:return e=t.sent(),[3,5];case 4:(m=d?b.wordpress:b.blogspot).bloat.forEach((function(e){return i(e).remove()})),g=m.title.map((function(e){return i(e).first().text().trim()})).find((function(e){return e.length>0})),(y=i(".cat-series").first().text()||i("h1.leading-none ~ span").first().text()||i(".breadcrumb .active").first().text())&&(g=y),w=m.content.map((function(e){var t=i(e).first();return t.text().trim().length>50?t.html():null})).find((function(e){return e})),e=g&&w?"<h2>".concat(g,"</h2><hr><br>").concat(w):w||"",t.label=5;case 5:return e||(["nav","header","footer",".hidden"].forEach((function(e){return i(e).remove()})),e=i("body").html()),e=e.replace(/href="\//g,'href="'.concat(this.getLocation(o.url),"/")),(x=(0,r.load)(e))("noscript").remove(),x("img").each((function(e,t){var r=x(t);r.attr("data-lazy-src")&&r.attr("src",r.attr("data-lazy-src")),r.attr("data-lazy-srcset")&&r.attr("srcset",r.attr("data-lazy-srcset")),r.hasClass("lazyloaded")&&r.removeClass("lazyloaded")})),[2,x.html()]}}))}))},o.prototype.searchNovels=function(a,o){return e(this,void 0,void 0,(function(){var e,l,s,c,i;return t(this,(function(t){switch(t.label){case 0:return e=a.split("*"),l=e.reduce((function(e,t){return e.length>t.length?e:t}),""),a=l.replace(/[‘’]/g,"'").replace(/\s+/g,"+"),s="".concat(this.site,"series-finder/?sf=1&sh=").concat(a,"&sort=srank&order=asc&pg=").concat(o),[4,(0,n.fetchApi)(s)];case 1:return[4,t.sent().text()];case 2:return c=t.sent(),i=(0,r.load)(c),[2,this.parseNovels(i)]}}))}))},o}();exports.default=new o;

Search chapters, reference and source filenames.