mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
feat: Add new provider implementations for Joya9tv and skyMovieHD
This commit is contained in:
1
dist/Joya9tv/stream.js
vendored
Normal file
1
dist/Joya9tv/stream.js
vendored
Normal file
@@ -0,0 +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.getStream=getStream;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","accept-language":"en-US,en;q=0.9,en-IN;q=0.8","cache-control":"no-cache",pragma:"no-cache",priority:"u=0, i","sec-ch-ua":'"Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"',"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","upgrade-insecure-requests":"1"};function getStream(_a){return __awaiter(this,arguments,void 0,function*({link:link,type:type,signal:signal,providerContext:providerContext}){var _b,_c,_d,_e;const{axios:axios,cheerio:cheerio,extractors:extractors}=providerContext,{hubcloudExtracter:hubcloudExtracter}=extractors;try{const streamLinks=[];if("movie"===type){const dotlinkRes=yield fetch(`${link}`,{headers:headers}),dotlinkText=yield dotlinkRes.text();link=(dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i)||[])[1];try{const filepressLink=cheerio.load(dotlinkText)('.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]').parent().attr("href"),filepressID=null==filepressLink?void 0:filepressLink.split("/").pop(),filepressBaseUrl=null==filepressLink?void 0:filepressLink.split("/").slice(0,-2).join("/"),filepressTokenRes=yield axios.post(filepressBaseUrl+"/api/file/downlaod/",{id:filepressID,method:"indexDownlaod",captchaValue:null},{headers:{"Content-Type":"application/json",Referer:filepressBaseUrl}});if(null===(_b=filepressTokenRes.data)||void 0===_b?void 0:_b.status){const filepressToken=null===(_c=filepressTokenRes.data)||void 0===_c?void 0:_c.data,filepressStreamLink=yield axios.post(filepressBaseUrl+"/api/file/downlaod2/",{id:filepressToken,method:"indexDownlaod",captchaValue:null},{headers:{"Content-Type":"application/json",Referer:filepressBaseUrl}});streamLinks.push({server:"filepress",link:null===(_e=null===(_d=filepressStreamLink.data)||void 0===_d?void 0:_d.data)||void 0===_e?void 0:_e[0],type:"mkv"})}}catch(error){}}return yield hubcloudExtracter(link,signal)}catch(error){return error.message.includes("Aborted"),[]}})}
|
||||
Reference in New Issue
Block a user