fix: update extractors to match actual anikototv.to structure

- Analyzed actual HTML structure of anikototv.to
- Updated all extractors with correct CSS selectors
- Changed ID-based to slug-based lookups
- Updated URL patterns to match actual website
- Fixed stream info to use AJAX server list
- Improved error handling
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 15:18:27 +05:30
parent 3815521b0d
commit 1906ba4a34
20 changed files with 344 additions and 308 deletions
+6 -4
View File
@@ -1,20 +1,21 @@
import * as cheerio from "cheerio";
import axios from "axios";
import { headers } from "../configs/header.config.js";
import { BASE_URL } from "../configs/dataUrl.js";
import { URLS } from "../configs/dataUrl.js";
const extractRandom = async () => {
try {
const { data } = await axios.get(`${BASE_URL}/random`, {
const { data } = await axios.get(URLS.random, {
headers,
maxRedirects: 5
});
const $ = cheerio.load(data);
const slug = window.location.pathname.split("/watch/").pop() || "";
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 type = $(".film-info .row .col1 .item:first-child .name").text().trim() || "";
const animeInfo = {};
$(".anisc-info .item").each((i, el) => {
@@ -26,10 +27,11 @@ const extractRandom = async () => {
});
return {
slug,
title,
japaneseTitle,
poster,
showType,
type,
animeInfo
};
} catch (error) {