Files
vega-providers/dist/skyMovieHD/meta.js
Himanshu 1e80bf18d4 build
2026-02-03 22:16:44 +05:30

1 line
6.3 KiB
JavaScript

"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),meta_exports={};__export(meta_exports,{fetchEpisodesFromSelectedLink:()=>fetchEpisodesFromSelectedLink,getMeta:()=>getMeta});var headers={Referer:"https://google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"};function fetchEpisodesFromSelectedLink(url,providerContext){return __async(this,null,function*(){const{axios:axios,cheerio:cheerio}=providerContext,res=yield axios.get(url,{headers:headers}),$=cheerio.load(res.data),episodes=[];return $("h4").each((_,h4El)=>{const epTitle=$(h4El).text().trim();if(!epTitle)return;const directLinks=[];$(h4El).nextUntil("h4, hr").find("a[href]").each((_2,linkEl)=>{let href=($(linkEl).attr("href")||"").trim();if(!href)return;href.startsWith("http")||(href=new URL(href,url).href);const btnText=$(linkEl).text().trim()||"Watch Episode";directLinks.push({link:href,title:btnText,quality:"AUTO",type:"episode"})}),directLinks.length>0&&episodes.push({title:epTitle,directLinks:directLinks})}),episodes})}__name(fetchEpisodesFromSelectedLink,"fetchEpisodesFromSelectedLink");var getMeta=__name(function(_0){return __async(this,arguments,function*({link:link,providerContext:providerContext}){var _a,_b;const{axios:axios,cheerio:cheerio}=providerContext;link.startsWith("http")||(link=new URL(link,"https://vgmlinks.click").href);try{const res=yield axios.get(link,{headers:headers}),$=cheerio.load(res.data),content=$(".entry-content, .post-inner").length?$(".entry-content, .post-inner"):$("body"),title=$("h1.entry-title").first().text().trim()||(null==(_a=$("meta[property='og:title']").attr("content"))?void 0:_a.trim())||"Unknown",pageText=content.text(),type=/Season\s*\d+/i.test(pageText)||/Episode\s*\d+/i.test(pageText)?"series":"movie";let image=$(".poster img").attr("src")||$("meta[property='og:image']").attr("content")||$("meta[name='twitter:image']").attr("content")||"";image&&!image.startsWith("http")&&(image=new URL(image,link).href);let synopsis="";$(".entry-content p").each((_,el)=>{const txt=$(el).text().trim();if(txt.length>40&&!txt.toLowerCase().includes("download"))return synopsis=txt,!1});const imdbLink=$("a[href*='imdb.com']").attr("href")||"",imdbId=imdbLink?"tt"+((null==(_b=imdbLink.split("/tt")[1])?void 0:_b.split("/")[0])||""):"",tags=[];$(".entry-content p strong").each((_,el)=>{const txt=$(el).text().trim();txt.match(/drama|biography|action|thriller|romance|adventure|animation/i)&&tags.push(txt)});const extra={};$("p").each((_,el)=>{var _a2,_b2,_c,_d,_e,_f;const html=$(el).html()||"";html.includes("Series Name")&&(extra.name=null==(_a2=$(el).text().split(":")[1])?void 0:_a2.trim()),html.includes("Language")&&(extra.language=null==(_b2=$(el).text().split(":")[1])?void 0:_b2.trim()),html.includes("Released Year")&&(extra.year=null==(_c=$(el).text().split(":")[1])?void 0:_c.trim()),html.includes("Quality")&&(extra.quality=null==(_d=$(el).text().split(":")[1])?void 0:_d.trim()),html.includes("Episode Size")&&(extra.size=null==(_e=$(el).text().split(":")[1])?void 0:_e.trim()),html.includes("Format")&&(extra.format=null==(_f=$(el).text().split(":")[1])?void 0:_f.trim())});const links=[],episodeList=[],isInformationalHeading=__name(text=>{const lowerText=text.toLowerCase();return lowerText.includes("series info")||lowerText.includes("series name")||lowerText.includes("language")||lowerText.includes("released year")||lowerText.includes("episode size")||lowerText.includes("format")||lowerText.includes("imdb rating")||lowerText.includes("winding up")||lowerText.length<5&&!/\d/.test(lowerText)},"isInformationalHeading");return"series"===type?content.find("h3").each((_,h3)=>{var _a2;const h3Text=$(h3).text().trim();if(isInformationalHeading(h3Text))return;const qualityMatch=(null==(_a2=h3Text.match(/\d+p/))?void 0:_a2[0])||"AUTO",vcloudLink=$(h3).nextUntil("h3, hr").find("a").filter((_2,a)=>/v-cloud|mega|gdrive|download/i.test($(a).text())).first(),href=vcloudLink.attr("href");if(href){const btnText=vcloudLink.text().trim()||"Link";if(btnText.toLowerCase().includes("imdb rating")||btnText.toLowerCase().includes("winding up"))return;links.push({title:h3Text,quality:qualityMatch,episodesLink:href})}}):content.find("h3, h5").each((_,heading)=>{var _a2;const headingText=$(heading).text().trim();if(isInformationalHeading(headingText))return;const qualityMatch=(null==(_a2=headingText.match(/\d+p/))?void 0:_a2[0])||"AUTO",linkEl=$(heading).nextUntil("h3, h5, hr").find("a[href]").first(),href=linkEl.attr("href");if(href){let finalHref=href.trim();finalHref.startsWith("http")||(finalHref=new URL(finalHref,link).href);const btnText=linkEl.text().trim()||"Download Link";if(btnText.toLowerCase().includes("imdb rating")||btnText.toLowerCase().includes("winding up"))return;links.push({title:headingText,quality:qualityMatch,episodesLink:"",directLinks:[{title:btnText,link:finalHref,type:"movie"}]})}}),{title:title,synopsis:synopsis,image:image,imdbId:imdbId,type:type,tags:tags,cast:[],rating:$(".entry-meta .entry-date").text().trim()||"",linkList:links,extraInfo:extra,episodeList:episodeList}}catch(err){return console.error("getMeta error:",err),{title:"",synopsis:"",image:"",imdbId:"",type:"movie",tags:[],cast:[],rating:"",linkList:[],extraInfo:{},episodeList:[]}}})},"getMeta");exports.fetchEpisodesFromSelectedLink=fetchEpisodesFromSelectedLink,exports.getMeta=getMeta;