Files
vega-providers/dist/moviezwap/meta.js
Himanshu a179a130d6 build
2026-02-03 21:48:37 +05:30

1 line
2.3 KiB
JavaScript

"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 o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of __getOwnPropNames(t))__hasOwnProp.call(e,i)||i===o||__defProp(e,i,{get:()=>t[i],enumerable:!(r=__getOwnPropDesc(t,i))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,o)=>new Promise((r,i)=>{var a=e=>{try{s(o.next(e))}catch(e){i(e)}},n=e=>{try{s(o.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,n);s((o=o.apply(e,t)).next())}),meta_exports={};__export(meta_exports,{getMeta:()=>getMeta});var getMeta=__name(function(e){return __async(this,arguments,function*({link:e,providerContext:t}){try{const{axios:o,cheerio:r,getBaseUrl:i}=t,a=yield i("moviezwap"),n=e.startsWith("http")?e:`${a}${e}`,s=(yield o.get(n)).data,p=r.load(s);let l=p('img[width="260"]').attr("src")||"";l&&!l.startsWith("http")&&(l=a+l);const c=p("font[color='steelblue']").map((e,t)=>p(t).text().trim()).get().slice(0,2),_=p("title").text().replace(" - MoviezWap","").trim()||"";let d="",m="",h="movie",g=[];p("td:contains('Movie Information')").parent().nextAll("tr").each((e,t)=>{const o=p(t).find("td");if(2===o.length){const e=o.eq(0).text().trim(),t=o.eq(1).text().trim();g.push(`${e}: ${t}`),e.toLowerCase().includes("plot")&&(d=t),e.toLowerCase().includes("imdb")&&(m=t)}}),d||(d=p("p:contains('plot')").text().trim());const f=[];return p('a[href*="download.php?file="], a[href*="dwload.php?file="]').each((e,t)=>{var o;const r=(null==(o=p(t).attr("href"))?void 0:o.replace("dwload.php","download.php"))||"",i=p(t).text().trim();r&&/\d+p/i.test(i)&&f.push({title:i,directLinks:[{title:"Movie",link:a+r}]})}),p("img[src*='/images/play.png']").each((e,t)=>{const o=p(t).siblings("a").attr("href"),r=p(t).siblings("a").text().trim();o&&r&&f.push({title:r,episodesLink:a+o})}),{title:_,synopsis:d,image:l,imdbId:m,tags:c,type:h,linkList:f}}catch(e){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})},"getMeta");exports.getMeta=getMeta;