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
+4 -6
View File
@@ -1,20 +1,19 @@
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 extractEpisodeList = async (id) => {
const extractEpisodeList = async (slug) => {
try {
const url = `${BASE_URL}/anime/${id}`;
const url = URLS.watch(slug);
const { data } = await axios.get(url, { headers });
const $ = cheerio.load(data);
const episodes = [];
$(".episodes-list .ep-item, .ss-list a").each((i, el) => {
const epId = $(el).attr("data-id") || $(el).attr("href")?.split("/").pop() || "";
const epId = $(el).attr("data-id") || $(el).attr("href")?.split("/ep-").pop() || "";
const epNumber = parseInt($(el).find(".ep-number, .ep-num").text().trim()) || i + 1;
const title = $(el).find(".ep-title, .ep-name").text().trim() || "";
const japaneseTitle = $(el).find(".ep-jp").text().trim() || "";
const filler = $(el).hasClass("filler") || false;
if (epId) {
@@ -22,7 +21,6 @@ const extractEpisodeList = async (id) => {
id: epId,
episode_no: epNumber,
title,
japaneseTitle,
filler
});
}