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:
22
dist/hiAnime/catalog.js
vendored
Normal file
22
dist/hiAnime/catalog.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.genres = exports.catalogs = void 0;
|
||||
exports.catalogs = [
|
||||
{
|
||||
title: "Recent",
|
||||
filter: "/anime/zoro/recent-episodes",
|
||||
},
|
||||
{
|
||||
title: "Top Airing",
|
||||
filter: "/anime/zoro/top-airing",
|
||||
},
|
||||
{
|
||||
title: "Most Popular",
|
||||
filter: "/anime/zoro/most-popular",
|
||||
},
|
||||
{
|
||||
title: "Most Favorited",
|
||||
filter: "/anime/zoro/most-favorite",
|
||||
},
|
||||
];
|
||||
exports.genres = [];
|
||||
78
dist/hiAnime/meta.js
vendored
Normal file
78
dist/hiAnime/meta.js
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getMeta = void 0;
|
||||
const getMeta = async function ({ link, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl}/anime/zoro/info?id=` + link;
|
||||
const res = await axios.get(url);
|
||||
const data = res.data;
|
||||
const meta = {
|
||||
title: data.title,
|
||||
synopsis: data.description,
|
||||
image: data.image,
|
||||
tags: [
|
||||
data?.type,
|
||||
data?.subOrDub === "both" ? "Sub And Dub" : data?.subOrDub,
|
||||
],
|
||||
imdbId: "",
|
||||
type: data.episodes.length > 0 ? "series" : "movie",
|
||||
};
|
||||
const linkList = [];
|
||||
const subLinks = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
if (!episode?.isSubbed) {
|
||||
return;
|
||||
}
|
||||
const title = "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
|
||||
const link = episode.id + "$sub";
|
||||
if (link && title) {
|
||||
subLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title + " (Sub)",
|
||||
directLinks: subLinks,
|
||||
});
|
||||
if (data?.subOrDub === "both") {
|
||||
const dubLinks = [];
|
||||
data.episodes.forEach((episode) => {
|
||||
if (!episode?.isDubbed) {
|
||||
return;
|
||||
}
|
||||
const title = "Episode " + episode.number + (episode?.isFiller ? " (Filler)" : "");
|
||||
const link = episode.id + "$dub";
|
||||
if (link && title) {
|
||||
dubLinks.push({
|
||||
title,
|
||||
link,
|
||||
});
|
||||
}
|
||||
});
|
||||
linkList.push({
|
||||
title: meta.title + " (Dub)",
|
||||
directLinks: dubLinks,
|
||||
});
|
||||
}
|
||||
return {
|
||||
...meta,
|
||||
linkList: linkList,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
title: "",
|
||||
synopsis: "",
|
||||
image: "",
|
||||
imdbId: "",
|
||||
type: "movie",
|
||||
linkList: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.getMeta = getMeta;
|
||||
41
dist/hiAnime/posts.js
vendored
Normal file
41
dist/hiAnime/posts.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSearchPosts = exports.getPosts = void 0;
|
||||
const getPosts = async function ({ filter, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl + filter}?page=${page}`;
|
||||
return posts({ url, signal, axios });
|
||||
};
|
||||
exports.getPosts = getPosts;
|
||||
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const url = `${baseUrl}/anime/zoro/${searchQuery}?page=${page}`;
|
||||
return posts({ url, signal, axios });
|
||||
};
|
||||
exports.getSearchPosts = getSearchPosts;
|
||||
async function posts({ url, signal, axios, }) {
|
||||
try {
|
||||
const res = await axios.get(url, { signal });
|
||||
const data = res.data?.results;
|
||||
const catalog = [];
|
||||
data?.map((element) => {
|
||||
const title = element.title;
|
||||
const link = element.id;
|
||||
const image = element.image;
|
||||
if (title && link && image) {
|
||||
catalog.push({
|
||||
title: title,
|
||||
link: link,
|
||||
image: image,
|
||||
});
|
||||
}
|
||||
});
|
||||
return catalog;
|
||||
}
|
||||
catch (err) {
|
||||
console.error("zoro error ", err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
54
dist/hiAnime/stream.js
vendored
Normal file
54
dist/hiAnime/stream.js
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const getStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { getBaseUrl, axios } = providerContext;
|
||||
const baseUrl = await getBaseUrl("consumet");
|
||||
const servers = ["vidcloud", "vidstreaming"];
|
||||
const url = `${baseUrl}/anime/zoro/watch?episodeId=${id}&server=`;
|
||||
const streamLinks = [];
|
||||
await Promise.all(servers.map(async (server) => {
|
||||
try {
|
||||
const res = await axios.get(url + server);
|
||||
if (res.data) {
|
||||
const subtitles = [];
|
||||
res.data?.subtitles.forEach((sub) => {
|
||||
if (sub?.lang === "Thumbnails")
|
||||
return;
|
||||
subtitles.push({
|
||||
language: sub?.lang?.slice(0, 2) || "Und",
|
||||
uri: sub?.url,
|
||||
title: sub?.lang || "Undefined",
|
||||
type: sub?.url?.endsWith(".vtt")
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
});
|
||||
});
|
||||
res.data?.sources.forEach((source) => {
|
||||
streamLinks.push({
|
||||
server: server,
|
||||
link: source?.url,
|
||||
type: source?.isM3U8 ? "m3u8" : "mp4",
|
||||
headers: {
|
||||
Referer: "https://megacloud.club/",
|
||||
Origin: "https://megacloud.club",
|
||||
},
|
||||
subtitles: subtitles,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}));
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
Reference in New Issue
Block a user