mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
feat: add extractors bundled in file refactor stream handling in multiple providers
This commit is contained in:
2
dist/showbox/meta.js
vendored
2
dist/showbox/meta.js
vendored
@@ -1 +1 @@
|
||||
"use strict";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())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c,_d,_e,_f,_g,_h,_j,_k;try{const{axios:axios,cheerio:cheerio,getBaseUrl:getBaseUrl}=providerContext,url=(yield getBaseUrl("showbox"))+link,data=(yield axios.get(url)).data,$=cheerio.load(data),type=url.includes("tv")?"series":"movie",imdbId="",title=$(".heading-name").text(),rating=(null===(_c=null===(_b=$(".btn-imdb").text())||void 0===_b?void 0:_b.match(/\d+(\.\d+)?/g))||void 0===_c?void 0:_c[0])||"",image=(null===(_e=null===(_d=$(".cover_follow").attr("style"))||void 0===_d?void 0:_d.split("url(")[1])||void 0===_e?void 0:_e.split(")")[0])||"",synopsis=null===(_g=null===(_f=$(".description").text())||void 0===_f?void 0:_f.replace(/[\n\t]/g,""))||void 0===_g?void 0:_g.trim(),febID=null===(_j=null===(_h=$(".heading-name").find("a").attr("href"))||void 0===_h?void 0:_h.split("/"))||void 0===_j?void 0:_j.pop(),indexUrl=`${url.split("/").slice(0,3).join("/")}/index/share_link?id=${febID}&type=${"movie"===type?"1":"2"}`,indexRes=yield axios.get(indexUrl),febKey=indexRes.data.data.link.split("/").pop(),febLink=`https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`,febData=(yield axios.get(febLink)).data,fileList=null===(_k=null==febData?void 0:febData.data)||void 0===_k?void 0:_k.file_list,links=[];return fileList&&fileList.map(file=>{const fileName=`${file.file_name} (${file.file_size})`,fileId=file.fid;links.push({title:fileName,episodesLink:file.is_dir?`${febKey}&${fileId}`:`${febKey}&`})}),{title:title,rating:rating,synopsis:synopsis,image:image,imdbId:imdbId,type:type,linkList:links}}catch(err){return{title:"",rating:"",synopsis:"",image:"",imdbId:"",type:"",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
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 getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c,_d,_e,_f,_g,_h,_j,_k;try{const{axios:axios,cheerio:cheerio,getBaseUrl:getBaseUrl}=providerContext,url=(yield getBaseUrl("showbox"))+link,data=(yield axios.get(url)).data,$=cheerio.load(data),type=url.includes("tv")?"series":"movie",imdbId="",title=$(".heading-name").text(),rating=(null===(_c=null===(_b=$(".btn-imdb").text())||void 0===_b?void 0:_b.match(/\d+(\.\d+)?/g))||void 0===_c?void 0:_c[0])||"",image=(null===(_e=null===(_d=$(".cover_follow").attr("style"))||void 0===_d?void 0:_d.split("url(")[1])||void 0===_e?void 0:_e.split(")")[0])||"",synopsis=null===(_g=null===(_f=$(".description").text())||void 0===_f?void 0:_f.replace(/[\n\t]/g,""))||void 0===_g?void 0:_g.trim(),febID=null===(_j=null===(_h=$(".heading-name").find("a").attr("href"))||void 0===_h?void 0:_h.split("/"))||void 0===_j?void 0:_j.pop(),indexUrl=`${url.split("/").slice(0,3).join("/")}/index/share_link?id=${febID}&type=${"movie"===type?"1":"2"}`,indexRes=yield axios.get(indexUrl),febKey=indexRes.data.data.link.split("/").pop(),febLink=`https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`,febData=(yield axios.get(febLink)).data,fileList=null===(_k=null==febData?void 0:febData.data)||void 0===_k?void 0:_k.file_list,links=[];return fileList&&fileList.map(file=>{const fileName=`${file.file_name} (${file.file_size})`,fileId=file.fid;links.push({title:fileName,episodesLink:file.is_dir?`${febKey}&${fileId}`:`${febKey}&`})}),{title:title,rating:rating,synopsis:synopsis,image:image,imdbId:imdbId,type:type,linkList:links}}catch(err){return{title:"",rating:"",synopsis:"",image:"",imdbId:"",type:"",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
Reference in New Issue
Block a user