mirror of
https://github.com/barkeser2002/turkanime-gui.git
synced 2026-11-24 18:06:12 +03:00
turkanime.tv kapandi; yeni kaynak olarak Animeler.pw (eski animeler.me,
301 ile yonleniyor) eklendi. Turkce altyazili anime + donghua sitesi;
Laravel arka ucu, onunde JS sinamasi olmayan Cloudflare. Tarayici
gerekmiyor, curl_cffi (chrome131) yetiyor.
Nasil calisiyor (turkanime_api/sources/animeler.py):
- Arama: GET /ajax/search?q= (JSON, en cok 8 sonuc, alaka sirasiyla).
Daha fazlasi istenirse /filter?search= kartlariyla tamamlaniyor.
"Comic" kategorisi ve yetiskin turleri (Hentai/Erotica; tur listesi
bir kez cekilip 12 sa onbellekte) atiliyor. Sonuc yoksa [], site
yanit vermezse AnimelerHatasi (arama motoru "aranamadi" gosterir).
- Bolumler: GET /<slug>; satir ici `allEpisodesData` dizisi tam listeyi
tasiyor (gorunen izgara 100'de kesiliyor). start/end ile izleme
sirasi; bolum kimligi sitedeki yol ("one-piece/bolum-215-216").
- Akislar: GET /<slug>/bolum-N (sunucu 12-30 sn dusunuyor: YALNIZ bu
istek 90 sn zaman asimli) -> `allEpisodeSources` JSON'u + csrf-token.
Her kaynak icin POST /ajax/get-source-url, sayfanin taze jetonuyla ve
sayfayi ceken AYNI oturumdan (bolum basina yeni oturum) -> /embed ->
tek iframe. FirePlayer on yuzleri (play.animeler.pw, anizmplayer.com
"Mugen") anizle.py'nin getVideo koduyla cozuluyor: o kod
anizle.fireplayer_istegi / fireplayer_akisi olarak disa acildi, Anizle
ayni ucu ayni basliklarla cagirmaya devam ediyor. loveulikeido.site
aynalari CryptoJS AES (EVP_BytesToKey) ile cozuluyor, yalnizca taninan
oynaticilar tutuluyor (pycryptodome yoksa -- sunucu imaji -- adim
atlaniyor). Olmayan bolum icin site 200 ile 1. bolumu donduruyor;
kanonik adres denetimi bunu 404 hatasi yapiyor. Siralama olculen
yt-dlp basarisina gore (sibnet, mail.ru, Mugen HLS, gdrive,
dailymotion, yadisk, sendvid, ..., ok.ru en sonda); "Yapay Zeka"
(makine cevirisi) grubu insan cevirisinden sonra. Ayni fansub+sunucu
adindan en cok 3 kaynak cozuluyor (JJK 1: 52 kaynak).
- Hatalar AnimelerHatasi(status_code) ile yukseliyor; tarayici 404'u
kalici, 5xx'i gecici, 403/429'u engel sayiyor.
Kayit: kayit.py'ye tembel yukleyici + Kaynak("Animeler", "Animeler.pw",
"AN", ...) satiri (bolum_adresi, bolum_slugu, taranabilir). DISCLAIMER
tablolarina animeler.pw ve oynatici konaklari eklendi; crawler tablo
testi ve sunucu bagimlilik listesi guncellendi.
Testler: tests/test_kaynak_animeler.py (46 cevrimdisi + 1 --network),
sitenin gercek yanitlarindan kirpilmis fiksturler
tests/fixtures/animeler/ (her biri <= 58 KB).
Canli denetim (2026-09-24, bu makineden):
- frieren: 3 sonuc; sousou-no-frieren 28 bolum; bolum-1 7 akis (11.8 sn)
- one piece: 10 sonuc (8 ajax + filtre); one-piece 1157 bolum
(son bolum-1161); bolum-1 9 akis (16.0 sn)
- naruto: 10 sonuc; naruto-shippuuden 482 bolum (ilk "bolum-1-2");
bolum-1-2 8 akis (16.0 sn)
- jujutsu kaisen: 4 sonuc; 24 bolum; bolum-1 19 akis (52 kaynaktan)
- yt-dlp --simulate --get-url: frieren 3/4, one piece 4/5, naruto 3/4,
jjk 4/5 oynatici turu cozuldu (sibnet, mail.ru, gdrive, sendvid,
dailymotion). Aralikli GET: mail.ru/gdrive/sendvid 206 video/mp4;
sibnet yt-dlp'nin kendi Referer'iyla 206 video/mp4. ok.ru yt-dlp'de
"author blocked" (bu yuzden en sonda). Mugen HLS burada yt-dlp'de
403: imza istek atan IP'ye bagli ve bu ortamin cikis IP'si donuyor;
jeton+m3u8 ayni oturumdan: master 200, varyant 466 segment, segment
206 (MPEG-TS). Tek IP'li kullanicida Anizle'deki gibi calisir.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015orra9NXZHpRa7PJyxoyR2
357 lines
23 KiB
HTML
357 lines
23 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="tr">
|
||
<head>
|
||
<title>One Piece izle - Anime izle - Animeler Pw - Turkanime - Tranimeizle</title>
|
||
<meta name="csrf-token" content="3WFaM4DJ8tQsONI2JxmeR92FBIKp9MZBuZJVbXg9">
|
||
<link rel="canonical" href="https://animeler.pw/one-piece">
|
||
</head>
|
||
<body>
|
||
<!-- kirpildi: sayfanin geri kalani -->
|
||
<script>
|
||
(function($) {
|
||
"use strict";
|
||
var seasonEpisodesData = {
|
||
};
|
||
|
||
var allEpisodesData = [
|
||
{ id: 25959, url: "https://animeler.pw/one-piece/bolum-1", start: 1, end: 1, display: "1", title: "One Piece 1. B\u00f6l\u00fcm izle" },
|
||
{ id: 25960, url: "https://animeler.pw/one-piece/bolum-2", start: 2, end: 2, display: "2", title: "One Piece 2. B\u00f6l\u00fcm izle" },
|
||
{ id: 25961, url: "https://animeler.pw/one-piece/bolum-3", start: 3, end: 3, display: "3", title: "One Piece 3. B\u00f6l\u00fcm izle" },
|
||
{ id: 25962, url: "https://animeler.pw/one-piece/bolum-4", start: 4, end: 4, display: "4", title: "One Piece 4. B\u00f6l\u00fcm izle" },
|
||
{ id: 25963, url: "https://animeler.pw/one-piece/bolum-5", start: 5, end: 5, display: "5", title: "One Piece 5. B\u00f6l\u00fcm izle" },
|
||
{ id: 26159, url: "https://animeler.pw/one-piece/bolum-211", start: 211, end: 211, display: "211", title: "One Piece 211. B\u00f6l\u00fcm izle" },
|
||
{ id: 26160, url: "https://animeler.pw/one-piece/bolum-212", start: 212, end: 212, display: "212", title: "One Piece 212. B\u00f6l\u00fcm izle" },
|
||
{ id: 26161, url: "https://animeler.pw/one-piece/bolum-213", start: 213, end: 213, display: "213", title: "One Piece 213. B\u00f6l\u00fcm izle" },
|
||
{ id: 26162, url: "https://animeler.pw/one-piece/bolum-214", start: 214, end: 214, display: "214", title: "One Piece 214. B\u00f6l\u00fcm izle" },
|
||
{ id: 26163, url: "https://animeler.pw/one-piece/bolum-215-216", start: 215, end: 216, display: "215-216", title: "One Piece 215-216. B\u00f6l\u00fcm izle" },
|
||
{ id: 26164, url: "https://animeler.pw/one-piece/bolum-217", start: 217, end: 217, display: "217", title: "One Piece 217. B\u00f6l\u00fcm izle" },
|
||
{ id: 26165, url: "https://animeler.pw/one-piece/bolum-218", start: 218, end: 218, display: "218", title: "One Piece 218. B\u00f6l\u00fcm izle" },
|
||
{ id: 26166, url: "https://animeler.pw/one-piece/bolum-219", start: 219, end: 219, display: "219", title: "One Piece 219. B\u00f6l\u00fcm izle" },
|
||
{ id: 26167, url: "https://animeler.pw/one-piece/bolum-220", start: 220, end: 220, display: "220", title: "One Piece 220. B\u00f6l\u00fcm izle" },
|
||
{ id: 26168, url: "https://animeler.pw/one-piece/bolum-221", start: 221, end: 221, display: "221", title: "One Piece 221. B\u00f6l\u00fcm izle" },
|
||
{ id: 26169, url: "https://animeler.pw/one-piece/bolum-222", start: 222, end: 222, display: "222", title: "One Piece 222. B\u00f6l\u00fcm izle" },
|
||
{ id: 26170, url: "https://animeler.pw/one-piece/bolum-223", start: 223, end: 223, display: "223", title: "One Piece 223. B\u00f6l\u00fcm izle" },
|
||
{ id: 26171, url: "https://animeler.pw/one-piece/bolum-224", start: 224, end: 224, display: "224", title: "One Piece 224. B\u00f6l\u00fcm izle" },
|
||
{ id: 26172, url: "https://animeler.pw/one-piece/bolum-225", start: 225, end: 225, display: "225", title: "One Piece 225. B\u00f6l\u00fcm izle" },
|
||
{ id: 26173, url: "https://animeler.pw/one-piece/bolum-226", start: 226, end: 226, display: "226", title: "One Piece 226. B\u00f6l\u00fcm izle" },
|
||
{ id: 26174, url: "https://animeler.pw/one-piece/bolum-227-228", start: 227, end: 228, display: "227-228", title: "One Piece 227-228. B\u00f6l\u00fcm izle" },
|
||
{ id: 26175, url: "https://animeler.pw/one-piece/bolum-229", start: 229, end: 229, display: "229", title: "One Piece 229. B\u00f6l\u00fcm izle" },
|
||
{ id: 26176, url: "https://animeler.pw/one-piece/bolum-230", start: 230, end: 230, display: "230", title: "One Piece 230. B\u00f6l\u00fcm izle" },
|
||
{ id: 26177, url: "https://animeler.pw/one-piece/bolum-231", start: 231, end: 231, display: "231", title: "One Piece 231. B\u00f6l\u00fcm izle" },
|
||
{ id: 26178, url: "https://animeler.pw/one-piece/bolum-232", start: 232, end: 232, display: "232", title: "One Piece 232. B\u00f6l\u00fcm izle" },
|
||
{ id: 26179, url: "https://animeler.pw/one-piece/bolum-233", start: 233, end: 233, display: "233", title: "One Piece 233. B\u00f6l\u00fcm izle" },
|
||
{ id: 91159, url: "https://animeler.pw/one-piece/bolum-1157", start: 1157, end: 1157, display: "1157", title: "ONE PIECE 1157. B\u00f6l\u00fcm izle" },
|
||
{ id: 91214, url: "https://animeler.pw/one-piece/bolum-1158", start: 1158, end: 1158, display: "1158", title: "ONE PIECE 1158. B\u00f6l\u00fcm izle" },
|
||
{ id: 91266, url: "https://animeler.pw/one-piece/bolum-1159", start: 1159, end: 1159, display: "1159", title: "ONE PIECE 1159. B\u00f6l\u00fcm izle" },
|
||
{ id: 91320, url: "https://animeler.pw/one-piece/bolum-1160", start: 1160, end: 1160, display: "1160", title: "ONE PIECE 1160. B\u00f6l\u00fcm izle" },
|
||
{ id: 91364, url: "https://animeler.pw/one-piece/bolum-1161", start: 1161, end: 1161, display: "1161", title: "ONE PIECE 1161. B\u00f6l\u00fcm izle" } ];
|
||
|
||
window.selectSeason = function(btn, seasonId) {
|
||
$('.season-btn').removeClass('active');
|
||
$(btn).addClass('active');
|
||
window.loadSeasonEpisodes(seasonId);
|
||
}
|
||
|
||
window.episodeViewMode = localStorage.getItem('animeDetailEpView') || 'grid';
|
||
|
||
window.setEpisodeView = function(mode) {
|
||
window.episodeViewMode = mode;
|
||
try { localStorage.setItem('animeDetailEpView', mode); } catch (e) {}
|
||
var container = document.getElementById('episodeContainer');
|
||
if (!container) return;
|
||
container.setAttribute('data-ep-view', mode);
|
||
var listEl = document.getElementById('episodeList');
|
||
if (listEl) listEl.setAttribute('aria-hidden', mode !== 'list');
|
||
if (typeof $ !== 'undefined') $('.ep-view-btn').removeClass('active').filter('[data-view="' + mode + '"]').addClass('active');
|
||
}
|
||
if (document.readyState === 'loading') {
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
var saved = (typeof localStorage !== 'undefined' && localStorage.getItem('animeDetailEpView')) || 'grid';
|
||
if (saved === 'list') setEpisodeView('list');
|
||
});
|
||
} else {
|
||
var saved = (typeof localStorage !== 'undefined' && localStorage.getItem('animeDetailEpView')) || 'grid';
|
||
if (saved === 'list') setEpisodeView('list');
|
||
}
|
||
|
||
$(document).on('click', '#episodeContainer .detail-ep-order-btn', function() {
|
||
var order = $(this).data('order');
|
||
if (!order || (order !== 'asc' && order !== 'desc')) return;
|
||
window.animeDetailEpisodeOrder = order;
|
||
try { localStorage.setItem('animeDetail_episode_order', order); } catch (e) {}
|
||
$('#episodeContainer .detail-ep-order-btn').removeClass('active').filter('[data-order="' + order + '"]').addClass('active');
|
||
applyDetailEpisodeOrderToContainer();
|
||
});
|
||
|
||
var currentPage = 0;
|
||
var perPage = 100;
|
||
window.animeDetailEpisodeOrder = (function() { try { return localStorage.getItem('animeDetail_episode_order') || 'asc'; } catch (e) { return 'asc'; } })();
|
||
|
||
function sortDetailPageEps(arr) {
|
||
var order = window.animeDetailEpisodeOrder || 'asc';
|
||
return arr.slice().sort(function(a, b) {
|
||
var na = parseInt(a.start, 10) || 0;
|
||
var nb = parseInt(b.start, 10) || 0;
|
||
return order === 'desc' ? nb - na : na - nb;
|
||
});
|
||
}
|
||
function applyDetailEpisodeOrderToContainer() {
|
||
var container = document.getElementById('episodeContainer');
|
||
if (!container) return;
|
||
var grid = container.querySelector('#episodeGrid');
|
||
var listEl = container.querySelector('#episodeList');
|
||
var order = window.animeDetailEpisodeOrder || 'asc';
|
||
function byEpNum(a, b) {
|
||
var na = parseInt(a.getAttribute('data-ep-num'), 10) || 0;
|
||
var nb = parseInt(b.getAttribute('data-ep-num'), 10) || 0;
|
||
return order === 'desc' ? nb - na : na - nb;
|
||
}
|
||
if (grid) {
|
||
var items = [].slice.call(grid.querySelectorAll('.ep-item'));
|
||
items.sort(byEpNum);
|
||
items.forEach(function(el) { grid.appendChild(el); });
|
||
}
|
||
if (listEl) {
|
||
var listItems = [].slice.call(listEl.querySelectorAll('.ep-list-item'));
|
||
listItems.sort(byEpNum);
|
||
listItems.forEach(function(el) { listEl.appendChild(el); });
|
||
}
|
||
if (typeof window.applyWatchedStyles === 'function') window.applyWatchedStyles();
|
||
}
|
||
|
||
window.loadSeasonEpisodes = function(seasonId) {
|
||
if (seasonId === null || !seasonEpisodesData[seasonId]) return;
|
||
|
||
const eps = seasonEpisodesData[seasonId];
|
||
const container = document.getElementById('episodeContainer');
|
||
if (!container) return;
|
||
const maxEnd = eps.length ? Math.max.apply(null, eps.map(function(e) { return e.end || 0; })) : 0;
|
||
const maxEpisodeNum = maxEnd >= 1 ? maxEnd : eps.length;
|
||
const totalPages = Math.max(1, Math.ceil(maxEpisodeNum / perPage));
|
||
|
||
let dropdownHtml = '';
|
||
for (let i = 0; i < totalPages; i++) {
|
||
const start = (i * perPage) + 1;
|
||
const end = Math.min((i + 1) * perPage, maxEpisodeNum);
|
||
dropdownHtml += '<option value="' + i + '">' + start + '-' + end + '</option>';
|
||
}
|
||
|
||
function getEpisodesInRange(epList, pageIndex, maxEp) {
|
||
var rStart = (pageIndex * perPage) + 1;
|
||
var rEnd = Math.min((pageIndex + 1) * perPage, maxEp);
|
||
return epList.filter(function(ep) {
|
||
var s = ep.start || 0;
|
||
var e = ep.end || s;
|
||
if (s < 1 && e < 1) return rStart <= 1;
|
||
return s <= rEnd && e >= rStart;
|
||
});
|
||
}
|
||
var pageEps = sortDetailPageEps(getEpisodesInRange(eps, 0, maxEpisodeNum));
|
||
var viewMode = window.episodeViewMode || 'grid';
|
||
var orderAsc = (window.animeDetailEpisodeOrder || 'asc') === 'asc';
|
||
var listHtml = '';
|
||
pageEps.forEach((ep, i) => {
|
||
listHtml += '<a href="' + ep.url + '" class="ep-list-item' + (i === 0 ? ' active' : '') + '" data-ep-id="' + (ep.id || '') + '" data-ep-num="' + ep.start + '"' + (ep.title ? ' data-episode-title="' + (ep.title || '').replace(/"/g, '"') + '"' : '') + '><span class="ep-list-num">' + ep.display + '</span><span class="ep-list-label">' + ep.display + '. Bölüm</span>' + (ep.title ? '<span class="ep-title-sr" aria-hidden="true">' + (ep.title || '').replace(/</g, '<').replace(/>/g, '>') + '</span>' : '') + '<i class="fas fa-play ep-list-play"></i></a>';
|
||
});
|
||
let html = '<div class="episodenav">' +
|
||
'<div class="episode-view-toggle" role="group" aria-label="Bölüm görünümü">' +
|
||
'<button type="button" class="ep-view-btn' + (viewMode === 'grid' ? ' active' : '') + '" data-view="grid" onclick="setEpisodeView(\'grid\')" title="Izgara görünümü"><i class="fas fa-th-large"></i></button>' +
|
||
'<button type="button" class="ep-view-btn' + (viewMode === 'list' ? ' active' : '') + '" data-view="list" onclick="setEpisodeView(\'list\')" title="Liste görünümü"><i class="fas fa-list"></i></button>' +
|
||
'</div>' +
|
||
'<div class="episode-order-toggle d-flex align-items-center gap-1 flex-wrap" style="margin-bottom: 0;">' +
|
||
'<span class="text-muted small">Sıra:</span>' +
|
||
'<button type="button" class="detail-ep-order-btn btn btn-sm btn-outline-secondary' + (orderAsc ? ' active' : '') + '" data-order="asc" title="A-Z">A-Z</button>' +
|
||
'<button type="button" class="detail-ep-order-btn btn btn-sm btn-outline-secondary' + (!orderAsc ? ' active' : '') + '" data-order="desc" title="Z-A">Z-A</button>' +
|
||
'</div>' +
|
||
'<div class="episodenav__right">' +
|
||
'<div class="episode-search-bar episode-search-bar--in-toolbar">' +
|
||
'<input type="text" inputmode="numeric" class="ep-search-input" placeholder="Bölüm numarası girin" data-min="1" data-max="' + maxEpisodeNum + '" data-season-id="' + seasonId + '" autocomplete="off">' +
|
||
'<button class="ep-search-btn" onclick="window.goToEpisodeNumber(' + seasonId + ')" aria-label="Belirli Bölüme Git"><i class="fas fa-search"></i></button>' +
|
||
'</div>' +
|
||
'<div class="episodenav__range">' +
|
||
'<select class="ep-range-dropdown" id="epRangeSelect" onchange="window.changeEpisodeRange(this.value, ' + seasonId + ')">' + dropdownHtml + '</select>' +
|
||
'<button class="ep-nav-btn" onclick="window.navigateEpisodePage(\'prev\')" aria-label="Önceki Bölüm Sayfası"><i class="fas fa-chevron-left"></i></button>' +
|
||
'<button class="ep-nav-btn" onclick="window.navigateEpisodePage(\'next\')" aria-label="Sonraki Bölüm Sayfası"><i class="fas fa-chevron-right"></i></button>' +
|
||
'</div></div></div>' +
|
||
'<div class="episode-grid" id="episodeGrid" data-total="' + eps.length + '" data-max-ep="' + maxEpisodeNum + '" data-per-page="' + perPage + '" data-season-id="' + seasonId + '">';
|
||
|
||
pageEps.forEach((ep, i) => {
|
||
html += '<a href="' + ep.url + '" class="ep-item' + (i === 0 ? ' active' : '') + '" data-ep-id="' + (ep.id || '') + '" data-ep-num="' + ep.start + '"' + (ep.title ? ' data-episode-title="' + (ep.title || '').replace(/"/g, '"') + '"' : '') + '>' + ep.display + (ep.title ? '<span class="ep-title-sr" aria-hidden="true">' + (ep.title || '').replace(/</g, '<').replace(/>/g, '>') + '</span>' : '') + '</a>';
|
||
});
|
||
|
||
html += '</div><div class="episode-list" id="episodeList" aria-hidden="' + (viewMode !== 'list') + '">' + listHtml + '</div>';
|
||
|
||
container.setAttribute('data-ep-view', viewMode);
|
||
container.innerHTML = html;
|
||
currentPage = 0;
|
||
|
||
if (typeof window.applyWatchedStyles === 'function') {
|
||
window.applyWatchedStyles();
|
||
}
|
||
};
|
||
|
||
window.changeEpisodeRange = function(page, seasonId) {
|
||
page = parseInt(page);
|
||
currentPage = page;
|
||
|
||
let eps;
|
||
if (seasonId !== null && seasonEpisodesData[seasonId]) {
|
||
eps = seasonEpisodesData[seasonId];
|
||
} else {
|
||
eps = allEpisodesData;
|
||
}
|
||
|
||
if (!eps) return;
|
||
|
||
var maxEp = 0;
|
||
eps.forEach(function(e) { var n = e.end || 0; if (n > maxEp) maxEp = n; });
|
||
if (maxEp < 1) maxEp = eps.length;
|
||
var gridEl = document.getElementById('episodeGrid');
|
||
if (gridEl && gridEl.getAttribute('data-max-ep')) maxEp = parseInt(gridEl.getAttribute('data-max-ep'), 10) || maxEp;
|
||
|
||
var rStart = (page * perPage) + 1;
|
||
var rEnd = Math.min((page + 1) * perPage, maxEp);
|
||
var pageEps = sortDetailPageEps(eps.filter(function(ep) {
|
||
var s = ep.start || 0;
|
||
var e = ep.end || s;
|
||
if (s < 1 && e < 1) return rStart <= 1;
|
||
return s <= rEnd && e >= rStart;
|
||
}));
|
||
|
||
const grid = document.getElementById('episodeGrid');
|
||
const listEl = document.getElementById('episodeList');
|
||
if (!grid) return;
|
||
|
||
let gridHtml = '';
|
||
let listHtml = '';
|
||
pageEps.forEach(function(ep, i) {
|
||
gridHtml += '<a href="' + ep.url + '" class="ep-item' + (i === 0 ? ' active' : '') + '" data-ep-id="' + (ep.id || '') + '" data-ep-num="' + ep.start + '"' + (ep.title ? ' data-episode-title="' + (ep.title || '').replace(/"/g, '"') + '"' : '') + '>' + ep.display + (ep.title ? '<span class="ep-title-sr" aria-hidden="true">' + (ep.title || '').replace(/</g, '<').replace(/>/g, '>') + '</span>' : '') + '</a>';
|
||
listHtml += '<a href="' + ep.url + '" class="ep-list-item' + (i === 0 ? ' active' : '') + '" data-ep-id="' + (ep.id || '') + '" data-ep-num="' + ep.start + '"' + (ep.title ? ' data-episode-title="' + (ep.title || '').replace(/"/g, '"') + '"' : '') + '><span class="ep-list-num">' + ep.display + '</span><span class="ep-list-label">' + ep.display + '. Bölüm</span>' + (ep.title ? '<span class="ep-title-sr" aria-hidden="true">' + (ep.title || '').replace(/</g, '<').replace(/>/g, '>') + '</span>' : '') + '<i class="fas fa-play ep-list-play"></i></a>';
|
||
});
|
||
|
||
grid.innerHTML = gridHtml;
|
||
if (listEl) listEl.innerHTML = listHtml;
|
||
|
||
if (typeof window.applyWatchedStyles === 'function') {
|
||
window.applyWatchedStyles();
|
||
}
|
||
};
|
||
|
||
(function initDetailEpisodeOrder() {
|
||
var order = window.animeDetailEpisodeOrder || 'asc';
|
||
if (typeof $ !== 'undefined') {
|
||
$('#episodeContainer .detail-ep-order-btn').removeClass('active').filter('[data-order="' + order + '"]').addClass('active');
|
||
}
|
||
applyDetailEpisodeOrderToContainer();
|
||
})();
|
||
|
||
function applyInitialEpisodeRange() {
|
||
var grid = document.getElementById('episodeGrid');
|
||
if (!grid) return;
|
||
var pp = parseInt(grid.getAttribute('data-per-page'), 10);
|
||
if (pp > 0) perPage = pp;
|
||
var sid = grid.getAttribute('data-season-id');
|
||
var seasonId = (sid === '' || sid === null || sid === undefined) ? null : sid;
|
||
if (seasonId !== null && typeof seasonEpisodesData !== 'undefined' && !seasonEpisodesData[seasonId]) return;
|
||
if (seasonId === null && (!window.allEpisodesData || allEpisodesData.length === 0)) return;
|
||
currentPage = 0;
|
||
var select = document.getElementById('epRangeSelect');
|
||
if (select) select.value = '0';
|
||
changeEpisodeRange(0, seasonId);
|
||
}
|
||
(function initDetailEpisodeRange() {
|
||
if (document.readyState === 'loading') {
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
setTimeout(applyInitialEpisodeRange, 0);
|
||
});
|
||
} else {
|
||
setTimeout(applyInitialEpisodeRange, 0);
|
||
}
|
||
})();
|
||
|
||
window.navigateEpisodePage = function(dir) {
|
||
const select = document.getElementById('epRangeSelect');
|
||
if (!select) return;
|
||
|
||
const currentVal = parseInt(select.value);
|
||
const maxVal = select.options.length - 1;
|
||
|
||
if (dir === 'prev' && currentVal > 0) {
|
||
select.value = currentVal - 1;
|
||
$(select).trigger('change');
|
||
} else if (dir === 'next' && currentVal < maxVal) {
|
||
select.value = currentVal + 1;
|
||
$(select).trigger('change');
|
||
}
|
||
}
|
||
|
||
window.goToEpisodeNumber = function(seasonId) {
|
||
const input = document.querySelector('.ep-search-input');
|
||
if (!input) return;
|
||
|
||
const num = parseInt(input.value, 10);
|
||
if (num <= 0) return;
|
||
|
||
var maxEp = parseInt(input.getAttribute('data-max'), 10) || 0;
|
||
if (maxEp && num > maxEp) {
|
||
alert('Geçersiz bölüm numarası (1-' + maxEp + ')');
|
||
return;
|
||
}
|
||
|
||
let eps;
|
||
if (seasonId !== null && seasonEpisodesData[seasonId]) {
|
||
eps = seasonEpisodesData[seasonId];
|
||
} else {
|
||
eps = allEpisodesData;
|
||
}
|
||
if (!eps || eps.length === 0) return;
|
||
|
||
var found = eps.find(function(ep) {
|
||
var start = ep.start || 0;
|
||
var end = ep.end || start;
|
||
return num >= start && num <= end;
|
||
});
|
||
if (found) {
|
||
window.location.href = found.url;
|
||
} else {
|
||
var byStart = eps.find(function(ep) { return (ep.start || 0) >= num; });
|
||
window.location.href = (byStart || eps[eps.length - 1]).url;
|
||
}
|
||
}
|
||
|
||
window.searchEpisode = function() {
|
||
window.goToEpisodeNumber(null);
|
||
}
|
||
|
||
window.searchEpisodeInSeason = function(seasonId) {
|
||
const input = document.querySelector(`.ep-search-input[data-season-id="${seasonId}"]`) || document.querySelector('.ep-search-input');
|
||
if (!input) return;
|
||
const num = parseInt(input.value);
|
||
if (num > 0) {
|
||
const items = document.querySelectorAll('.ep-item');
|
||
if (num <= items.length) {
|
||
window.location.href = items[num - 1].href;
|
||
}
|
||
}
|
||
}
|
||
|
||
window.toggleAllCharacters = function() {
|
||
const moreChars = document.getElementById('moreCharacters');
|
||
const btnText = document.getElementById('charBtnText');
|
||
const btnIcon = document.getElementById('charBtnIcon');
|
||
|
||
if (moreChars.classList.contains('d-none')) {
|
||
moreChars.classList.remove('d-none');
|
||
btnText.textContent = 'Daha Az Göster';
|
||
btnIcon.classList.replace('fa-chevron-down', 'fa-chevron-up');
|
||
} else {
|
||
moreChars.classList.add('d-none');
|
||
btnText.textContent = 'Tüm Karakterleri Göster (1472)';
|
||
btnIcon.classList.replace('fa-chevron-up', 'fa-chevron-down');
|
||
}
|
||
}
|
||
})(jQuery);
|
||
</script>
|
||
</body>
|
||
</html>
|