mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
build
This commit is contained in:
24
dist/cinemaLuxe/stream.js
vendored
24
dist/cinemaLuxe/stream.js
vendored
@@ -1,11 +1,21 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
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) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async ({ link, signal, providerContext, }) => {
|
||||
const getStream = (_a) => __awaiter(void 0, [_a], void 0, function* ({ link, signal, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
let newLink = link;
|
||||
if (link.includes("luxedrive")) {
|
||||
const res = await providerContext.axios.get(link);
|
||||
const res = yield providerContext.axios.get(link);
|
||||
const $ = providerContext.cheerio.load(res.data);
|
||||
const hubcloudLink = $("a.btn.hubcloud").attr("href");
|
||||
if (hubcloudLink) {
|
||||
@@ -19,18 +29,18 @@ const getStream = async ({ link, signal, providerContext, }) => {
|
||||
}
|
||||
}
|
||||
if (newLink.includes("gdflix")) {
|
||||
const sreams = await providerContext.extractors.gdFlixExtracter(newLink, signal);
|
||||
const sreams = yield providerContext.extractors.gdFlixExtracter(newLink, signal);
|
||||
return sreams;
|
||||
}
|
||||
const res2 = await providerContext.axios.get(newLink, { signal });
|
||||
const res2 = yield providerContext.axios.get(newLink, { signal });
|
||||
const data2 = res2.data;
|
||||
const hcLink = data2.match(/location\.replace\('([^']+)'/)?.[1] || newLink;
|
||||
const hubCloudLinks = await providerContext.extractors.hubcloudExtracter(hcLink.includes("https://hubcloud") ? hcLink : newLink, signal);
|
||||
const hcLink = ((_b = data2.match(/location\.replace\('([^']+)'/)) === null || _b === void 0 ? void 0 : _b[1]) || newLink;
|
||||
const hubCloudLinks = yield providerContext.extractors.hubcloudExtracter(hcLink.includes("https://hubcloud") ? hcLink : newLink, signal);
|
||||
return hubCloudLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
});
|
||||
exports.getStream = getStream;
|
||||
|
||||
Reference in New Issue
Block a user