mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,l){function d(e){try{v(n.next(e))}catch(e){l(e)}}function a(e){try{v(n.throw(e))}catch(e){l(e)}}function v(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(d,a)}v((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),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:"_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw","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=e=>__awaiter(void 0,[e],void 0,function*({link:e,providerContext:t}){var i,n,o,l,d,a,v,r,c,u,s,f,p,h,b,g,x,m,w;try{const{axios:_,cheerio:y}=t,k=e,L=k.split("/").slice(0,3).join("/"),A=yield _.get(k,{headers:Object.assign(Object.assign({},headers),{Referer:L})}),I=y.load(A.data),K=I(".entry-content,.post-inner"),M=null==K?void 0:K.find("h3"),S=(null===(a=null===(d=null===(l=null===(o=null===(n=null===(i=null==M?void 0:M.next("p"))||void 0===i?void 0:i.find("a"))||void 0===n?void 0:n[0])||void 0===o?void 0:o.attribs)||void 0===l?void 0:l.href)||void 0===d?void 0:d.match(/tt\d+/g))||void 0===a?void 0:a[0])||(null===(v=K.text().match(/tt\d+/g))||void 0===v?void 0:v[0])||"",U=(null===(c=null===(r=null==M?void 0:M.next("p"))||void 0===r?void 0:r.text())||void 0===c?void 0:c.includes("Series Name"))?"series":"movie",q=/Name: (.+)/,B=(null===(f=null===(s=null===(u=null==M?void 0:M.next("p"))||void 0===u?void 0:u.text())||void 0===s?void 0:s.match(q))||void 0===f?void 0:f[1])||"",F=null===(x=null===(g=null===(b=null===(h=null===(p=null==K?void 0:K.find("p"))||void 0===p?void 0:p.next("h3,h4"))||void 0===h?void 0:h.next("p"))||void 0===b?void 0:b[0])||void 0===g?void 0:g.children)||void 0===x?void 0:x[0],G=F&&"data"in F?F.data:"";let T=(null===(m=null==K?void 0:K.find("img[data-lazy-src]"))||void 0===m?void 0:m.attr("data-lazy-src"))||"";T.startsWith("//")&&(T="https:"+T);const j=null===(w=null==K?void 0:K.first())||void 0===w?void 0:w.find("hr"),H=null==j?void 0:j.nextUntil("hr"),N=[];return H.each((e,t)=>{var i,n,o,l,d,a,v,r,c;const u=(null==(t=I(t))?void 0:t.text())||"",s=(null===(i=null==t?void 0:t.text().match(/\d+p\b/))||void 0===i?void 0:i[0])||"",f=(null==t?void 0:t.next().find(".dwd-button").text().toLowerCase().includes("download"))?null===(o=null===(n=null==t?void 0:t.next().find(".dwd-button"))||void 0===n?void 0:n.parent())||void 0===o?void 0:o.attr("href"):"",p=null===(d=null===(l=null==t?void 0:t.next().find(".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']"))||void 0===l?void 0:l.parent())||void 0===d?void 0:d.attr("href"),h=p||((null==t?void 0:t.next().find(".dwd-button").text().toLowerCase().includes("episode"))?null===(v=null===(a=null==t?void 0:t.next().find(".dwd-button"))||void 0===a?void 0:a.parent())||void 0===v?void 0:v.attr("href"):"")||(null===(c=null===(r=null==t?void 0:t.next().find(".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']"))||void 0===r?void 0:r.parent())||void 0===c?void 0:c.attr("href"));(f||h)&&N.push({title:u,directLinks:f?[{title:"Movie",link:f,type:"movie"}]:[],episodesLink:h,quality:s})}),{title:B,synopsis:G,image:T,imdbId:S,type:U,linkList:N}}catch(e){return{title:"",synopsis:"",image:"",imdbId:"",type:"",linkList:[]}}});exports.getMeta=getMeta; |