mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
minify
This commit is contained in:
19
dist/flixhq/catalog.js
vendored
19
dist/flixhq/catalog.js
vendored
@@ -1,18 +1 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Trending",
|
||||
filter: "/trending",
|
||||
},
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/recent-movies",
|
||||
},
|
||||
{
|
||||
title: "TV Shows",
|
||||
filter: "/recent-shows",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Trending",filter:"/trending"},{title:"Movies",filter:"/recent-movies"},{title:"TV Shows",filter:"/recent-shows"}],exports.genres=[];
|
||||
65
dist/flixhq/meta.js
vendored
65
dist/flixhq/meta.js
vendored
@@ -1,64 +1 @@
|
||||
"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.getMeta = void 0;
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = yield getBaseUrl("consumet");
|
||||
const url = `${baseUrl}/movies/flixhq/info?id=` + id;
|
||||
const res = yield axios.get(url);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description.replace(/<[^>]*>?/gm, "").trim(),
|
||||
image: data.cover,
|
||||
cast: data.casts,
|
||||
rating: data.rating,
|
||||
tags: [data === null || data === void 0 ? void 0 : data.type, data === null || data === void 0 ? void 0 : data.duration, data.releaseDate.split("-")[0]],
|
||||
imdbId: "",
|
||||
type: data.episodes.length > 1 ? "series" : "movie",
|
||||
};
|
||||
const links = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
const title = (episode === null || episode === void 0 ? void 0 : episode.number)
|
||||
? "Season-" + (episode === null || episode === void 0 ? void 0 : episode.season) + " Ep-" + episode.number
|
||||
: episode.title;
|
||||
const link = episode.id + "*" + data.id;
|
||||
if (link && title) {
|
||||
links.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return Object.assign(Object.assign({}, meta), { linkList: [
|
||||
{
|
||||
title: meta.title,
|
||||
directLinks: links,
|
||||
},
|
||||
] });
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(s,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function r(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,r)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){try{const{axios:i,getBaseUrl:n}=e,s=`${yield n("consumet")}/movies/flixhq/info?id=`+t,o=(yield i.get(s)).data,a={title:o.title,synopsis:o.description.replace(/<[^>]*>?/gm,"").trim(),image:o.cover,cast:o.casts,rating:o.rating,tags:[null==o?void 0:o.type,null==o?void 0:o.duration,o.releaseDate.split("-")[0]],imdbId:"",type:o.episodes.length>1?"series":"movie"},r=[];return o.episodes.forEach(t=>{const e=(null==t?void 0:t.number)?"Season-"+(null==t?void 0:t.season)+" Ep-"+t.number:t.title,i=t.id+"*"+o.id;i&&e&&r.push({title:e,link:i})}),Object.assign(Object.assign({},a),{linkList:[{title:a.title,directLinks:r}]})}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
61
dist/flixhq/posts.js
vendored
61
dist/flixhq/posts.js
vendored
@@ -1,60 +1 @@
|
||||
"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.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = yield getBaseUrl("consumet");
|
||||
const baseUrl = urlRes + "/movies/flixhq";
|
||||
const url = `${baseUrl + filter}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
});
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = yield getBaseUrl("consumet");
|
||||
const baseUrl = urlRes + "/movies/flixhq";
|
||||
const url = `${baseUrl}/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
});
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, signal, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = yield axios.get(url, { signal });
|
||||
const data = ((_b = res.data) === null || _b === void 0 ? void 0 : _b.results) || res.data;
|
||||
const catalog = [];
|
||||
data === null || data === void 0 ? void 0 : data.map((element) => {
|
||||
const title = element.title;
|
||||
const link = element.id;
|
||||
const image = element.image;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("flixhq error ", err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(r,s){function i(t){try{u(o.next(t))}catch(t){s(t)}}function a(t){try{u(o.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(i,a)}u((o=o.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,signal:e,providerContext:n}){const{getBaseUrl:o}=n;return posts({url:`${(yield o("consumet"))+"/movies/flixhq"+t}`,signal:e,providerContext:n})})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:n,providerContext:o}){const{getBaseUrl:r}=o;return posts({url:`${(yield r("consumet"))+"/movies/flixhq"}/${t}?page=${e}`,signal:n,providerContext:o})})};function posts(t){return __awaiter(this,arguments,void 0,function*({url:t,signal:e,providerContext:n}){var o;try{const{axios:r}=n,s=yield r.get(t,{signal:e}),i=(null===(o=s.data)||void 0===o?void 0:o.results)||s.data,a=[];return null==i||i.map(t=>{const e=t.title,n=t.id,o=t.image;e&&n&&o&&a.push({title:e,link:n,image:o})}),a}catch(t){return[]}})}exports.getSearchPosts=getSearchPosts;
|
||||
69
dist/flixhq/stream.js
vendored
69
dist/flixhq/stream.js
vendored
@@ -1,68 +1 @@
|
||||
"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 = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link: id, providerContext, }) {
|
||||
var _b;
|
||||
try {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const episodeId = id.split("*")[0];
|
||||
const mediaId = id.split("*")[1];
|
||||
const baseUrl = yield getBaseUrl("consumet");
|
||||
const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`;
|
||||
const res = yield fetch(serverUrl);
|
||||
const servers = yield res.json();
|
||||
const streamLinks = [];
|
||||
for (const server of servers) {
|
||||
const streamUrl = `${baseUrl}/movies/flixhq/watch?server=` +
|
||||
server.name +
|
||||
"&episodeId=" +
|
||||
episodeId +
|
||||
"&mediaId=" +
|
||||
mediaId;
|
||||
const streamRes = yield fetch(streamUrl);
|
||||
const streamData = yield streamRes.json();
|
||||
const subtitles = [];
|
||||
if (((_b = streamData === null || streamData === void 0 ? void 0 : streamData.sources) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
||||
if (streamData.subtitles) {
|
||||
streamData.subtitles.forEach((sub) => {
|
||||
var _a;
|
||||
subtitles.push({
|
||||
language: (_a = sub === null || sub === void 0 ? void 0 : sub.lang) === null || _a === void 0 ? void 0 : _a.slice(0, 2),
|
||||
uri: sub === null || sub === void 0 ? void 0 : sub.url,
|
||||
type: "text/vtt",
|
||||
title: sub === null || sub === void 0 ? void 0 : sub.lang,
|
||||
});
|
||||
});
|
||||
}
|
||||
streamData.sources.forEach((source) => {
|
||||
var _a;
|
||||
streamLinks.push({
|
||||
server: (server === null || server === void 0 ? void 0 : server.name) +
|
||||
"-" +
|
||||
((_a = source === null || source === void 0 ? void 0 : source.quality) === null || _a === void 0 ? void 0 : _a.replace("auto", "MultiQuality")),
|
||||
link: source.url,
|
||||
type: source.isM3U8 ? "m3u8" : "mp4",
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,l){function r(e){try{u(n.next(e))}catch(e){l(e)}}function s(e){try{u(n.throw(e))}catch(e){l(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,s)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(e){return __awaiter(this,arguments,void 0,function*({link:e,providerContext:t}){var i;try{const{getBaseUrl:n}=t,o=e.split("*")[0],l=e.split("*")[1],r=yield n("consumet"),s=`${r}/movies/flixhq/servers?episodeId=${o}&mediaId=${l}`,u=yield fetch(s),a=yield u.json(),c=[];for(const e of a){const t=`${r}/movies/flixhq/watch?server=`+e.name+"&episodeId="+o+"&mediaId="+l,n=yield fetch(t),s=yield n.json(),u=[];(null===(i=null==s?void 0:s.sources)||void 0===i?void 0:i.length)>0&&(s.subtitles&&s.subtitles.forEach(e=>{var t;u.push({language:null===(t=null==e?void 0:e.lang)||void 0===t?void 0:t.slice(0,2),uri:null==e?void 0:e.url,type:"text/vtt",title:null==e?void 0:e.lang})}),s.sources.forEach(t=>{var i;c.push({server:(null==e?void 0:e.name)+"-"+(null===(i=null==t?void 0:t.quality)||void 0===i?void 0:i.replace("auto","MultiQuality")),link:t.url,type:t.isM3U8?"m3u8":"mp4",subtitles:u})}))}return c}catch(e){return[]}})};exports.getStream=getStream;
|
||||
Reference in New Issue
Block a user