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:
104
dist/guardahd/GetGuardahdStream.js
vendored
Normal file
104
dist/guardahd/GetGuardahdStream.js
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GuardahdGetStream = void 0;
|
||||
const GuardahdGetStream = async function ({ link: id, type, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio, extractors } = providerContext;
|
||||
const { superVideoExtractor } = extractors;
|
||||
async function ExtractGuardahd({ imdb, // type,
|
||||
// episode,
|
||||
} // season,
|
||||
) {
|
||||
try {
|
||||
const baseUrl = 'https://guardahd.stream';
|
||||
const path = '/set-movie-a/' + imdb;
|
||||
const url = baseUrl + path;
|
||||
console.log('url:', url);
|
||||
const res = await axios.get(url, { timeout: 4000 });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const superVideoUrl = $('li:contains("supervideo")').attr('data-link');
|
||||
console.log('superVideoUrl:', superVideoUrl);
|
||||
if (!superVideoUrl) {
|
||||
return null;
|
||||
}
|
||||
const controller2 = new AbortController();
|
||||
const signal2 = controller2.signal;
|
||||
setTimeout(() => controller2.abort(), 4000);
|
||||
const res2 = await fetch('https:' + superVideoUrl, { signal: signal2 });
|
||||
const data = await res2.text();
|
||||
// console.log('mostraguarda data:', data);
|
||||
const streamUrl = await superVideoExtractor(data);
|
||||
return streamUrl;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Error in GetMostraguardaStram:', err);
|
||||
}
|
||||
}
|
||||
async function GetMostraguardaStream({ imdb, type, season, episode, }) {
|
||||
try {
|
||||
const baseUrl = 'https://mostraguarda.stream';
|
||||
const path = type === 'tv'
|
||||
? `/serie/${imdb}/${season}/${episode}`
|
||||
: `/movie/${imdb}`;
|
||||
const url = baseUrl + path;
|
||||
console.log('url:', url);
|
||||
const res = await axios(url, { timeout: 4000 });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const superVideoUrl = $('li:contains("supervideo")').attr('data-link');
|
||||
console.log('superVideoUrl:', superVideoUrl);
|
||||
if (!superVideoUrl) {
|
||||
return null;
|
||||
}
|
||||
const controller2 = new AbortController();
|
||||
const signal2 = controller2.signal;
|
||||
setTimeout(() => controller2.abort(), 4000);
|
||||
const res2 = await fetch('https:' + superVideoUrl, { signal: signal2 });
|
||||
const data = await res2.text();
|
||||
// console.log('mostraguarda data:', data);
|
||||
const streamUrl = await superVideoExtractor(data);
|
||||
return streamUrl;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Error in GetMostraguardaStram:', err);
|
||||
}
|
||||
}
|
||||
console.log(id);
|
||||
const streams = [];
|
||||
const { imdbId, season, episode } = JSON.parse(id);
|
||||
///// mostraguarda
|
||||
const mostraguardaStream = await GetMostraguardaStream({
|
||||
imdb: imdbId,
|
||||
type: type,
|
||||
season: season,
|
||||
episode: episode,
|
||||
});
|
||||
if (mostraguardaStream) {
|
||||
streams.push({
|
||||
server: 'Supervideo 1',
|
||||
link: mostraguardaStream,
|
||||
type: 'm3u8',
|
||||
});
|
||||
}
|
||||
const guardahdStream = await ExtractGuardahd({
|
||||
imdb: imdbId,
|
||||
type: type,
|
||||
season: season,
|
||||
episode: episode,
|
||||
});
|
||||
if (guardahdStream) {
|
||||
streams.push({
|
||||
server: 'Supervideo 2',
|
||||
link: guardahdStream,
|
||||
type: 'm3u8',
|
||||
});
|
||||
}
|
||||
return streams;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.GuardahdGetStream = GuardahdGetStream;
|
||||
14
dist/guardahd/guardahdCatalog.js
vendored
Normal file
14
dist/guardahd/guardahdCatalog.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guardahdGenresList = exports.guardahdCatalog = void 0;
|
||||
exports.guardahdCatalog = [
|
||||
{
|
||||
title: 'Popular Movies',
|
||||
filter: '/top/catalog/movie/top.json',
|
||||
},
|
||||
{
|
||||
title: 'Featured Movies',
|
||||
filter: '/imdbRating/catalog/movie/imdbRating.json',
|
||||
},
|
||||
];
|
||||
exports.guardahdGenresList = [];
|
||||
34
dist/guardahd/guardahdGetPosts.js
vendored
Normal file
34
dist/guardahd/guardahdGetPosts.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guardahdGetSearchPosts = void 0;
|
||||
const guardahdGetSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
try {
|
||||
const { axios, commonHeaders: headers } = providerContext;
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const catalog = [];
|
||||
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`;
|
||||
const res2 = await axios.get(url2, { headers, signal });
|
||||
const data2 = res2.data;
|
||||
data2?.metas.map((result) => {
|
||||
const title = result?.name || '';
|
||||
const id = result?.imdb_id || result?.id;
|
||||
const image = result?.poster;
|
||||
const type = result?.type;
|
||||
if (id) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error('AutoEmbed error ', err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.guardahdGetSearchPosts = guardahdGetSearchPosts;
|
||||
16
dist/guardahd/index.js
vendored
Normal file
16
dist/guardahd/index.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.guardahd = void 0;
|
||||
const guardahdCatalog_1 = require("./guardahdCatalog");
|
||||
const allGetInfo_1 = require("../autoEmbed/allGetInfo");
|
||||
const allGetPost_1 = require("../autoEmbed/allGetPost");
|
||||
const guardahdGetPosts_1 = require("./guardahdGetPosts");
|
||||
const GetGuardahdStream_1 = require("./GetGuardahdStream");
|
||||
exports.guardahd = {
|
||||
catalog: guardahdCatalog_1.guardahdCatalog,
|
||||
genres: guardahdCatalog_1.guardahdGenresList,
|
||||
GetMetaData: allGetInfo_1.allGetInfo,
|
||||
GetHomePosts: allGetPost_1.allGetPost,
|
||||
GetStream: GetGuardahdStream_1.GuardahdGetStream,
|
||||
GetSearchPosts: guardahdGetPosts_1.guardahdGetSearchPosts,
|
||||
};
|
||||
Reference in New Issue
Block a user