mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
build
This commit is contained in:
18
dist/vadapav/catalog.js
vendored
Normal file
18
dist/vadapav/catalog.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalog = void 0;
|
||||
exports.catalog = [
|
||||
{
|
||||
title: "Movies",
|
||||
filter: "/608c853f-704e-48f0-b785-4ae1f48ea70d",
|
||||
},
|
||||
{
|
||||
title: "Tv Shows",
|
||||
filter: "/72983eef-a12f-4be4-99a7-e8f6afa568c1",
|
||||
},
|
||||
{
|
||||
title: "Anime",
|
||||
filter: "/36abf81c-1032-4fbf-9a55-347a05ce2ca3",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
30
dist/vadapav/episodes.js
vendored
Normal file
30
dist/vadapav/episodes.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEpisodes = void 0;
|
||||
const getEpisodes = async function ({ url, providerContext, }) {
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const baseUrl = url?.split("/").slice(0, 3).join("/");
|
||||
const res = await axios.get(url);
|
||||
const html = res.data;
|
||||
let $ = cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
$('.file-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
const link = $(element).attr("href");
|
||||
if (link &&
|
||||
($(element).text()?.includes(".mp4") ||
|
||||
$(element).text()?.includes(".mkv"))) {
|
||||
episodeLinks.push({
|
||||
title: $(element).text()?.match(/E\d+/)?.[0]?.replace("E", "Episode ") ||
|
||||
i + 1 + ". " + $(element).text()?.replace(".mkv", ""),
|
||||
link: baseUrl + link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
68
dist/vadapav/meta.js
vendored
Normal file
68
dist/vadapav/meta.js
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const baseUrl = link?.split("/").slice(0, 3).join("/");
|
||||
const url = link;
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const title = $(".directory")
|
||||
.children()
|
||||
.first()
|
||||
.text()
|
||||
.trim()
|
||||
?.split("/")
|
||||
.pop()
|
||||
?.trim() || "";
|
||||
const links = [];
|
||||
$('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
const link = $(element).attr("href");
|
||||
if (link) {
|
||||
links.push({
|
||||
episodesLink: baseUrl + link,
|
||||
title: $(element).text(),
|
||||
});
|
||||
}
|
||||
});
|
||||
const directLinks = [];
|
||||
$('.file-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
const link = $(element).attr("href");
|
||||
if (link &&
|
||||
($(element).text()?.includes(".mp4") ||
|
||||
$(element).text()?.includes(".mkv"))) {
|
||||
directLinks.push({
|
||||
title: i + 1 + ". " + $(element).text(),
|
||||
link: baseUrl + link,
|
||||
});
|
||||
}
|
||||
});
|
||||
if (directLinks.length > 0) {
|
||||
links.push({
|
||||
title: title + " DL",
|
||||
directLinks: directLinks,
|
||||
});
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
56
dist/vadapav/posts.js
vendored
Normal file
56
dist/vadapav/posts.js
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("vadapav");
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const url = `${baseUrl + filter}`;
|
||||
return posts({ baseUrl, url, signal, axios, cheerio });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = await getBaseUrl("vadapav");
|
||||
if (page > 1) {
|
||||
return [];
|
||||
}
|
||||
const url = `${baseUrl}/s/${searchQuery}`;
|
||||
return posts({ baseUrl, url, signal, axios, cheerio });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({
|
||||
// baseUrl,
|
||||
url, signal, axios, cheerio, }) {
|
||||
try {
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
const title = $(element).text();
|
||||
const link = $(element).attr("href");
|
||||
const imageTitle = title?.length > 30
|
||||
? title?.slice(0, 30)?.replace(/\./g, " ")
|
||||
: title?.replace(/\./g, " ");
|
||||
const image = `https://placehold.jp/23/000000/ffffff/200x400.png?text=${encodeURIComponent(imageTitle)}&css=%7B%22background%22%3A%22%20-webkit-gradient(linear%2C%20left%20bottom%2C%20left%20top%2C%20from(%233f3b3b)%2C%20to(%23000000))%22%2C%22text-transform%22%3A%22%20capitalize%22%7D`;
|
||||
if (title && link) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
19
dist/vadapav/stream.js
vendored
Normal file
19
dist/vadapav/stream.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const getStream = async function ({ link: url, // type, // providerContext,
|
||||
}) {
|
||||
try {
|
||||
const stream = [];
|
||||
stream.push({
|
||||
server: "vadapav",
|
||||
link: url,
|
||||
type: url?.split(".").pop() || "mkv",
|
||||
});
|
||||
return stream;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
Reference in New Issue
Block a user