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/kmMovies/meta.js
vendored
2
dist/kmMovies/meta.js
vendored
@@ -1 +1 @@
|
||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(t,e)=>__defProp(t,"name",{value:e,configurable:!0}),__export=(t,e)=>{for(var o in e)__defProp(t,o,{get:e[o],enumerable:!0})},__copyProps=(t,e,o,r)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of __getOwnPropNames(e))__hasOwnProp.call(t,a)||a===o||__defProp(t,a,{get:()=>e[a],enumerable:!(r=__getOwnPropDesc(e,a))||r.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__async=(t,e,o)=>new Promise((r,a)=>{var n=t=>{try{s(o.next(t))}catch(t){a(t)}},i=t=>{try{s(o.throw(t))}catch(t){a(t)}},s=t=>t.done?r(t.value):Promise.resolve(t.value).then(n,i);s((o=o.apply(t,e)).next())}),meta_exports={};__export(meta_exports,{getMeta:()=>getMeta});var kmmHeaders={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"},getMeta=__name(function(t){return __async(this,arguments,function*({link:t,providerContext:e}){var o,r;try{const{axios:a,cheerio:n}=e;t.startsWith("http")||(t=`${yield e.getBaseUrl("kmmovies")}${t.startsWith("/")?"":"/"}${t}`);const i=yield a.get(t,{headers:kmmHeaders}),s=n.load(i.data),l=s("h1, h2, .animated-text").first().text().trim()||(null==(o=s("meta[property='og:title']").attr("content"))?void 0:o.trim())||s("title").text().trim()||"Unknown";let c=s("div.wp-slider-container img").first().attr("src")||s("meta[property='og:image']").attr("content")||s("meta[name='twitter:image']").attr("content")||"";c&&c.startsWith("http")||(c=new URL(c||"/placeholder.png",t).href);let d="";s("p").each((t,e)=>{const o=s(e).text().trim();if(o&&o.length>40&&!o.toLowerCase().includes("download")&&!o.toLowerCase().includes("quality"))return d=o,!1}),d||(d=s("meta[property='og:description']").attr("content")||s("meta[name='description']").attr("content")||"");const p=[];i.data.toLowerCase().includes("action")&&p.push("Action"),i.data.toLowerCase().includes("drama")&&p.push("Drama"),i.data.toLowerCase().includes("romance")&&p.push("Romance"),i.data.toLowerCase().includes("thriller")&&p.push("Thriller");const m=[];s("p").each((t,e)=>{const o=s(e).text().trim();/starring|cast/i.test(o)&&o.split(",").forEach(t=>m.push(t.trim()))});let h=(null==(r=s("p").text().match(/IMDb Rating[:\s]*([0-9.]+)/i))?void 0:r[1])||"";h&&!h.includes("/")&&(h+="/10");const _=s("p a[href*='imdb.com']").attr("href")||"",u=_&&_.includes("/tt")?"tt"+_.split("/tt")[1].split("/")[0]:"",g=[],f=s(".download-options-grid").length>0;return f?s(".download-card").each((t,e)=>{const o=s(e),r=o.find(".download-quality-text").text().trim(),a=o.find(".download-size-info").text().trim()||"",n=o.find("a.tabs-download-button").attr("href")||"";if(n){const t=`Download ${r} ${a}`.trim();g.push({title:t,quality:r||"AUTO",directLinks:[{link:n,title:t,type:"series"}]})}}):s("a.modern-download-button").each((t,e)=>{const o=s(e).closest(".modern-option-card").find(".modern-badge").text().trim()||"AUTO",r=s(e).attr("href")||"",a=`Download ${o}`;r&&g.push({title:a,quality:o,directLinks:[{link:r,title:a,type:"movie"}]})}),{title:l,synopsis:d,image:c,imdbId:u,type:f?"series":"movie",tags:p,cast:m,rating:h,linkList:g}}catch(t){return{title:"",synopsis:"",image:"https://via.placeholder.com/300x450",imdbId:"",type:"movie",tags:[],cast:[],rating:"",linkList:[]}}})},"getMeta");exports.getMeta=getMeta;
|
||||
"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,{getMeta:()=>getMeta});var kmmHeaders={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"},getMeta=__name(function(_0){return __async(this,arguments,function*({link:link,providerContext:providerContext}){var _a,_b;try{const{axios:axios,cheerio:cheerio}=providerContext;link.startsWith("http")||(link=`${yield providerContext.getBaseUrl("kmmovies")}${link.startsWith("/")?"":"/"}${link}`);const res=yield axios.get(link,{headers:kmmHeaders}),$=cheerio.load(res.data),title=$("h1, h2, .animated-text").first().text().trim()||(null==(_a=$("meta[property='og:title']").attr("content"))?void 0:_a.trim())||$("title").text().trim()||"Unknown";let image=$("div.wp-slider-container img").first().attr("src")||$("meta[property='og:image']").attr("content")||$("meta[name='twitter:image']").attr("content")||"";image&&image.startsWith("http")||(image=new URL(image||"/placeholder.png",link).href);let synopsis="";$("p").each((_,el)=>{const text=$(el).text().trim();if(text&&text.length>40&&!text.toLowerCase().includes("download")&&!text.toLowerCase().includes("quality"))return synopsis=text,!1}),synopsis||(synopsis=$("meta[property='og:description']").attr("content")||$("meta[name='description']").attr("content")||"");const tags=[];res.data.toLowerCase().includes("action")&&tags.push("Action"),res.data.toLowerCase().includes("drama")&&tags.push("Drama"),res.data.toLowerCase().includes("romance")&&tags.push("Romance"),res.data.toLowerCase().includes("thriller")&&tags.push("Thriller");const cast=[];$("p").each((_,el)=>{const text=$(el).text().trim();/starring|cast/i.test(text)&&text.split(",").forEach(name=>cast.push(name.trim()))});let rating=(null==(_b=$("p").text().match(/IMDb Rating[:\s]*([0-9.]+)/i))?void 0:_b[1])||"";rating&&!rating.includes("/")&&(rating+="/10");const imdbLink=$("p a[href*='imdb.com']").attr("href")||"",imdbId=imdbLink&&imdbLink.includes("/tt")?"tt"+imdbLink.split("/tt")[1].split("/")[0]:"",linkList=[],isSeries=$(".download-options-grid").length>0;return isSeries?$(".download-card").each((_,card)=>{const card$=$(card),quality=card$.find(".download-quality-text").text().trim(),size=card$.find(".download-size-info").text().trim()||"",href=card$.find("a.tabs-download-button").attr("href")||"";if(href){const titleText=`Download ${quality} ${size}`.trim();linkList.push({title:titleText,quality:quality||"AUTO",directLinks:[{link:href,title:titleText,type:"series"}]})}}):$("a.modern-download-button").each((_,a)=>{const quality=$(a).closest(".modern-option-card").find(".modern-badge").text().trim()||"AUTO",href=$(a).attr("href")||"",titleText=`Download ${quality}`;href&&linkList.push({title:titleText,quality:quality,directLinks:[{link:href,title:titleText,type:"movie"}]})}),{title:title,synopsis:synopsis,image:image,imdbId:imdbId,type:isSeries?"series":"movie",tags:tags,cast:cast,rating:rating,linkList:linkList}}catch(err){return console.error("KMMOVIES getMeta error:",err),{title:"",synopsis:"",image:"https://via.placeholder.com/300x450",imdbId:"",type:"movie",tags:[],cast:[],rating:"",linkList:[]}}})},"getMeta");exports.getMeta=getMeta;
|
||||
Reference in New Issue
Block a user