mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
init
This commit is contained in:
18
dist/flixhq/flixhqCatalog.js
vendored
Normal file
18
dist/flixhq/flixhqCatalog.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGenresList = exports.flixhqCatalog = void 0;
|
||||
exports.flixhqCatalog = [
|
||||
{
|
||||
title: 'Trending',
|
||||
filter: '/trending',
|
||||
},
|
||||
{
|
||||
title: 'Movies',
|
||||
filter: '/recent-movies',
|
||||
},
|
||||
{
|
||||
title: 'TV Shows',
|
||||
filter: '/recent-shows',
|
||||
},
|
||||
];
|
||||
exports.flixhqGenresList = [];
|
||||
56
dist/flixhq/flixhqGetInfo.js
vendored
Normal file
56
dist/flixhq/flixhqGetInfo.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGetInfo = void 0;
|
||||
const flixhqGetInfo = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const url = `${baseUrl}/movies/flixhq/info?id=` + id;
|
||||
const res = await 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?.type, data?.duration, data.releaseDate.split('-')[0]],
|
||||
imdbId: '',
|
||||
type: data.episodes.length > 1 ? 'series' : 'movie',
|
||||
};
|
||||
const links = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
const title = episode?.number
|
||||
? 'Season-' + episode?.season + ' Ep-' + episode.number
|
||||
: episode.title;
|
||||
const link = episode.id + '*' + data.id;
|
||||
if (link && title) {
|
||||
links.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
...meta,
|
||||
linkList: [
|
||||
{
|
||||
title: meta.title,
|
||||
directLinks: links,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.flixhqGetInfo = flixhqGetInfo;
|
||||
44
dist/flixhq/flixhqGetPosts.js
vendored
Normal file
44
dist/flixhq/flixhqGetPosts.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGetSearchPost = exports.flixhqGetPosts = void 0;
|
||||
const flixhqGetPosts = async function ({ filter, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = await getBaseUrl('consumet');
|
||||
const baseUrl = urlRes + '/movies/flixhq';
|
||||
const url = `${baseUrl + filter}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.flixhqGetPosts = flixhqGetPosts;
|
||||
const flixhqGetSearchPost = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const urlRes = await getBaseUrl('consumet');
|
||||
const baseUrl = urlRes + '/movies/flixhq';
|
||||
const url = `${baseUrl}/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.flixhqGetSearchPost = flixhqGetSearchPost;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios } = providerContext;
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.results || res.data;
|
||||
const catalog = [];
|
||||
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 [];
|
||||
}
|
||||
}
|
||||
55
dist/flixhq/flixhqGetStream.js
vendored
Normal file
55
dist/flixhq/flixhqGetStream.js
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhqGetStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const flixhqGetStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl } = providerContext;
|
||||
const episodeId = id.split('*')[0];
|
||||
const mediaId = id.split('*')[1];
|
||||
const baseUrl = await getBaseUrl('consumet');
|
||||
const serverUrl = `${baseUrl}/movies/flixhq/servers?episodeId=${episodeId}&mediaId=${mediaId}`;
|
||||
const res = await fetch(serverUrl);
|
||||
const servers = await res.json();
|
||||
const streamLinks = [];
|
||||
for (const server of servers) {
|
||||
const streamUrl = `${baseUrl}/movies/flixhq/watch?server=` +
|
||||
server.name +
|
||||
'&episodeId=' +
|
||||
episodeId +
|
||||
'&mediaId=' +
|
||||
mediaId;
|
||||
const streamRes = await fetch(streamUrl);
|
||||
const streamData = await streamRes.json();
|
||||
const subtitles = [];
|
||||
if (streamData?.sources?.length > 0) {
|
||||
if (streamData.subtitles) {
|
||||
streamData.subtitles.forEach((sub) => {
|
||||
subtitles.push({
|
||||
language: sub?.lang?.slice(0, 2),
|
||||
uri: sub?.url,
|
||||
type: types_1.TextTrackType.VTT,
|
||||
title: sub?.lang,
|
||||
});
|
||||
});
|
||||
}
|
||||
streamData.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: server?.name +
|
||||
'-' +
|
||||
source?.quality?.replace('auto', 'MultiQuality'),
|
||||
link: source.url,
|
||||
type: source.isM3U8 ? 'm3u8' : 'mp4',
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.flixhqGetStream = flixhqGetStream;
|
||||
26
dist/flixhq/index.js
vendored
Normal file
26
dist/flixhq/index.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.flixhq = void 0;
|
||||
const flixhqCatalog_1 = require("./flixhqCatalog");
|
||||
const flixhqGetInfo_1 = require("./flixhqGetInfo");
|
||||
const flixhqGetPosts_1 = require("./flixhqGetPosts");
|
||||
const flixhqGetStream_1 = require("./flixhqGetStream");
|
||||
exports.flixhq = {
|
||||
catalog: flixhqCatalog_1.flixhqCatalog,
|
||||
genres: flixhqCatalog_1.flixhqGenresList,
|
||||
GetMetaData: flixhqGetInfo_1.flixhqGetInfo,
|
||||
GetHomePosts: flixhqGetPosts_1.flixhqGetPosts,
|
||||
GetStream: flixhqGetStream_1.flixhqGetStream,
|
||||
GetSearchPosts: flixhqGetPosts_1.flixhqGetSearchPost,
|
||||
nonDownloadableServer: ['upcloud-MultiQuality', 'vidcloud-MultiQuality'],
|
||||
nonStreamableServer: [
|
||||
'upcloud-1080',
|
||||
'upcloud-720',
|
||||
'upcloud-480',
|
||||
'upcloud-360',
|
||||
'vidcloud-1080',
|
||||
'vidcloud-720',
|
||||
'vidcloud-480',
|
||||
'vidcloud-360',
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user