Update anime/hianime/source.js
This commit is contained in:
@@ -1,16 +1,14 @@
|
|||||||
class HiAnime {
|
class HiAnime {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.type = "anime-streaming";
|
this.type = "anime-streaming";
|
||||||
this.version = "1.0.3";
|
this.version = "1.0.4";
|
||||||
this.baseUrl = "https://hianime.to";
|
this.baseUrl = "https://hianime.to";
|
||||||
}
|
}
|
||||||
|
|
||||||
getSettings() {
|
getSettings() {
|
||||||
return {
|
return {
|
||||||
episodeServers: ["HD-1", "HD-2", "HD-3"],
|
episodeServers: ["HD-1", "HD-2", "HD-3", "HD-4"],
|
||||||
supportsSub: true,
|
supportsDub: true
|
||||||
supportsDub: true,
|
|
||||||
supportsHls: true
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,8 +41,16 @@ class HiAnime {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_safeStr(v) {
|
safeString(str) {
|
||||||
return typeof v === "string" ? v : (v == null ? "" : String(v));
|
return (typeof str === "string" ? str : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
normalizeSeasonParts(title) {
|
||||||
|
const s = this.safeString(title);
|
||||||
|
return s.toLowerCase()
|
||||||
|
.replace(/[^a-z0-9]+/g, "")
|
||||||
|
.replace(/\d+(st|nd|rd|th)/g, (m) => m.replace(/st|nd|rd|th/, ""))
|
||||||
|
.replace(/season|cour|part/g, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
_decodeHtml(str) {
|
_decodeHtml(str) {
|
||||||
@@ -84,49 +90,22 @@ class HiAnime {
|
|||||||
return q || {};
|
return q || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
_norm(s) {
|
_wantTrackFromEpisode(ep) {
|
||||||
return String(s || "")
|
const e = ep || {};
|
||||||
.toLowerCase()
|
if (typeof e.dub === "boolean") return e.dub ? "dub" : "sub";
|
||||||
.replace(/(season|cour|part|uncensored|movie|ova|ona|special)/g, " ")
|
|
||||||
.replace(/\d+(st|nd|rd|th)\b/g, (m) => m.replace(/st|nd|rd|th/g, ""))
|
|
||||||
.replace(/[^a-z0-9\s]+/g, " ")
|
|
||||||
.replace(/\s+/g, " ")
|
|
||||||
.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
_levSim(a, b) {
|
const sod = String(e.subOrDub || "").toLowerCase();
|
||||||
a = String(a || "");
|
if (sod === "dub" || sod === "sub") return sod;
|
||||||
b = String(b || "");
|
|
||||||
if (!a || !b) return 0;
|
|
||||||
|
|
||||||
const la = a.length, lb = b.length;
|
const tr = String(e.track || "").toLowerCase();
|
||||||
const dp = Array.from({ length: la + 1 }, () => new Array(lb + 1).fill(0));
|
if (tr === "dub" || tr === "sub") return tr;
|
||||||
for (let i = 0; i <= la; i++) dp[i][0] = i;
|
|
||||||
for (let j = 0; j <= lb; j++) dp[0][j] = j;
|
|
||||||
|
|
||||||
for (let i = 1; i <= la; i++) {
|
const id = String(e.id || "");
|
||||||
for (let j = 1; j <= lb; j++) {
|
const parts = id.split("/");
|
||||||
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
const last = (parts.length >= 2 ? parts[parts.length - 1] : "").toLowerCase();
|
||||||
dp[i][j] = Math.min(
|
if (last === "dub" || last === "sub") return last;
|
||||||
dp[i - 1][j] + 1,
|
|
||||||
dp[i][j - 1] + 1,
|
|
||||||
dp[i - 1][j - 1] + cost
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const dist = dp[la][lb];
|
|
||||||
const maxLen = Math.max(la, lb) || 1;
|
|
||||||
return 1 - (dist / maxLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
_bestTitle(obj) {
|
return "sub";
|
||||||
if (!obj) return "";
|
|
||||||
const t = obj.title;
|
|
||||||
if (typeof t === "string") return t;
|
|
||||||
if (t && typeof t === "object") {
|
|
||||||
return String(t.english || t.romaji || t.native || t.userPreferred || "");
|
|
||||||
}
|
|
||||||
return String(obj.name || obj.english || obj.romaji || "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_extractWatchIdFromUrl(url) {
|
_extractWatchIdFromUrl(url) {
|
||||||
@@ -135,173 +114,170 @@ class HiAnime {
|
|||||||
return m ? m[1] : "";
|
return m ? m[1] : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
_parseSearchHtmlToResults(html) {
|
|
||||||
const out = [];
|
|
||||||
const h = this._decodeHtml(html || "");
|
|
||||||
|
|
||||||
const re = /<a[^>]+href="([^"]+\/watch\/[^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;
|
|
||||||
let m;
|
|
||||||
const seen = {};
|
|
||||||
while ((m = re.exec(h)) !== null) {
|
|
||||||
const href = String(m[1] || "");
|
|
||||||
const full = href.startsWith("http") ? href : (this.baseUrl + href);
|
|
||||||
const id = this._extractWatchIdFromUrl(full);
|
|
||||||
if (!id) continue;
|
|
||||||
if (seen[id]) continue;
|
|
||||||
seen[id] = true;
|
|
||||||
|
|
||||||
const inner = String(m[2] || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
||||||
const title = inner || "";
|
|
||||||
|
|
||||||
out.push({
|
|
||||||
id: id,
|
|
||||||
title: title,
|
|
||||||
url: full
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
search(a1) {
|
search(a1) {
|
||||||
const arg = this._parseQuery(a1);
|
const query = this._parseQuery(a1);
|
||||||
const q = this._safeStr(arg.query || arg.q || "").trim();
|
|
||||||
|
const normalize = (str) =>
|
||||||
|
this.safeString(str).toLowerCase().replace(/[^a-z0-9]+/g, "");
|
||||||
|
|
||||||
|
const media = query.media || {};
|
||||||
|
const start = media.startDate || {};
|
||||||
|
const q = this.safeString(query.query || "").trim();
|
||||||
if (!q) return "[]";
|
if (!q) return "[]";
|
||||||
|
|
||||||
const url = `${this.baseUrl}/ajax/search/suggest?keyword=${encodeURIComponent(q)}`;
|
const url = `${this.baseUrl}/search?keyword=${encodeURIComponent(q)}&sy=${encodeURIComponent(String(start.year || ""))}&sm=${encodeURIComponent(String(start.month || ""))}&sort=default`;
|
||||||
const j = this._getJson(url, this._headers());
|
const html = this._getText(url, {
|
||||||
|
|
||||||
let results = [];
|
|
||||||
|
|
||||||
if (j && Array.isArray(j.results)) {
|
|
||||||
results = j.results.map((x) => {
|
|
||||||
const title = this._bestTitle(x) || String(x.name || "");
|
|
||||||
const u = x.url ? String(x.url) : "";
|
|
||||||
const full = u.startsWith("http") ? u : (u ? (this.baseUrl + u) : "");
|
|
||||||
const id = x.id ? String(x.id) : this._extractWatchIdFromUrl(full);
|
|
||||||
return { id, title, url: full };
|
|
||||||
}).filter((x) => x.id && x.url);
|
|
||||||
} else {
|
|
||||||
const html = String(j.html || j.result || "");
|
|
||||||
if (html) results = this._parseSearchHtmlToResults(html);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!results || results.length === 0) {
|
|
||||||
const page = this._getText(`${this.baseUrl}/search?keyword=${encodeURIComponent(q)}`, {
|
|
||||||
"User-Agent": "Mozilla/5.0",
|
"User-Agent": "Mozilla/5.0",
|
||||||
"Accept": "text/html",
|
"Accept": "text/html",
|
||||||
"Referer": this.baseUrl + "/",
|
"Referer": this.baseUrl + "/",
|
||||||
"Origin": this.baseUrl
|
"Origin": this.baseUrl
|
||||||
});
|
});
|
||||||
|
|
||||||
const re = /href="(\/watch\/[^"]+-\d+)"/gi;
|
const regex = /<a href="\/watch\/([^"]+)"[^>]+title="([^"]+)"[^>]+data-id="(\d+)"/g;
|
||||||
let mm;
|
|
||||||
const seen = {};
|
|
||||||
while ((mm = re.exec(page)) !== null) {
|
|
||||||
const href = mm[1];
|
|
||||||
const full = this.baseUrl + href;
|
|
||||||
const id = this._extractWatchIdFromUrl(full);
|
|
||||||
if (!id || seen[id]) continue;
|
|
||||||
seen[id] = true;
|
|
||||||
|
|
||||||
results.push({ id, title: q, url: full });
|
const matches = [];
|
||||||
if (results.length >= 20) break;
|
let m;
|
||||||
}
|
while ((m = regex.exec(html)) !== null) {
|
||||||
}
|
const id = m[3];
|
||||||
|
const pageUrl = m[1];
|
||||||
|
const title = this._decodeHtml(m[2]);
|
||||||
|
|
||||||
const nq = this._norm(q);
|
const jnameRegex = new RegExp(
|
||||||
results.forEach((r) => {
|
`<h3 class="film-name">[\\s\\S]*?<a[^>]+href="\\/${pageUrl}[^"]*"[^>]+data-jname="([^"]+)"`,
|
||||||
const nt = this._norm(r.title || "");
|
"i"
|
||||||
r._score = this._levSim(nq, nt);
|
);
|
||||||
|
const jnameMatch = html.match(jnameRegex);
|
||||||
|
const jname = jnameMatch ? this._decodeHtml(jnameMatch[1]) : "";
|
||||||
|
|
||||||
|
const imageRegex = new RegExp(
|
||||||
|
`<a href="/watch/${pageUrl.replace(/\//g, "\\/")}"[\\s\\S]*?<img[^>]+data-src="([^"]+)"`,
|
||||||
|
"i"
|
||||||
|
);
|
||||||
|
const imageMatch = html.match(imageRegex);
|
||||||
|
const image = imageMatch ? String(imageMatch[1]) : "";
|
||||||
|
|
||||||
|
matches.push({
|
||||||
|
id,
|
||||||
|
pageUrl,
|
||||||
|
title,
|
||||||
|
image,
|
||||||
|
normTitleJP: normalize(this.normalizeSeasonParts(jname)),
|
||||||
|
normTitle: normalize(this.normalizeSeasonParts(title))
|
||||||
});
|
});
|
||||||
results.sort((a, b) => (b._score || 0) - (a._score || 0));
|
}
|
||||||
|
|
||||||
return JSON.stringify(results.map((r) => ({
|
if (matches.length === 0) return "[]";
|
||||||
id: String(r.id),
|
|
||||||
title: String(r.title || ""),
|
const wantTrack = query.dub ? "dub" : "sub";
|
||||||
url: String(r.url || "")
|
|
||||||
})));
|
const out = matches.map(x => ({
|
||||||
|
id: String(x.id),
|
||||||
|
title: String(x.title || ""),
|
||||||
|
image: String(x.image || ""),
|
||||||
|
url: `${this.baseUrl}/watch/${x.pageUrl}`,
|
||||||
|
subOrDub: wantTrack
|
||||||
|
}));
|
||||||
|
|
||||||
|
return JSON.stringify(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
findEpisodes(animeId) {
|
findEpisodes(animeId) {
|
||||||
const id = this._safeStr(animeId).trim();
|
const raw = String(animeId || "").trim();
|
||||||
if (!id) return "[]";
|
if (!raw) return "[]";
|
||||||
|
|
||||||
const j = this._getJson(`${this.baseUrl}/ajax/v2/episode/list/${encodeURIComponent(id)}`, this._headers());
|
const parts = raw.split("/");
|
||||||
const html = this._decodeHtml(String(j.html || j.result || ""));
|
const id = parts[0];
|
||||||
|
const subOrDub = (parts[1] && (parts[1] === "dub" || parts[1] === "sub")) ? parts[1] : "sub";
|
||||||
|
|
||||||
|
const json = this._getJson(`${this.baseUrl}/ajax/v2/episode/list/${encodeURIComponent(id)}`, {
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
});
|
||||||
|
|
||||||
|
const html = this._decodeHtml(String(json.html || json.result || ""));
|
||||||
const episodes = [];
|
const episodes = [];
|
||||||
const re = /data-number="([^"]+)"[^>]*data-id="([^"]+)"/gi;
|
|
||||||
let m;
|
const regex = /<a[^>]*class="[^"]*\bep-item\b[^"]*"[^>]*data-number="(\d+)"[^>]*data-id="(\d+)"[^>]*href="([^"]+)"[\s\S]*?<div class="ep-name[^"]*"[^>]*title="([^"]+)"/g;
|
||||||
while ((m = re.exec(html)) !== null) {
|
|
||||||
const numRaw = String(m[1] || "").trim();
|
let match;
|
||||||
const epId = String(m[2] || "").trim();
|
while ((match = regex.exec(html)) !== null) {
|
||||||
const num = parseFloat(numRaw);
|
|
||||||
if (!epId || !isFinite(num)) continue;
|
|
||||||
episodes.push({
|
episodes.push({
|
||||||
id: epId,
|
id: `${match[2]}/${subOrDub}`,
|
||||||
number: num,
|
number: parseInt(match[1], 10),
|
||||||
title: "",
|
url: this.baseUrl + match[3],
|
||||||
url: ""
|
title: this._decodeHtml(match[4] || "")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (episodes.length === 0) {
|
|
||||||
const re2 = /data-episode-id="([^"]+)"[^>]*data-num="([^"]+)"/gi;
|
|
||||||
while ((m = re2.exec(html)) !== null) {
|
|
||||||
const epId = String(m[1] || "").trim();
|
|
||||||
const numRaw = String(m[2] || "").trim();
|
|
||||||
const num = parseFloat(numRaw);
|
|
||||||
if (!epId || !isFinite(num)) continue;
|
|
||||||
episodes.push({ id: epId, number: num, title: "", url: "" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
episodes.sort((a, b) => (a.number || 0) - (b.number || 0));
|
|
||||||
return JSON.stringify(episodes);
|
return JSON.stringify(episodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
findEpisodeServer(episodeObj, serverName) {
|
findEpisodeServer(episodeObj, _server) {
|
||||||
let ep = episodeObj;
|
let episode = episodeObj;
|
||||||
if (typeof ep === "string") {
|
if (typeof episode === "string") {
|
||||||
try { ep = JSON.parse(ep); } catch (e) { ep = {}; }
|
try { episode = JSON.parse(episode); } catch (e) { episode = {}; }
|
||||||
|
}
|
||||||
|
episode = episode || {};
|
||||||
|
|
||||||
|
const idParts = String(episode.id || "").split("/");
|
||||||
|
const episodeId = idParts[0];
|
||||||
|
if (!episodeId) throw new Error("Missing episode id");
|
||||||
|
|
||||||
|
const wantTrack = this._wantTrackFromEpisode(episode);
|
||||||
|
|
||||||
|
let serverName = String(_server || "").trim();
|
||||||
|
if (!serverName || serverName === "default") serverName = "HD-1";
|
||||||
|
|
||||||
|
if (serverName === "HD-4") {
|
||||||
|
throw new Error("HD-4 not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
const epId = this._safeStr(ep && ep.id ? ep.id : "").trim();
|
const serverJson = this._getJson(
|
||||||
if (!epId) throw new Error("Missing episode id");
|
`${this.baseUrl}/ajax/v2/episode/servers?episodeId=${encodeURIComponent(episodeId)}`,
|
||||||
|
{ "X-Requested-With": "XMLHttpRequest" }
|
||||||
|
);
|
||||||
|
|
||||||
const server = String(serverName || "").trim() || "HD-1";
|
const serverHtml = this._decodeHtml(String(serverJson.html || serverJson.result || ""));
|
||||||
|
if (!serverHtml) throw new Error("Empty server list");
|
||||||
|
|
||||||
const j = this._getJson(`${this.baseUrl}/ajax/v2/episode/servers?episodeId=${encodeURIComponent(epId)}`, this._headers());
|
const esc = (s) => String(s || "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
const html = this._decodeHtml(String(j.html || j.result || ""));
|
const strictRe = new RegExp(
|
||||||
|
`<div[^>]*class="item\\s+server-item"[^>]*data-type="${esc(wantTrack)}"[^>]*data-id="(\\d+)"[^>]*>[\\s\\S]*?<a[^>]*>[\\s\\S]*?${esc(serverName)}[\\s\\S]*?<\\/a>`,
|
||||||
|
"i"
|
||||||
|
);
|
||||||
|
|
||||||
let serverId = "";
|
let m = strictRe.exec(serverHtml);
|
||||||
|
let serverId = m ? String(m[1] || "").trim() : "";
|
||||||
const re = new RegExp(`data-id="([^"]+)"[^>]*>\\s*${server.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*<`, "i");
|
|
||||||
const mm = re.exec(html);
|
|
||||||
if (mm) serverId = String(mm[1] || "").trim();
|
|
||||||
|
|
||||||
if (!serverId) {
|
if (!serverId) {
|
||||||
const re2 = /data-id="([^"]+)"/i;
|
const trackAnyRe = new RegExp(
|
||||||
const mm2 = re2.exec(html);
|
`<div[^>]*class="item\\s+server-item"[^>]*data-type="${esc(wantTrack)}"[^>]*data-id="(\\d+)"`,
|
||||||
if (mm2) serverId = String(mm2[1] || "").trim();
|
"i"
|
||||||
|
);
|
||||||
|
m = trackAnyRe.exec(serverHtml);
|
||||||
|
serverId = m ? String(m[1] || "").trim() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!serverId) throw new Error("No server id found");
|
if (!serverId) {
|
||||||
|
const anyRe = /data-id="(\d+)"/i;
|
||||||
|
const mm = anyRe.exec(serverHtml);
|
||||||
|
serverId = mm ? String(mm[1] || "").trim() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!serverId) throw new Error(`Server id not found (track=${wantTrack} server=${serverName})`);
|
||||||
|
|
||||||
const sourcesJson = this._getJson(
|
const sourcesJson = this._getJson(
|
||||||
`${this.baseUrl}/ajax/v2/episode/sources?id=${encodeURIComponent(serverId)}`,
|
`${this.baseUrl}/ajax/v2/episode/sources?id=${encodeURIComponent(serverId)}`,
|
||||||
{ "X-Requested-With": "XMLHttpRequest" }
|
{ "X-Requested-With": "XMLHttpRequest" }
|
||||||
);
|
);
|
||||||
|
|
||||||
const embed = (sourcesJson && sourcesJson.link) ? String(sourcesJson.link) : "";
|
const embedUrl = sourcesJson && sourcesJson.link ? String(sourcesJson.link) : "";
|
||||||
if (!embed) throw new Error("No embed link returned");
|
if (!embedUrl) throw new Error("No embed link returned");
|
||||||
|
|
||||||
let decryptData = null;
|
let decryptData = null;
|
||||||
let requiredHeaders = {};
|
let requiredHeaders = {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
decryptData = this.extractMegaCloudSync(embed);
|
decryptData = this.extractMegaCloudSync(embedUrl);
|
||||||
requiredHeaders = (decryptData && decryptData.headersProvided) ? decryptData.headersProvided : {};
|
requiredHeaders = (decryptData && decryptData.headersProvided) ? decryptData.headersProvided : {};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
decryptData = null;
|
decryptData = null;
|
||||||
@@ -309,14 +285,13 @@ class HiAnime {
|
|||||||
|
|
||||||
if (!decryptData) {
|
if (!decryptData) {
|
||||||
decryptData = this._getJson(
|
decryptData = this._getJson(
|
||||||
`https://ac-api.ofchaos.com/api/anime/embed/convert/v2?embedUrl=${encodeURIComponent(embed)}`,
|
`https://ac-api.ofchaos.com/api/anime/embed/convert/v2?embedUrl=${encodeURIComponent(embedUrl)}`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
requiredHeaders = {
|
requiredHeaders = {
|
||||||
Referer: "https://megacloud.club/",
|
"Referer": "https://megacloud.club/",
|
||||||
Origin: "https://megacloud.club",
|
"Origin": "https://megacloud.club",
|
||||||
"User-Agent":
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
|
|
||||||
"X-Requested-With": "XMLHttpRequest"
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -325,14 +300,13 @@ class HiAnime {
|
|||||||
|
|
||||||
const sources = decryptData.sources || [];
|
const sources = decryptData.sources || [];
|
||||||
const streamSource =
|
const streamSource =
|
||||||
sources.find((s) => s && s.type === "hls" && s.file) ||
|
sources.find((s) => s && String(s.type || "").toLowerCase() === "hls" && s.file) ||
|
||||||
sources.find((s) => s && s.type === "mp4" && s.file) ||
|
sources.find((s) => s && String(s.type || "").toLowerCase() === "mp4" && s.file) ||
|
||||||
sources.find((s) => s && s.file);
|
sources.find((s) => s && s.file);
|
||||||
|
|
||||||
if (!streamSource || !streamSource.file) throw new Error("No valid stream file found");
|
if (!streamSource || !streamSource.file) throw new Error("No valid stream file found");
|
||||||
|
|
||||||
const tracks = decryptData.tracks || [];
|
const subtitles = (decryptData.tracks || [])
|
||||||
const subtitles = (tracks || [])
|
|
||||||
.filter((t) => t && String(t.kind || "").toLowerCase() === "captions" && t.file)
|
.filter((t) => t && String(t.kind || "").toLowerCase() === "captions" && t.file)
|
||||||
.map((track, index) => ({
|
.map((track, index) => ({
|
||||||
id: `sub-${index}`,
|
id: `sub-${index}`,
|
||||||
@@ -344,16 +318,15 @@ class HiAnime {
|
|||||||
const outType = (String(streamSource.type || "").toLowerCase() === "hls") ? "m3u8" : "mp4";
|
const outType = (String(streamSource.type || "").toLowerCase() === "hls") ? "m3u8" : "mp4";
|
||||||
|
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
server: server,
|
server: serverName,
|
||||||
headers: requiredHeaders || {},
|
headers: requiredHeaders || {},
|
||||||
videoSources: [
|
_debug: { scUsed: wantTrack, serverId: serverId },
|
||||||
{
|
videoSources: [{
|
||||||
url: String(streamSource.file),
|
url: String(streamSource.file),
|
||||||
type: outType,
|
type: outType,
|
||||||
quality: "auto",
|
quality: "auto",
|
||||||
subtitles: subtitles
|
subtitles
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,12 +340,11 @@ class HiAnime {
|
|||||||
const baseDomain = `${protocol}://${host}/`;
|
const baseDomain = `${protocol}://${host}/`;
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: "*/*",
|
"Accept": "*/*",
|
||||||
"X-Requested-With": "XMLHttpRequest",
|
"X-Requested-With": "XMLHttpRequest",
|
||||||
Referer: baseDomain,
|
"Referer": baseDomain,
|
||||||
Origin: `${protocol}://${host}`,
|
"Origin": `${protocol}://${host}`,
|
||||||
"User-Agent":
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const html = this._getText(embedUrl, headers);
|
const html = this._getText(embedUrl, headers);
|
||||||
|
|||||||
Reference in New Issue
Block a user