mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
build
This commit is contained in:
2
dist/movies4u/meta.js
vendored
2
dist/movies4u/meta.js
vendored
@@ -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.getMeta=void 0;const headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","Cache-Control":"no-store","Accept-Language":"en-US,en;q=0.9",DNT:"1","sec-ch-ua":'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"none","Sec-Fetch-User":"?1",Cookie:"xla=s4t; _ga=GA1.1.1081149560.1756378968; _ga_BLZGKYN5PF=GS2.1.s1756378968$o1$g1$t1756378984$j44$l0$h0","Upgrade-Insecure-Requests":"1","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(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c;const{axios:axios,cheerio:cheerio}=providerContext,url=link,baseUrl=url.split("/").slice(0,3).join("/"),emptyResult={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]};try{const response=yield axios.get(url,{headers:Object.assign(Object.assign({},headers),{Referer:baseUrl})}),$=cheerio.load(response.data),infoContainer=$(".entry-content, .post-inner").length?$(".entry-content, .post-inner"):$("body"),result={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]},infoParagraph=$("h2.movie-title").next("p").text();infoParagraph.includes("Season:")||infoParagraph.includes("Episode:")||infoParagraph.includes("SHOW Name:")?result.type="series":result.type="movie";const rawTitle=$("h1").text().trim()||$("h2").text().trim();result.title=rawTitle.split(/\[| \d+p| x\d+/)[0].trim();const showNameMatch=infoParagraph.match(/SHOW Name: (.+)/)||infoParagraph.match(/Name: (.+)/);showNameMatch&&showNameMatch[1]&&(result.title=result.title||showNameMatch[1].trim());const imdbMatch=(null===(_b=infoContainer.html())||void 0===_b?void 0:_b.match(/tt\d+/))||(null===(_c=$("a[href*='imdb.com/title/']").attr("href"))||void 0===_c?void 0:_c.match(/tt\d+/));result.imdbId=imdbMatch?imdbMatch[0]:"";let image=infoContainer.find(".post-thumbnail img").attr("src")||infoContainer.find("img[src]").first().attr("src")||"";image.startsWith("//")?image="https:"+image:image.startsWith("/")&&(image=baseUrl+image),(image.includes("no-thumbnail")||image.includes("placeholder"))&&(image=""),result.image=image,result.synopsis=$("h3.movie-title").filter((i,el)=>$(el).text().includes("Storyline")).next("p").text().trim()||infoContainer.find("p").first().text().trim()||"";const links=[];return $(".download-links-div").find("> h4").each((index,element)=>{var _a;const el=$(element),titleText=el.text().trim(),qualityMatch=null===(_a=titleText.match(/\d+p\b/))||void 0===_a?void 0:_a[0],fullTitle=titleText,downloadButtons=el.next(".downloads-btns-div").find("a");if(downloadButtons.length&&qualityMatch)if("series"===result.type)links.push({title:fullTitle,quality:qualityMatch,episodesLink:downloadButtons.attr("href")||"",directLinks:[]});else{const directLinks=[];downloadButtons.each((i,btn)=>{const btnEl=$(btn),link=btnEl.attr("href");link&&directLinks.push({title:btnEl.text().trim()||"Download",link:link,type:"movie"})}),directLinks.length&&links.push({title:fullTitle,quality:qualityMatch,episodesLink:"",directLinks:directLinks})}}),result.linkList=links,result}catch(err){return emptyResult}})};exports.getMeta=getMeta;
|
||||
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__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,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of __getOwnPropNames(t))__hasOwnProp.call(e,i)||i===r||__defProp(e,i,{get:()=>t[i],enumerable:!(o=__getOwnPropDesc(t,i))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((o,i)=>{var n=e=>{try{a(r.next(e))}catch(e){i(e)}},s=e=>{try{a(r.throw(e))}catch(e){i(e)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,s);a((r=r.apply(e,t)).next())}),meta_exports={};__export(meta_exports,{getMeta:()=>getMeta});var headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","Cache-Control":"no-store","Accept-Language":"en-US,en;q=0.9",DNT:"1","sec-ch-ua":'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"none","Sec-Fetch-User":"?1",Cookie:"xla=s4t; _ga=GA1.1.1081149560.1756378968; _ga_BLZGKYN5PF=GS2.1.s1756378968$o1$g1$t1756378984$j44$l0$h0","Upgrade-Insecure-Requests":"1","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=__name(function(e){return __async(this,arguments,function*({link:e,providerContext:t}){var r,o;const{axios:i,cheerio:n}=t,s=e,a=s.split("/").slice(0,3).join("/"),p={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]};try{const e=yield i.get(s,{headers:__spreadProps(__spreadValues({},headers),{Referer:a})}),t=n.load(e.data),p=t(".entry-content, .post-inner").length?t(".entry-content, .post-inner"):t("body"),l={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]},c=t("h2.movie-title").next("p").text();c.includes("Season:")||c.includes("Episode:")||c.includes("SHOW Name:")?l.type="series":l.type="movie";const _=t("h1").text().trim()||t("h2").text().trim();l.title=_.split(/\[| \d+p| x\d+/)[0].trim();const d=c.match(/SHOW Name: (.+)/)||c.match(/Name: (.+)/);d&&d[1]&&(l.title=l.title||d[1].trim());const m=(null==(r=p.html())?void 0:r.match(/tt\d+/))||(null==(o=t("a[href*='imdb.com/title/']").attr("href"))?void 0:o.match(/tt\d+/));l.imdbId=m?m[0]:"";let h=p.find(".post-thumbnail img").attr("src")||p.find("img[src]").first().attr("src")||"";h.startsWith("//")?h="https:"+h:h.startsWith("/")&&(h=a+h),(h.includes("no-thumbnail")||h.includes("placeholder"))&&(h=""),l.image=h,l.synopsis=t("h3.movie-title").filter((e,r)=>t(r).text().includes("Storyline")).next("p").text().trim()||p.find("p").first().text().trim()||"";const u=[];return t(".download-links-div").find("> h4").each((e,r)=>{var o;const i=t(r),n=i.text().trim(),s=null==(o=n.match(/\d+p\b/))?void 0:o[0],a=n,p=i.next(".downloads-btns-div").find("a");if(p.length&&s)if("series"===l.type)u.push({title:a,quality:s,episodesLink:p.attr("href")||"",directLinks:[]});else{const e=[];p.each((r,o)=>{const i=t(o),n=i.attr("href");n&&e.push({title:i.text().trim()||"Download",link:n,type:"movie"})}),e.length&&u.push({title:a,quality:s,episodesLink:"",directLinks:e})}}),l.linkList=u,l}catch(e){return p}})},"getMeta");exports.getMeta=getMeta;
|
||||
Reference in New Issue
Block a user