feat: initial project setup for AniKatoAPI

- Express.js server with Vercel deployment support
- Complete API endpoints for anikototv.to anime data
- Home, search, info, episodes, stream, schedule endpoints
- Category filtering and genre support
- Caching system with 5-minute TTL
- CORS configuration
- Public documentation page
- Docker and Render deployment configs
- MIT License
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 15:08:22 +05:30
commit 3815521b0d
47 changed files with 1846 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
import * as cheerio from "cheerio";
import axios from "axios";
import { headers } from "../configs/header.config.js";
import { BASE_URL } from "../configs/dataUrl.js";
const extractRandom = async () => {
try {
const { data } = await axios.get(`${BASE_URL}/random`, {
headers,
maxRedirects: 5
});
const $ = cheerio.load(data);
const title = $(".film-name h1, .anisc-detail .film-name").text().trim() || "";
const japaneseTitle = $(".film-name .alternate-title, .anisc-detail .film-name small").text().trim() || "";
const poster = $(".film-poster img").attr("src") || "";
const showType = $(".film-info .row .col1 .item:first-child .name").text().trim() || "";
const animeInfo = {};
$(".anisc-info .item").each((i, el) => {
const label = $(el).find(".name").text().trim().replace(":", "");
const value = $(el).find(".text").text().trim();
if (label && value) {
animeInfo[label] = value;
}
});
return {
title,
japaneseTitle,
poster,
showType,
animeInfo
};
} catch (error) {
throw error;
}
};
export { extractRandom };