mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
renaming
This commit is contained in:
@@ -1,101 +1,101 @@
|
||||
export const homeList = [
|
||||
export const catalog = [
|
||||
{
|
||||
title: 'New',
|
||||
filter: '',
|
||||
title: "New",
|
||||
filter: "",
|
||||
},
|
||||
{
|
||||
title: 'Netflix',
|
||||
filter: 'web-series/netflix',
|
||||
title: "Netflix",
|
||||
filter: "web-series/netflix",
|
||||
},
|
||||
{
|
||||
title: 'Amazon Prime',
|
||||
filter: 'web-series/amazon-prime-video',
|
||||
title: "Amazon Prime",
|
||||
filter: "web-series/amazon-prime-video",
|
||||
},
|
||||
{
|
||||
title: '4K Movies',
|
||||
filter: 'movies-by-quality/2160p',
|
||||
title: "4K Movies",
|
||||
filter: "movies-by-quality/2160p",
|
||||
},
|
||||
];
|
||||
|
||||
export const genresList = [
|
||||
export const genres = [
|
||||
{
|
||||
title: 'Action',
|
||||
filter: 'category/movies-by-genres/action',
|
||||
title: "Action",
|
||||
filter: "category/movies-by-genres/action",
|
||||
},
|
||||
{
|
||||
title: 'Adventure',
|
||||
filter: 'category/movies-by-genres/adventure',
|
||||
title: "Adventure",
|
||||
filter: "category/movies-by-genres/adventure",
|
||||
},
|
||||
{
|
||||
title: 'Animation',
|
||||
filter: 'category/movies-by-genres/animation',
|
||||
title: "Animation",
|
||||
filter: "category/movies-by-genres/animation",
|
||||
},
|
||||
{
|
||||
title: 'Biography',
|
||||
filter: 'category/movies-by-genres/biography',
|
||||
title: "Biography",
|
||||
filter: "category/movies-by-genres/biography",
|
||||
},
|
||||
{
|
||||
title: 'Comedy',
|
||||
filter: 'category/movies-by-genres/comedy',
|
||||
title: "Comedy",
|
||||
filter: "category/movies-by-genres/comedy",
|
||||
},
|
||||
{
|
||||
title: 'Crime',
|
||||
filter: 'category/movies-by-genres/crime',
|
||||
title: "Crime",
|
||||
filter: "category/movies-by-genres/crime",
|
||||
},
|
||||
{
|
||||
title: 'Documentary',
|
||||
filter: 'category/movies-by-genres/documentary',
|
||||
title: "Documentary",
|
||||
filter: "category/movies-by-genres/documentary",
|
||||
},
|
||||
{
|
||||
title: 'Drama',
|
||||
filter: 'category/movies-by-genres/drama',
|
||||
title: "Drama",
|
||||
filter: "category/movies-by-genres/drama",
|
||||
},
|
||||
{
|
||||
title: 'Family',
|
||||
filter: 'category/movies-by-genres/family',
|
||||
title: "Family",
|
||||
filter: "category/movies-by-genres/family",
|
||||
},
|
||||
{
|
||||
title: 'Fantasy',
|
||||
filter: 'category/movies-by-genres/fantasy',
|
||||
title: "Fantasy",
|
||||
filter: "category/movies-by-genres/fantasy",
|
||||
},
|
||||
{
|
||||
title: 'History',
|
||||
filter: 'category/movies-by-genres/history',
|
||||
title: "History",
|
||||
filter: "category/movies-by-genres/history",
|
||||
},
|
||||
{
|
||||
title: 'Horror',
|
||||
filter: 'category/movies-by-genres/horror',
|
||||
title: "Horror",
|
||||
filter: "category/movies-by-genres/horror",
|
||||
},
|
||||
{
|
||||
title: 'Music',
|
||||
filter: 'category/movies-by-genres/music',
|
||||
title: "Music",
|
||||
filter: "category/movies-by-genres/music",
|
||||
},
|
||||
{
|
||||
title: 'Mystery',
|
||||
filter: 'category/movies-by-genres/mystery',
|
||||
title: "Mystery",
|
||||
filter: "category/movies-by-genres/mystery",
|
||||
},
|
||||
{
|
||||
title: 'Romance',
|
||||
filter: 'category/movies-by-genres/romance',
|
||||
title: "Romance",
|
||||
filter: "category/movies-by-genres/romance",
|
||||
},
|
||||
{
|
||||
title: 'Sci-Fi',
|
||||
filter: 'category/movies-by-genres/sci-fi',
|
||||
title: "Sci-Fi",
|
||||
filter: "category/movies-by-genres/sci-fi",
|
||||
},
|
||||
{
|
||||
title: 'Sport',
|
||||
filter: 'category/movies-by-genres/sport',
|
||||
title: "Sport",
|
||||
filter: "category/movies-by-genres/sport",
|
||||
},
|
||||
{
|
||||
title: 'Thriller',
|
||||
filter: 'category/movies-by-genres/thriller',
|
||||
title: "Thriller",
|
||||
filter: "category/movies-by-genres/thriller",
|
||||
},
|
||||
{
|
||||
title: 'War',
|
||||
filter: 'category/movies-by-genres/war',
|
||||
title: "War",
|
||||
filter: "category/movies-by-genres/war",
|
||||
},
|
||||
{
|
||||
title: 'Western',
|
||||
filter: 'category/movies-by-genres/western',
|
||||
title: "Western",
|
||||
filter: "category/movies-by-genres/western",
|
||||
},
|
||||
];
|
||||
|
||||
39
providers/vega/episodes.ts
Normal file
39
providers/vega/episodes.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { EpisodeLink, ProviderContext } from "../types";
|
||||
|
||||
export const getEpisodes = async function ({
|
||||
url,
|
||||
providerContext,
|
||||
}: {
|
||||
url: string;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<EpisodeLink[]> {
|
||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||
console.log("getEpisodeLinks", url);
|
||||
try {
|
||||
const res = await axios.get(url, { headers });
|
||||
const $ = cheerio.load(res.data);
|
||||
const container = $(".entry-content,.entry-inner");
|
||||
$(".unili-content,.code-block-1").remove();
|
||||
const episodes: EpisodeLink[] = [];
|
||||
container.find("h4").each((index, element) => {
|
||||
const el = $(element);
|
||||
const title = el.text().replaceAll("-", "").replaceAll(":", "");
|
||||
const link = el
|
||||
.next("p")
|
||||
.find(
|
||||
'.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]'
|
||||
)
|
||||
.parent()
|
||||
.attr("href");
|
||||
if (title && link) {
|
||||
episodes.push({ title, link });
|
||||
}
|
||||
});
|
||||
// console.log(episodes);
|
||||
return episodes;
|
||||
} catch (err) {
|
||||
console.log("getEpisodeLinks error: ");
|
||||
// console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,39 +0,0 @@
|
||||
import {EpisodeLink, ProviderContext} from '../types';
|
||||
|
||||
export const vegaGetEpisodeLinks = async function ({
|
||||
url,
|
||||
providerContext,
|
||||
}: {
|
||||
url: string;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<EpisodeLink[]> {
|
||||
const {axios, cheerio, commonHeaders: headers} = providerContext;
|
||||
console.log('getEpisodeLinks', url);
|
||||
try {
|
||||
const res = await axios.get(url, {headers});
|
||||
const $ = cheerio.load(res.data);
|
||||
const container = $('.entry-content,.entry-inner');
|
||||
$('.unili-content,.code-block-1').remove();
|
||||
const episodes: EpisodeLink[] = [];
|
||||
container.find('h4').each((index, element) => {
|
||||
const el = $(element);
|
||||
const title = el.text().replaceAll('-', '').replaceAll(':', '');
|
||||
const link = el
|
||||
.next('p')
|
||||
.find(
|
||||
'.btn-outline[style="background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;"]',
|
||||
)
|
||||
.parent()
|
||||
.attr('href');
|
||||
if (title && link) {
|
||||
episodes.push({title, link});
|
||||
}
|
||||
});
|
||||
// console.log(episodes);
|
||||
return episodes;
|
||||
} catch (err) {
|
||||
console.log('getEpisodeLinks error: ');
|
||||
// console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
import {vegaGetInfo} from './getInfo';
|
||||
import {vegaGetStream} from './getStream';
|
||||
import {vegaGetEpisodeLinks} from './getEpisodesLink';
|
||||
import {vegaGetPosts, vegaGetPostsSearch} from './getPosts';
|
||||
import {homeList, genresList} from './catalog';
|
||||
import {ProviderType} from '../types';
|
||||
|
||||
export const vegaMovies: ProviderType = {
|
||||
catalog: homeList,
|
||||
genres: genresList,
|
||||
GetMetaData: vegaGetInfo,
|
||||
GetHomePosts: vegaGetPosts,
|
||||
GetStream: vegaGetStream,
|
||||
nonStreamableServer: ['filepress', 'hubcloud', 'HubCdn'],
|
||||
GetEpisodeLinks: vegaGetEpisodeLinks,
|
||||
GetSearchPosts: vegaGetPostsSearch,
|
||||
};
|
||||
@@ -1,27 +1,27 @@
|
||||
import {Info, Link, ProviderContext} from '../types';
|
||||
import { Info, Link, ProviderContext } from "../types";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Cache-Control': 'no-store',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
DNT: '1',
|
||||
'sec-ch-ua':
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Cache-Control": "no-store",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
DNT: "1",
|
||||
"sec-ch-ua":
|
||||
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-User': '?1',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "none",
|
||||
"Sec-Fetch-User": "?1",
|
||||
Cookie:
|
||||
'_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
|
||||
"_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
|
||||
export const vegaGetInfo = async ({
|
||||
export const getMeta = async ({
|
||||
link,
|
||||
providerContext,
|
||||
}: {
|
||||
@@ -29,10 +29,10 @@ export const vegaGetInfo = async ({
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Info> => {
|
||||
try {
|
||||
const {axios, cheerio} = providerContext;
|
||||
const { axios, cheerio } = providerContext;
|
||||
const url = link;
|
||||
console.log('url', url);
|
||||
const baseUrl = url.split('/').slice(0, 3).join('/');
|
||||
console.log("url", url);
|
||||
const baseUrl = url.split("/").slice(0, 3).join("/");
|
||||
const response = await axios.get(url, {
|
||||
headers: {
|
||||
...headers,
|
||||
@@ -40,92 +40,93 @@ export const vegaGetInfo = async ({
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
const infoContainer = $('.entry-content,.post-inner');
|
||||
const heading = infoContainer?.find('h3');
|
||||
const infoContainer = $(".entry-content,.post-inner");
|
||||
const heading = infoContainer?.find("h3");
|
||||
const imdbId =
|
||||
heading?.next('p')?.find('a')?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] ||
|
||||
//@ts-ignore
|
||||
heading?.next("p")?.find("a")?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] ||
|
||||
infoContainer.text().match(/tt\d+/g)?.[0] ||
|
||||
'';
|
||||
"";
|
||||
// console.log(imdbId)
|
||||
|
||||
const type = heading?.next('p')?.text()?.includes('Series Name')
|
||||
? 'series'
|
||||
: 'movie';
|
||||
const type = heading?.next("p")?.text()?.includes("Series Name")
|
||||
? "series"
|
||||
: "movie";
|
||||
// console.log(type);
|
||||
// title
|
||||
const titleRegex = /Name: (.+)/;
|
||||
const title = heading?.next('p')?.text()?.match(titleRegex)?.[1] || '';
|
||||
const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
|
||||
// console.log(title);
|
||||
|
||||
// synopsis
|
||||
const synopsisNode = infoContainer?.find('p')?.next('h3,h4')?.next('p')?.[0]
|
||||
?.children?.[0];
|
||||
const synopsisNode = //@ts-ignore
|
||||
infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
|
||||
const synopsis =
|
||||
synopsisNode && 'data' in synopsisNode ? synopsisNode.data : '';
|
||||
synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
|
||||
// console.log(synopsis);
|
||||
|
||||
// image
|
||||
let image =
|
||||
infoContainer?.find('img[data-lazy-src]')?.attr('data-lazy-src') || '';
|
||||
if (image.startsWith('//')) {
|
||||
image = 'https:' + image;
|
||||
infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || "";
|
||||
if (image.startsWith("//")) {
|
||||
image = "https:" + image;
|
||||
}
|
||||
// console.log(image);
|
||||
|
||||
// console.log({title, synopsis, image, imdbId, type});
|
||||
/// Links
|
||||
const hr = infoContainer?.first()?.find('hr');
|
||||
const list = hr?.nextUntil('hr');
|
||||
const hr = infoContainer?.first()?.find("hr");
|
||||
const list = hr?.nextUntil("hr");
|
||||
const links: Link[] = [];
|
||||
list.each((index, element: any) => {
|
||||
element = $(element);
|
||||
// title
|
||||
const title = element?.text() || '';
|
||||
const title = element?.text() || "";
|
||||
|
||||
const quality = element?.text().match(/\d+p\b/)?.[0] || '';
|
||||
const quality = element?.text().match(/\d+p\b/)?.[0] || "";
|
||||
// console.log(title);
|
||||
// movieLinks
|
||||
const movieLinks = element
|
||||
?.next()
|
||||
.find('.dwd-button')
|
||||
.find(".dwd-button")
|
||||
.text()
|
||||
.toLowerCase()
|
||||
.includes('download')
|
||||
? element?.next().find('.dwd-button')?.parent()?.attr('href')
|
||||
: '';
|
||||
.includes("download")
|
||||
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
||||
: "";
|
||||
|
||||
// episode links
|
||||
const vcloudLinks = element
|
||||
?.next()
|
||||
.find(
|
||||
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']",
|
||||
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']"
|
||||
)
|
||||
?.parent()
|
||||
?.attr('href');
|
||||
?.attr("href");
|
||||
console.log(title);
|
||||
const episodesLink =
|
||||
(vcloudLinks
|
||||
? vcloudLinks
|
||||
: element
|
||||
?.next()
|
||||
.find('.dwd-button')
|
||||
.find(".dwd-button")
|
||||
.text()
|
||||
.toLowerCase()
|
||||
.includes('episode')
|
||||
? element?.next().find('.dwd-button')?.parent()?.attr('href')
|
||||
: '') ||
|
||||
.includes("episode")
|
||||
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
||||
: "") ||
|
||||
element
|
||||
?.next()
|
||||
.find(
|
||||
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']",
|
||||
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']"
|
||||
)
|
||||
?.parent()
|
||||
?.attr('href');
|
||||
?.attr("href");
|
||||
if (movieLinks || episodesLink) {
|
||||
links.push({
|
||||
title,
|
||||
directLinks: movieLinks
|
||||
? [{title: 'Movie', link: movieLinks, type: 'movie'}]
|
||||
? [{ title: "Movie", link: movieLinks, type: "movie" }]
|
||||
: [],
|
||||
episodesLink,
|
||||
quality,
|
||||
@@ -142,15 +143,15 @@ export const vegaGetInfo = async ({
|
||||
linkList: links,
|
||||
};
|
||||
} catch (error) {
|
||||
console.log('getInfo error');
|
||||
console.log("getInfo error");
|
||||
console.error(error);
|
||||
// ToastAndroid.show('No response', ToastAndroid.SHORT);
|
||||
return {
|
||||
title: '',
|
||||
synopsis: '',
|
||||
image: '',
|
||||
imdbId: '',
|
||||
type: '',
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
import {Post, ProviderContext} from '../types';
|
||||
import { Post, ProviderContext } from "../types";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Cache-Control': 'no-store',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
DNT: '1',
|
||||
'sec-ch-ua':
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Cache-Control": "no-store",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
DNT: "1",
|
||||
"sec-ch-ua":
|
||||
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-User': '?1',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "none",
|
||||
"Sec-Fetch-User": "?1",
|
||||
Cookie:
|
||||
'_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
|
||||
"_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
|
||||
export const vegaGetPosts = async ({
|
||||
export const getPosts = async ({
|
||||
filter,
|
||||
page,
|
||||
providerValue,
|
||||
@@ -34,16 +34,16 @@ export const vegaGetPosts = async ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> => {
|
||||
const {getBaseUrl, axios, cheerio} = providerContext;
|
||||
const baseUrl = await getBaseUrl('Vega');
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("Vega");
|
||||
|
||||
console.log('vegaGetPosts baseUrl:', providerValue, baseUrl);
|
||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||
const url = `${baseUrl}/${filter}/page/${page}/`;
|
||||
console.log('vegaGetPosts url:', url);
|
||||
console.log("vegaGetPosts url:", url);
|
||||
return posts(baseUrl, url, signal, headers, axios, cheerio);
|
||||
};
|
||||
|
||||
export const vegaGetPostsSearch = async ({
|
||||
export const getSearchPosts = async ({
|
||||
searchQuery,
|
||||
page,
|
||||
providerValue,
|
||||
@@ -56,12 +56,12 @@ export const vegaGetPostsSearch = async ({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Post[]> => {
|
||||
const {getBaseUrl, axios, commonHeaders, cheerio} = providerContext;
|
||||
const baseUrl = await getBaseUrl('Vega');
|
||||
const { getBaseUrl, axios, commonHeaders, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("Vega");
|
||||
|
||||
console.log('vegaGetPosts baseUrl:', providerValue, baseUrl);
|
||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
console.log('vegaGetPosts url:', url);
|
||||
console.log("vegaGetPosts url:", url);
|
||||
|
||||
return posts(baseUrl, url, signal, commonHeaders, axios, cheerio);
|
||||
};
|
||||
@@ -71,8 +71,8 @@ async function posts(
|
||||
url: string,
|
||||
signal: AbortSignal,
|
||||
headers: Record<string, string> = {},
|
||||
axios: ProviderContext['axios'],
|
||||
cheerio: ProviderContext['cheerio'],
|
||||
axios: ProviderContext["axios"],
|
||||
cheerio: ProviderContext["cheerio"]
|
||||
): Promise<Post[]> {
|
||||
try {
|
||||
const urlRes = await axios.get(url, {
|
||||
@@ -84,30 +84,30 @@ async function posts(
|
||||
});
|
||||
const $ = cheerio.load(urlRes.data);
|
||||
const posts: Post[] = [];
|
||||
$('.blog-items,.post-list')
|
||||
?.children('article')
|
||||
$(".blog-items,.post-list")
|
||||
?.children("article")
|
||||
?.each((index, element) => {
|
||||
const post = {
|
||||
title: (
|
||||
$(element)
|
||||
?.find('a')
|
||||
?.attr('title')
|
||||
?.replace('Download', '')
|
||||
?.find("a")
|
||||
?.attr("title")
|
||||
?.replace("Download", "")
|
||||
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
|
||||
$(element)?.find('a')?.attr('title')?.replace('Download', '') ||
|
||||
$(element)?.find('.post-title').text()?.replace('Download', '') ||
|
||||
''
|
||||
$(element)?.find("a")?.attr("title")?.replace("Download", "") ||
|
||||
$(element)?.find(".post-title").text()?.replace("Download", "") ||
|
||||
""
|
||||
).trim(),
|
||||
|
||||
link: $(element)?.find('a')?.attr('href') || '',
|
||||
link: $(element)?.find("a")?.attr("href") || "",
|
||||
image:
|
||||
$(element).find('a').find('img').attr('data-lazy-src') ||
|
||||
$(element).find('a').find('img').attr('data-src') ||
|
||||
$(element).find('a').find('img').attr('src') ||
|
||||
'',
|
||||
$(element).find("a").find("img").attr("data-lazy-src") ||
|
||||
$(element).find("a").find("img").attr("data-src") ||
|
||||
$(element).find("a").find("img").attr("src") ||
|
||||
"",
|
||||
};
|
||||
if (post.image.startsWith('//')) {
|
||||
post.image = 'https:' + post.image;
|
||||
if (post.image.startsWith("//")) {
|
||||
post.image = "https:" + post.image;
|
||||
}
|
||||
posts.push(post);
|
||||
});
|
||||
@@ -115,7 +115,7 @@ async function posts(
|
||||
// console.log(posts);
|
||||
return posts;
|
||||
} catch (error) {
|
||||
console.error('vegaGetPosts error:', error);
|
||||
console.error("vegaGetPosts error:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
import {ProviderContext, Stream} from '../types';
|
||||
import { ProviderContext, Stream } from "../types";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Cache-Control': 'no-store',
|
||||
'Accept-Language': 'en-US,en;q=0.9',
|
||||
DNT: '1',
|
||||
'sec-ch-ua':
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
||||
"Cache-Control": "no-store",
|
||||
"Accept-Language": "en-US,en;q=0.9",
|
||||
DNT: "1",
|
||||
"sec-ch-ua":
|
||||
'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'document',
|
||||
'Sec-Fetch-Mode': 'navigate',
|
||||
'Sec-Fetch-Site': 'none',
|
||||
'Sec-Fetch-User': '?1',
|
||||
"sec-ch-ua-mobile": "?0",
|
||||
"sec-ch-ua-platform": '"Windows"',
|
||||
"Sec-Fetch-Dest": "document",
|
||||
"Sec-Fetch-Mode": "navigate",
|
||||
"Sec-Fetch-Site": "none",
|
||||
"Sec-Fetch-User": "?1",
|
||||
Cookie:
|
||||
'_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
|
||||
"_lscache_vary=62abf8b96599676eb8ec211cffaeb8ff; ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=n4Y1XTKZ5TfIMBNQuAXzerwKpx0U35KoOm3imfT0GpU-1732097818-1.2.1.1-ZeAnEu.8D9TSZHYDoj7vwo1A1rpdKl304ZpaBn_QbAQOr211JFAb7.JRQU3EL2eIy1Dfl8HhYvH7_259.22lUz8gbchHcQ8hvfuQXMtFMCbqDBLzjNUZa9stuk.39l28IcPhH9Z2szsf3SGtNI1sAfo66Djt7sOReLK3lHw9UkJp7BdGqt6a2X9qAc8EsAI3lE480Tmt0fkHv14Oc30LSbPB_WwFmiqAki2W.Gv9hV7TN_QBFESleTDlXd.6KGflfd4.KwWF7rpSRo_cgoc9ALLLIafpxHVbe7_g5r7zvpml_Pj8fEL75fw.1GBuy16bciHBuB8s_kahuJYUnhtQFFgfTQl8_Gn6KeovBWx.PJ7nFv5sklHUfAyBVq3t30xKe8ZDydsQ_G.yipfj_In5GmmWcXGb6E4.bioDOwW_sKLtxwdTQt7Nu.RkILX_mKvXNpyLqflIVj8G7X5E8I.unw",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
|
||||
};
|
||||
|
||||
export async function vegaGetStream({
|
||||
export async function getStream({
|
||||
link,
|
||||
type,
|
||||
signal,
|
||||
@@ -32,14 +32,14 @@ export async function vegaGetStream({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}) {
|
||||
const {axios, cheerio, extractors} = providerContext;
|
||||
const {hubcloudExtracter} = extractors;
|
||||
const { axios, cheerio, extractors } = providerContext;
|
||||
const { hubcloudExtracter } = extractors;
|
||||
try {
|
||||
const streamLinks: Stream[] = [];
|
||||
console.log('dotlink', link);
|
||||
if (type === 'movie') {
|
||||
console.log("dotlink", link);
|
||||
if (type === "movie") {
|
||||
// vlink
|
||||
const dotlinkRes = await axios(`${link}`, {headers});
|
||||
const dotlinkRes = await axios(`${link}`, { headers });
|
||||
const dotlinkText = dotlinkRes.data;
|
||||
// console.log('dotlinkText', dotlinkText);
|
||||
const vlink = dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i) || [];
|
||||
@@ -50,66 +50,66 @@ export async function vegaGetStream({
|
||||
try {
|
||||
const $ = cheerio.load(dotlinkText);
|
||||
const filepressLink = $(
|
||||
'.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]',
|
||||
'.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]'
|
||||
)
|
||||
.parent()
|
||||
.attr('href');
|
||||
.attr("href");
|
||||
// console.log('filepressLink', filepressLink);
|
||||
const filepressID = filepressLink?.split('/').pop();
|
||||
const filepressID = filepressLink?.split("/").pop();
|
||||
const filepressBaseUrl = filepressLink
|
||||
?.split('/')
|
||||
?.split("/")
|
||||
.slice(0, -2)
|
||||
.join('/');
|
||||
.join("/");
|
||||
// console.log('filepressID', filepressID);
|
||||
// console.log('filepressBaseUrl', filepressBaseUrl);
|
||||
const filepressTokenRes = await axios.post(
|
||||
filepressBaseUrl + '/api/file/downlaod/',
|
||||
filepressBaseUrl + "/api/file/downlaod/",
|
||||
{
|
||||
id: filepressID,
|
||||
method: 'indexDownlaod',
|
||||
method: "indexDownlaod",
|
||||
captchaValue: null,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json",
|
||||
Referer: filepressBaseUrl,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
// console.log('filepressTokenRes', filepressTokenRes.data);
|
||||
if (filepressTokenRes.data?.status) {
|
||||
const filepressToken = filepressTokenRes.data?.data;
|
||||
const filepressStreamLink = await axios.post(
|
||||
filepressBaseUrl + '/api/file/downlaod2/',
|
||||
filepressBaseUrl + "/api/file/downlaod2/",
|
||||
{
|
||||
id: filepressToken,
|
||||
method: 'indexDownlaod',
|
||||
method: "indexDownlaod",
|
||||
captchaValue: null,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json",
|
||||
Referer: filepressBaseUrl,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
// console.log('filepressStreamLink', filepressStreamLink.data);
|
||||
streamLinks.push({
|
||||
server: 'filepress',
|
||||
server: "filepress",
|
||||
link: filepressStreamLink.data?.data?.[0],
|
||||
type: 'mkv',
|
||||
type: "mkv",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('filepress error: ');
|
||||
console.log("filepress error: ");
|
||||
// console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
return await hubcloudExtracter(link, signal);
|
||||
} catch (error: any) {
|
||||
console.log('getStream error: ', error);
|
||||
if (error.message.includes('Aborted')) {
|
||||
console.log("getStream error: ", error);
|
||||
if (error.message.includes("Aborted")) {
|
||||
} else {
|
||||
}
|
||||
return [];
|
||||
Reference in New Issue
Block a user