This commit is contained in:
himanshu8443
2025-06-17 21:32:50 +05:30
parent 1b23125dfd
commit a2afb200ad
264 changed files with 0 additions and 16201 deletions

View File

@@ -1,14 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.genres = exports.catalog = void 0;
exports.catalog = [
{
title: "Top Anime",
filter: "anime/search?r=5",
},
{
title: "Popular Anime",
filter: "anime/",
},
];
exports.genres = [];

View File

@@ -1,16 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tokyoInsider = void 0;
const catalog_1 = require("./catalog");
const tokyoGetInfo_1 = require("./tokyoGetInfo");
const tokyoGetPosts_1 = require("./tokyoGetPosts");
const tokyoGetStream_1 = require("./tokyoGetStream");
exports.tokyoInsider = {
catalog: catalog_1.tokyoCatalogList,
genres: catalog_1.tokyoGenresList,
GetMetaData: tokyoGetInfo_1.tokyoGetInfo,
GetHomePosts: tokyoGetPosts_1.tokyoGetPosts,
GetStream: tokyoGetStream_1.tokyoGetStream,
GetSearchPosts: tokyoGetPosts_1.tokyoGetPostsSearch,
blurImage: true,
};

View File

@@ -1,60 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMeta = void 0;
const getMeta = async function ({ link, providerContext, }) {
try {
const { cheerio } = providerContext;
const url = link;
const res = await fetch(url);
const data = await res.text();
const $ = cheerio.load(data);
const meta = {
title: $('.c_h2:contains("Title(s):")')
.text()
.replace("Title(s):", "")
.trim()
.split("\n")[0],
synopsis: $('.c_h2b:contains("Summary:"),.c_h2:contains("Summary:")')
.text()
.replace("Summary:", "")
.trim(),
image: $(".a_img").attr("src") || "",
imdbId: "",
type: "series",
};
const episodesList = [];
$(".episode").map((i, element) => {
const link = "https://www.tokyoinsider.com" + $(element).find("a").attr("href") ||
$(".download-link").attr("href");
let title = $(element).find("a").find("em").text() +
" " +
$(element).find("a").find("strong").text();
if (!title.trim()) {
title = $(".download-link").text();
}
if (link && title.trim()) {
episodesList.push({ title, link });
}
});
return {
...meta,
linkList: [
{
title: meta.title,
directLinks: episodesList,
},
],
};
}
catch (err) {
return {
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "series",
linkList: [],
};
}
};
exports.getMeta = getMeta;

View File

@@ -1,50 +0,0 @@
"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("tokyoinsider");
const start = page < 2 ? 0 : (page - 1) * 20;
const url = `${baseURL}/${filter}&start=${start}`;
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("tokyoinsider");
const start = page < 2 ? 0 : (page - 1) * 20;
const url = `${baseURL}/anime/search?k=${searchQuery}&start=${start}`;
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 = [];
$('td.c_h2[width="40"]').map((i, element) => {
const image = $(element)
.find(".a_img")
.attr("src")
?.replace("small", "default");
const title = $(element).find("a").attr("title");
const link = baseURL + $(element).find("a").attr("href");
if (title && link && image) {
catalog.push({
title: title,
link: link,
image: image,
});
}
});
return catalog;
}
catch (err) {
return [];
}
}

View File

@@ -1,30 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStream = void 0;
const getStream = async function ({ link, providerContext, }) {
try {
const { cheerio } = providerContext;
const url = link;
const res = await fetch(url);
const data = await res.text();
const $ = cheerio.load(data);
const streamLinks = [];
$(".c_h1,.c_h2").map((i, element) => {
$(element).find("span").remove();
const title = $(element).find("a").text() || "";
const link = $(element).find("a").attr("href") || "";
if (title && link.includes("media")) {
streamLinks.push({
server: title,
link,
type: link.split(".").pop() || "mkv",
});
}
});
return streamLinks;
}
catch (err) {
return [];
}
};
exports.getStream = getStream;

View File

@@ -1,60 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tokyoGetInfo = void 0;
const tokyoGetInfo = async function ({ link, providerContext, }) {
try {
const { cheerio } = providerContext;
const url = link;
const res = await fetch(url);
const data = await res.text();
const $ = cheerio.load(data);
const meta = {
title: $('.c_h2:contains("Title(s):")')
.text()
.replace('Title(s):', '')
.trim()
.split('\n')[0],
synopsis: $('.c_h2b:contains("Summary:"),.c_h2:contains("Summary:")')
.text()
.replace('Summary:', '')
.trim(),
image: $('.a_img').attr('src') || '',
imdbId: '',
type: 'series',
};
const episodesList = [];
$('.episode').map((i, element) => {
const link = 'https://www.tokyoinsider.com' + $(element).find('a').attr('href') ||
$('.download-link').attr('href');
let title = $(element).find('a').find('em').text() +
' ' +
$(element).find('a').find('strong').text();
if (!title.trim()) {
title = $('.download-link').text();
}
if (link && title.trim()) {
episodesList.push({ title, link });
}
});
return {
...meta,
linkList: [
{
title: meta.title,
directLinks: episodesList,
},
],
};
}
catch (err) {
return {
title: '',
synopsis: '',
image: '',
imdbId: '',
type: 'series',
linkList: [],
};
}
};
exports.tokyoGetInfo = tokyoGetInfo;

View File

@@ -1,50 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tokyoGetPostsSearch = exports.tokyoGetPosts = void 0;
const tokyoGetPosts = async function ({ filter, page,
// providerValue,
signal, providerContext, }) {
const { getBaseUrl, axios, cheerio } = providerContext;
const baseURL = await getBaseUrl('tokyoinsider');
const start = page < 2 ? 0 : (page - 1) * 20;
const url = `${baseURL}/${filter}&start=${start}`;
return posts({ baseURL, url, signal, axios, cheerio });
};
exports.tokyoGetPosts = tokyoGetPosts;
const tokyoGetPostsSearch = async function ({ searchQuery, page,
// providerValue,
signal, providerContext, }) {
const { getBaseUrl, axios, cheerio } = providerContext;
const baseURL = await getBaseUrl('tokyoinsider');
const start = page < 2 ? 0 : (page - 1) * 20;
const url = `${baseURL}/anime/search?k=${searchQuery}&start=${start}`;
return posts({ baseURL, url, signal, axios, cheerio });
};
exports.tokyoGetPostsSearch = tokyoGetPostsSearch;
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 = [];
$('td.c_h2[width="40"]').map((i, element) => {
const image = $(element)
.find('.a_img')
.attr('src')
?.replace('small', 'default');
const title = $(element).find('a').attr('title');
const link = baseURL + $(element).find('a').attr('href');
if (title && link && image) {
catalog.push({
title: title,
link: link,
image: image,
});
}
});
return catalog;
}
catch (err) {
return [];
}
}

View File

@@ -1,30 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tokyoGetStream = void 0;
const tokyoGetStream = async function ({ link, providerContext, }) {
try {
const { cheerio } = providerContext;
const url = link;
const res = await fetch(url);
const data = await res.text();
const $ = cheerio.load(data);
const streamLinks = [];
$('.c_h1,.c_h2').map((i, element) => {
$(element).find('span').remove();
const title = $(element).find('a').text() || '';
const link = $(element).find('a').attr('href') || '';
if (title && link.includes('media')) {
streamLinks.push({
server: title,
link,
type: link.split('.').pop() || 'mkv',
});
}
});
return streamLinks;
}
catch (err) {
return [];
}
};
exports.tokyoGetStream = tokyoGetStream;