mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
renaming
This commit is contained in:
20
providers/cinemaLuxe/catalog.ts
Normal file
20
providers/cinemaLuxe/catalog.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export const catalog = [
|
||||
{
|
||||
title: "Trending",
|
||||
filter: "/genre/latest-trending-releases/",
|
||||
},
|
||||
{
|
||||
title: "Netflix",
|
||||
filter: "/network/netflix/",
|
||||
},
|
||||
{
|
||||
title: "Amazon Prime",
|
||||
filter: "/network/prime-video/",
|
||||
},
|
||||
{
|
||||
title: "Animation",
|
||||
filter: "/genre/anime/",
|
||||
},
|
||||
];
|
||||
|
||||
export const genres = [];
|
||||
@@ -1,20 +0,0 @@
|
||||
export const 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/',
|
||||
},
|
||||
];
|
||||
|
||||
export const clGenresList = [];
|
||||
@@ -1,6 +1,6 @@
|
||||
import {EpisodeLink, ProviderContext} from '../types';
|
||||
import { EpisodeLink, ProviderContext } from "../types";
|
||||
|
||||
export const clsEpisodeLinks = async function ({
|
||||
export const getEpisodes = async function ({
|
||||
url,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -8,7 +8,7 @@ export const clsEpisodeLinks = async function ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<EpisodeLink[]> {
|
||||
try {
|
||||
if (!url.includes('luxelinks') || url.includes('luxecinema')) {
|
||||
if (!url.includes("luxelinks") || url.includes("luxecinema")) {
|
||||
const res = await providerContext.axios.get(url, {
|
||||
headers: providerContext.commonHeaders,
|
||||
});
|
||||
@@ -18,14 +18,14 @@ export const clsEpisodeLinks = async function ({
|
||||
url = encodedLink ? atob(encodedLink) : url;
|
||||
} else {
|
||||
const redirectUrlRes = await fetch(
|
||||
'https://ext.8man.me/api/cinemaluxe',
|
||||
"https://ext.8man.me/api/cinemaluxe",
|
||||
{
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({url}),
|
||||
},
|
||||
body: JSON.stringify({ url }),
|
||||
}
|
||||
);
|
||||
const redirectUrl = await redirectUrlRes.json();
|
||||
url = redirectUrl?.redirectUrl || url;
|
||||
@@ -37,37 +37,37 @@ export const clsEpisodeLinks = async function ({
|
||||
const html = res.data;
|
||||
let $ = providerContext.cheerio.load(html);
|
||||
const episodeLinks: EpisodeLink[] = [];
|
||||
if (url.includes('luxedrive')) {
|
||||
if (url.includes("luxedrive")) {
|
||||
episodeLinks.push({
|
||||
title: 'Movie',
|
||||
title: "Movie",
|
||||
link: url,
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
$('a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button').map(
|
||||
$("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map(
|
||||
(i, element) => {
|
||||
const title = $(element).text()?.trim();
|
||||
const link = $(element).attr('href');
|
||||
const link = $(element).attr("href");
|
||||
if (
|
||||
title &&
|
||||
link &&
|
||||
!title.includes('Batch') &&
|
||||
!title.toLowerCase().includes('zip')
|
||||
!title.includes("Batch") &&
|
||||
!title.toLowerCase().includes("zip")
|
||||
) {
|
||||
episodeLinks.push({
|
||||
title: title
|
||||
.replace(/\(\d{4}\)/, '')
|
||||
.replace('Download', 'Movie')
|
||||
.replace('⚡', '')
|
||||
.replace(/\(\d{4}\)/, "")
|
||||
.replace("Download", "Movie")
|
||||
.replace("⚡", "")
|
||||
.trim(),
|
||||
link,
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
return episodeLinks;
|
||||
} catch (err) {
|
||||
console.error('cl episode links', err);
|
||||
console.error("cl episode links", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
import {clGenresList, clCatalog} from './clCatalog';
|
||||
import {clGetInfo} from './clGetMeta';
|
||||
import {clsEpisodeLinks} from './clGetEpisodes';
|
||||
import {clGetPostsSearch, clGetPosts} from './clGetPosts';
|
||||
import {ProviderType} from '../types';
|
||||
import {clGetStream} from './clGetSteam';
|
||||
|
||||
export const cinemaLuxe: ProviderType = {
|
||||
catalog: clCatalog,
|
||||
genres: clGenresList,
|
||||
GetHomePosts: clGetPosts,
|
||||
GetMetaData: clGetInfo,
|
||||
GetSearchPosts: clGetPostsSearch,
|
||||
GetEpisodeLinks: clsEpisodeLinks,
|
||||
GetStream: clGetStream,
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Info, Link, ProviderContext} from '../types';
|
||||
import { Info, Link, ProviderContext } from "../types";
|
||||
|
||||
export const clGetInfo = async function ({
|
||||
export const getMeta = async function ({
|
||||
link,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -14,36 +14,36 @@ export const clGetInfo = async function ({
|
||||
});
|
||||
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')
|
||||
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())
|
||||
const rating = Number($("#repimdb").find("strong").text())
|
||||
.toFixed(1)
|
||||
.toString();
|
||||
const links: Link[] = [];
|
||||
$('.mb-center.maxbutton-5-center,.ep-button-container').map(
|
||||
$(".mb-center.maxbutton-5-center,.ep-button-container").map(
|
||||
(i, element) => {
|
||||
const title = $(element)
|
||||
.text()
|
||||
.replace('\u2b07Download', '')
|
||||
.replace('\u2b07 Download', '')
|
||||
.replace("\u2b07Download", "")
|
||||
.replace("\u2b07 Download", "")
|
||||
.trim();
|
||||
const link = $(element).find('a').attr('href');
|
||||
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') || '',
|
||||
quality: title?.match(/\d+P\b/)?.[0].replace("P", "p") || "",
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
return {
|
||||
title,
|
||||
@@ -58,11 +58,11 @@ export const clGetInfo = async function ({
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: 'movie',
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Post, ProviderContext} from '../types';
|
||||
import { Post, ProviderContext } from "../types";
|
||||
|
||||
export const clGetPosts = async function ({
|
||||
export const getPosts = async function ({
|
||||
filter,
|
||||
page,
|
||||
signal,
|
||||
@@ -11,12 +11,12 @@ export const clGetPosts = async function ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> {
|
||||
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
|
||||
const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
|
||||
const url = `${baseUrl + filter}page/${page}/`;
|
||||
return posts({url, signal, providerContext});
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
|
||||
export const clGetPostsSearch = async function ({
|
||||
export const getSearchPosts = async function ({
|
||||
searchQuery,
|
||||
page,
|
||||
signal,
|
||||
@@ -28,9 +28,9 @@ export const clGetPostsSearch = async function ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> {
|
||||
const baseUrl = await providerContext.getBaseUrl('cinemaLuxe');
|
||||
const baseUrl = await providerContext.getBaseUrl("cinemaLuxe");
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
return posts({url, signal, providerContext});
|
||||
return posts({ url, signal, providerContext });
|
||||
};
|
||||
|
||||
async function posts({
|
||||
@@ -50,10 +50,10 @@ async function posts({
|
||||
const data = await res.text();
|
||||
const $ = providerContext.cheerio.load(data);
|
||||
const catalog: Post[] = [];
|
||||
$('.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');
|
||||
$(".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,
|
||||
@@ -62,10 +62,10 @@ async function posts({
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.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');
|
||||
$(".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,
|
||||
@@ -76,7 +76,7 @@ async function posts({
|
||||
});
|
||||
return catalog;
|
||||
} catch (err) {
|
||||
console.error('cinemaluxe error ', err);
|
||||
console.error("cinemaluxe error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Stream, ProviderContext} from '../types';
|
||||
import { Stream, ProviderContext } from "../types";
|
||||
|
||||
export const clGetStream = async ({
|
||||
export const getStream = async ({
|
||||
link,
|
||||
signal,
|
||||
providerContext,
|
||||
@@ -12,32 +12,32 @@ export const clGetStream = async ({
|
||||
}): Promise<Stream[]> => {
|
||||
try {
|
||||
let newLink = link;
|
||||
if (link.includes('luxedrive')) {
|
||||
if (link.includes("luxedrive")) {
|
||||
const res = await providerContext.axios.get(link);
|
||||
const $ = providerContext.cheerio.load(res.data);
|
||||
const hubcloudLink = $('a.btn.hubcloud').attr('href');
|
||||
const hubcloudLink = $("a.btn.hubcloud").attr("href");
|
||||
if (hubcloudLink) {
|
||||
newLink = hubcloudLink;
|
||||
} else {
|
||||
const gdFlixLink = $('a.btn.gdflix').attr('href');
|
||||
const gdFlixLink = $("a.btn.gdflix").attr("href");
|
||||
if (gdFlixLink) {
|
||||
newLink = gdFlixLink;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newLink.includes('gdflix')) {
|
||||
if (newLink.includes("gdflix")) {
|
||||
const sreams = await providerContext.extractors.gdFlixExtracter(
|
||||
newLink,
|
||||
signal,
|
||||
signal
|
||||
);
|
||||
return sreams;
|
||||
}
|
||||
const res2 = await providerContext.axios.get(newLink, {signal});
|
||||
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,
|
||||
hcLink.includes("https://hubcloud") ? hcLink : newLink,
|
||||
signal
|
||||
);
|
||||
return hubCloudLinks;
|
||||
} catch (err) {
|
||||
Reference in New Issue
Block a user