This commit is contained in:
Himanshu
2026-02-03 21:48:37 +05:30
parent c4d3340b16
commit a179a130d6
192 changed files with 184 additions and 192 deletions

View File

@@ -1 +1 @@
var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};exports.getEpisodes=void 0,exports.extractKmhdLink=extractKmhdLink;const getEpisodes=function(_a){return __awaiter(this,arguments,void 0,function*({url:url,providerContext:providerContext}){var _b;const{axios:axios,cheerio:cheerio}=providerContext,episodesLink=[];try{if(url.includes("gdflix")){const baseUrl=null===(_b=url.split("/pack"))||void 0===_b?void 0:_b[0],data=(yield axios.get(url)).data,$=cheerio.load(data),links=$(".list-group-item");if(null==links||links.map((i,link)=>{episodesLink.push({title:$(link).text()||"",link:baseUrl+$(link).find("a").attr("href")||""})}),episodesLink.length>0)return episodesLink}if(url.includes("/pack")){const epIds=yield extractKmhdEpisodes(url,providerContext);null==epIds||epIds.forEach((id,index)=>{episodesLink.push({title:`Episode ${index+1}`,link:url.split("/pack")[0]+"/file/"+id})})}const episodeData=(yield axios.get(url,{headers:{Cookie:"_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true"}})).data,$=cheerio.load(episodeData),links=$(".autohyperlink");return null==links||links.map((i,link)=>{episodesLink.push({title:$(link).parent().children().remove().end().text()||"",link:$(link).attr("href")||""})}),episodesLink}catch(err){return[]}})};function extractKmhdLink(katlink,providerContext){return __awaiter(this,void 0,void 0,function*(){const{axios:axios}=providerContext,data=(yield axios.get(katlink)).data,hubDriveRes=data.match(/hubdrive_res:\s*"([^"]+)"/)[1];return data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+hubDriveRes})}function extractKmhdEpisodes(katlink,providerContext){return __awaiter(this,void 0,void 0,function*(){const{axios:axios}=providerContext;return(yield axios.get(katlink)).data.match(/[\w]+_[a-f0-9]{8}/g)})}exports.getEpisodes=getEpisodes;
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(e,t)=>__defProp(e,"name",{value:t,configurable:!0}),__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames(t))__hasOwnProp.call(e,o)||o===r||__defProp(e,o,{get:()=>t[o],enumerable:!(n=__getOwnPropDesc(t,o))||n.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((n,o)=>{var s=e=>{try{i(r.next(e))}catch(e){o(e)}},a=e=>{try{i(r.throw(e))}catch(e){o(e)}},i=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,a);i((r=r.apply(e,t)).next())}),episodes_exports={};__export(episodes_exports,{extractKmhdLink:()=>extractKmhdLink,getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(e){return __async(this,arguments,function*({url:e,providerContext:t}){var r;const{axios:n,cheerio:o}=t,s=[];try{if(e.includes("gdflix")){const t=null==(r=e.split("/pack"))?void 0:r[0],a=(yield n.get(e)).data,i=o.load(a),c=i(".list-group-item");if(null==c||c.map((e,r)=>{s.push({title:i(r).text()||"",link:t+i(r).find("a").attr("href")||""})}),s.length>0)return s}if(e.includes("/pack")){const r=yield extractKmhdEpisodes(e,t);null==r||r.forEach((t,r)=>{s.push({title:`Episode ${r+1}`,link:e.split("/pack")[0]+"/file/"+t})})}const a=(yield n.get(e,{headers:{Cookie:"_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true"}})).data,i=o.load(a),c=i(".autohyperlink");return null==c||c.map((e,t)=>{s.push({title:i(t).parent().children().remove().end().text()||"",link:i(t).attr("href")||""})}),s}catch(e){return[]}})},"getEpisodes");function extractKmhdLink(e,t){return __async(this,null,function*(){const{axios:r}=t,n=(yield r.get(e)).data,o=n.match(/hubdrive_res:\s*"([^"]+)"/)[1];return n.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+o})}function extractKmhdEpisodes(e,t){return __async(this,null,function*(){const{axios:r}=t;return(yield r.get(e)).data.match(/[\w]+_[a-f0-9]{8}/g)})}__name(extractKmhdLink,"extractKmhdLink"),__name(extractKmhdEpisodes,"extractKmhdEpisodes"),exports.extractKmhdLink=extractKmhdLink,exports.getEpisodes=getEpisodes;