Files
vega-providers/dist/hdhub4u/meta.js
himanshu8443 13f71510d5 minify
2025-07-11 19:17:23 +05:30

1 line
2.2 KiB
JavaScript

"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(a,o){function r(t){try{c(i.next(t))}catch(t){o(t)}}function s(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(r,s)}c((i=i.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const hdbHeaders={Cookie:"xla=s4t",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 Edg/131.0.0.0"},getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){var n;try{const{axios:i,cheerio:a}=e,o=t,r=(yield i.get(o,{headers:hdbHeaders})).data,s=a.load(r),c=s(".page-body"),d=(null===(n=c.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])').attr("href"))||void 0===n?void 0:n.split("/")[4])||"",l=c.find('h2[data-ved="2ahUKEwjL0NrBk4vnAhWlH7cAHRCeAlwQ3B0oATAfegQIFBAM"],h2[data-ved="2ahUKEwiP0pGdlermAhUFYVAKHV8tAmgQ3B0oATAZegQIDhAM"]').text(),p=l.toLocaleLowerCase().includes("season")?"series":"movie",h=c.find('strong:contains("DESCRIPTION")').parent().text().replace("DESCRIPTION:",""),f=c.find('img[decoding="async"]').attr("src")||"",u=[],g=[];return s('strong:contains("EPiSODE")').map((t,e)=>{const n=s(e).parent().parent().text(),i=s(e).parent().parent().parent().next().next().find("a").attr("href")||s(e).parent().parent().parent().next().find("a").attr("href");i&&i&&g.push({title:n,link:i})}),0===g.length&&c.find('a:contains("EPiSODE")').map((t,e)=>{const n=s(e).text(),i=s(e).attr("href");i&&g.push({title:n.toLocaleUpperCase(),link:i})}),g.length>0&&u.push({title:l,directLinks:g}),0===g.length&&c.find('a:contains("480"),a:contains("720"),a:contains("1080"),a:contains("2160"),a:contains("4K")').map((t,e)=>{var n;const i=(null===(n=s(e).text().match(/\b(480p|720p|1080p|2160p)\b/i))||void 0===n?void 0:n[0])||"",a=s(e).attr("href"),o=s(e).text();a&&u.push({directLinks:[{link:a,title:"Movie",type:"movie"}],quality:i,title:o})}),{title:l,synopsis:h,image:f,imdbId:d,type:p,linkList:u}}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;