mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
init
This commit is contained in:
22
dist/cinemaLuxe/clCatalog.js
vendored
Normal file
22
dist/cinemaLuxe/clCatalog.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGenresList = exports.clCatalog = void 0;
|
||||
exports.clCatalog = [
|
||||
{
|
||||
title: 'Trending',
|
||||
filter: '/genre/latest-trending-releases/',
|
||||
},
|
||||
{
|
||||
title: 'Netflix',
|
||||
filter: '/network/netflix/',
|
||||
},
|
||||
{
|
||||
title: 'Amazon Prime',
|
||||
filter: '/network/prime-video/',
|
||||
},
|
||||
{
|
||||
title: 'Animation',
|
||||
filter: '/genre/anime/',
|
||||
},
|
||||
];
|
||||
exports.clGenresList = [];
|
||||
64
dist/cinemaLuxe/clGetEpisodes.js
vendored
Normal file
64
dist/cinemaLuxe/clGetEpisodes.js
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clsEpisodeLinks = void 0;
|
||||
const clsEpisodeLinks = async function ({ url, providerContext, }) {
|
||||
try {
|
||||
if (!url.includes('luxelinks') || url.includes('luxecinema')) {
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const encodedLink = data.match(/"link":"([^"]+)"/)?.[1];
|
||||
if (encodedLink) {
|
||||
url = encodedLink ? atob(encodedLink) : url;
|
||||
}
|
||||
else {
|
||||
const redirectUrlRes = await fetch('https://ext.8man.me/api/cinemaluxe', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
const redirectUrl = await redirectUrlRes.json();
|
||||
url = redirectUrl?.redirectUrl || url;
|
||||
}
|
||||
}
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const html = res.data;
|
||||
let $ = providerContext.cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
if (url.includes('luxedrive')) {
|
||||
episodeLinks.push({
|
||||
title: 'Movie',
|
||||
link: url,
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
$('a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button').map((i, element) => {
|
||||
const title = $(element).text()?.trim();
|
||||
const link = $(element).attr('href');
|
||||
if (title &&
|
||||
link &&
|
||||
!title.includes('Batch') &&
|
||||
!title.toLowerCase().includes('zip')) {
|
||||
episodeLinks.push({
|
||||
title: title
|
||||
.replace(/\(\d{4}\)/, '')
|
||||
.replace('Download', 'Movie')
|
||||
.replace('⚡', '')
|
||||
.trim(),
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('cl episode links', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.clsEpisodeLinks = clsEpisodeLinks;
|
||||
64
dist/cinemaLuxe/clGetMeta.js
vendored
Normal file
64
dist/cinemaLuxe/clGetMeta.js
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGetInfo = void 0;
|
||||
const clGetInfo = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const url = link;
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
const data = res.data;
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const type = url.includes('tvshows') ? 'series' : 'movie';
|
||||
const imdbId = '';
|
||||
const title = url.split('/')[4].replace(/-/g, ' ');
|
||||
const image = $('.g-item').find('a').attr('href') || '';
|
||||
const synopsis = $('.wp-content').text().trim();
|
||||
const tags = $('.sgeneros')
|
||||
.children()
|
||||
.map((i, element) => $(element).text())
|
||||
.get()
|
||||
.slice(3);
|
||||
const rating = Number($('#repimdb').find('strong').text())
|
||||
.toFixed(1)
|
||||
.toString();
|
||||
const links = [];
|
||||
$('.mb-center.maxbutton-5-center,.ep-button-container').map((i, element) => {
|
||||
const title = $(element)
|
||||
.text()
|
||||
.replace('\u2b07Download', '')
|
||||
.replace('\u2b07 Download', '')
|
||||
.trim();
|
||||
const link = $(element).find('a').attr('href');
|
||||
if (title && link) {
|
||||
links.push({
|
||||
title,
|
||||
episodesLink: link,
|
||||
quality: title?.match(/\d+P\b/)?.[0].replace('P', 'p') || '',
|
||||
});
|
||||
}
|
||||
});
|
||||
return {
|
||||
title,
|
||||
tags,
|
||||
rating,
|
||||
synopsis,
|
||||
image,
|
||||
imdbId,
|
||||
type,
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.clGetInfo = clGetInfo;
|
||||
55
dist/cinemaLuxe/clGetPosts.js
vendored
Normal file
55
dist/cinemaLuxe/clGetPosts.js
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGetPostsSearch = exports.clGetPosts = void 0;
|
||||
const clGetPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
|
||||
const url = `${baseUrl + filter}page/${page}/`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.clGetPosts = clGetPosts;
|
||||
const clGetPostsSearch = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
exports.clGetPostsSearch = clGetPostsSearch;
|
||||
async function posts({ url, signal, providerContext, }) {
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
signal,
|
||||
});
|
||||
const data = await res.text();
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('.item.tvshows,.item.movies').map((i, element) => {
|
||||
const title = $(element).find('.poster').find('img').attr('alt');
|
||||
const link = $(element).find('.poster').find('a').attr('href');
|
||||
const image = $(element).find('.poster').find('img').attr('data-src');
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.result-item').map((i, element) => {
|
||||
const title = $(element).find('.thumbnail').find('img').attr('alt');
|
||||
const link = $(element).find('.thumbnail').find('a').attr('href');
|
||||
const image = $(element).find('.thumbnail').find('img').attr('data-src');
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('cinemaluxe error ', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
36
dist/cinemaLuxe/clGetSteam.js
vendored
Normal file
36
dist/cinemaLuxe/clGetSteam.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clGetStream = void 0;
|
||||
const clGetStream = async ({ link, signal, providerContext, }) => {
|
||||
try {
|
||||
let newLink = link;
|
||||
if (link.includes('luxedrive')) {
|
||||
const res = await providerContext.axios.get(link);
|
||||
const $ = providerContext.cheerio.load(res.data);
|
||||
const hubcloudLink = $('a.btn.hubcloud').attr('href');
|
||||
if (hubcloudLink) {
|
||||
newLink = hubcloudLink;
|
||||
}
|
||||
else {
|
||||
const gdFlixLink = $('a.btn.gdflix').attr('href');
|
||||
if (gdFlixLink) {
|
||||
newLink = gdFlixLink;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newLink.includes('gdflix')) {
|
||||
const sreams = await providerContext.extractors.gdFlixExtracter(newLink, signal);
|
||||
return sreams;
|
||||
}
|
||||
const res2 = await 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);
|
||||
return hubCloudLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.clGetStream = clGetStream;
|
||||
17
dist/cinemaLuxe/index.js
vendored
Normal file
17
dist/cinemaLuxe/index.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cinemaLuxe = void 0;
|
||||
const clCatalog_1 = require("./clCatalog");
|
||||
const clGetMeta_1 = require("./clGetMeta");
|
||||
const clGetEpisodes_1 = require("./clGetEpisodes");
|
||||
const clGetPosts_1 = require("./clGetPosts");
|
||||
const clGetSteam_1 = require("./clGetSteam");
|
||||
exports.cinemaLuxe = {
|
||||
catalog: clCatalog_1.clCatalog,
|
||||
genres: clCatalog_1.clGenresList,
|
||||
GetHomePosts: clGetPosts_1.clGetPosts,
|
||||
GetMetaData: clGetMeta_1.clGetInfo,
|
||||
GetSearchPosts: clGetPosts_1.clGetPostsSearch,
|
||||
GetEpisodeLinks: clGetEpisodes_1.clsEpisodeLinks,
|
||||
GetStream: clGetSteam_1.clGetStream,
|
||||
};
|
||||
Reference in New Issue
Block a user