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:
62
dist/vadapav/episodes.js
vendored
62
dist/vadapav/episodes.js
vendored
@@ -1,30 +1,42 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
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 [];
|
||||
}
|
||||
const getEpisodes = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) {
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const baseUrl = url === null || url === void 0 ? void 0 : url.split("/").slice(0, 3).join("/");
|
||||
const res = yield axios.get(url);
|
||||
const html = res.data;
|
||||
let $ = cheerio.load(html);
|
||||
const episodeLinks = [];
|
||||
$('.file-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const link = $(element).attr("href");
|
||||
if (link &&
|
||||
(((_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.includes(".mp4")) ||
|
||||
((_b = $(element).text()) === null || _b === void 0 ? void 0 : _b.includes(".mkv")))) {
|
||||
episodeLinks.push({
|
||||
title: ((_e = (_d = (_c = $(element).text()) === null || _c === void 0 ? void 0 : _c.match(/E\d+/)) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.replace("E", "Episode ")) ||
|
||||
i + 1 + ". " + ((_f = $(element).text()) === null || _f === void 0 ? void 0 : _f.replace(".mkv", "")),
|
||||
link: baseUrl + link,
|
||||
});
|
||||
}
|
||||
});
|
||||
return episodeLinks;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getEpisodes = getEpisodes;
|
||||
|
||||
132
dist/vadapav/meta.js
vendored
132
dist/vadapav/meta.js
vendored
@@ -1,68 +1,78 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
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,
|
||||
const getMeta = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
|
||||
var _b, _c;
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const baseUrl = link === null || link === void 0 ? void 0 : link.split("/").slice(0, 3).join("/");
|
||||
const url = link;
|
||||
const res = yield axios.get(url);
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const title = ((_c = (_b = $(".directory")
|
||||
.children()
|
||||
.first()
|
||||
.text()
|
||||
.trim()) === null || _b === void 0 ? void 0 : _b.split("/").pop()) === null || _c === void 0 ? void 0 : _c.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) => {
|
||||
var _a, _b;
|
||||
const link = $(element).attr("href");
|
||||
if (link &&
|
||||
(((_a = $(element).text()) === null || _a === void 0 ? void 0 : _a.includes(".mp4")) ||
|
||||
((_b = $(element).text()) === null || _b === void 0 ? void 0 : _b.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,
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: title,
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: links,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
|
||||
112
dist/vadapav/posts.js
vendored
112
dist/vadapav/posts.js
vendored
@@ -1,56 +1,72 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
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 });
|
||||
const getPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ filter, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield 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 });
|
||||
const getSearchPosts = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page,
|
||||
// providerValue,
|
||||
signal, providerContext, }) {
|
||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||
const baseUrl = yield 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 [];
|
||||
}
|
||||
function posts(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({
|
||||
// baseUrl,
|
||||
url, signal, axios, cheerio, }) {
|
||||
try {
|
||||
const res = yield axios.get(url, { signal });
|
||||
const data = res.data;
|
||||
const $ = cheerio.load(data);
|
||||
const catalog = [];
|
||||
$('.directory-entry:not(:contains("Parent Directory"))').map((i, element) => {
|
||||
var _a;
|
||||
const title = $(element).text();
|
||||
const link = $(element).attr("href");
|
||||
const imageTitle = (title === null || title === void 0 ? void 0 : title.length) > 30
|
||||
? (_a = title === null || title === void 0 ? void 0 : title.slice(0, 30)) === null || _a === void 0 ? void 0 : _a.replace(/\./g, " ")
|
||||
: title === null || title === void 0 ? void 0 : 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 [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
39
dist/vadapav/stream.js
vendored
39
dist/vadapav/stream.js
vendored
@@ -1,19 +1,30 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
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 [];
|
||||
}
|
||||
const getStream = function (_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ link: url, // type, // providerContext,
|
||||
}) {
|
||||
try {
|
||||
const stream = [];
|
||||
stream.push({
|
||||
server: "vadapav",
|
||||
link: url,
|
||||
type: (url === null || url === void 0 ? void 0 : url.split(".").pop()) || "mkv",
|
||||
});
|
||||
return stream;
|
||||
}
|
||||
catch (err) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
|
||||
Reference in New Issue
Block a user