mirror of
https://github.com/barkeser2002/turkanime-gui.git
synced 2026-11-25 00:26:09 +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
327 lines
23 KiB
HTML
327 lines
23 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="tr">
|
||
<head>
|
||
<title>Sousou no Frieren izle - Anime izle - Animeler Pw - Turkanime - Tranimeizle</title>
|
||
<meta name="csrf-token" content="3WFaM4DJ8tQsONI2JxmeR92FBIKp9MZBuZJVbXg9">
|
||
<link rel="canonical" href="https://animeler.pw/sousou-no-frieren">
|
||
</head>
|
||
<body>
|
||
<!-- kirpildi: sayfanin geri kalani -->
|
||
<script>
|
||
(function($) {
|
||
"use strict";
|
||
var seasonEpisodesData = {
|
||
};
|
||
|
||
var allEpisodesData = [
|
||
{ id: 15144, url: "https://animeler.pw/sousou-no-frieren/bolum-1", start: 1, end: 1, display: "1", title: "Sousou no Frieren 1. B\u00f6l\u00fcm izle" }, { id: 15145, url: "https://animeler.pw/sousou-no-frieren/bolum-2", start: 2, end: 2, display: "2", title: "Sousou no Frieren 2. B\u00f6l\u00fcm izle" }, { id: 15146, url: "https://animeler.pw/sousou-no-frieren/bolum-3", start: 3, end: 3, display: "3", title: "Sousou no Frieren 3. B\u00f6l\u00fcm izle" }, { id: 15147, url: "https://animeler.pw/sousou-no-frieren/bolum-4", start: 4, end: 4, display: "4", title: "Sousou no Frieren 4. B\u00f6l\u00fcm izle" }, { id: 15148, url: "https://animeler.pw/sousou-no-frieren/bolum-5", start: 5, end: 5, display: "5", title: "Sousou no Frieren 5. B\u00f6l\u00fcm izle" }, { id: 76360, url: "https://animeler.pw/sousou-no-frieren/bolum-6", start: 6, end: 6, display: "6", title: "Sousou no Frieren 6. B\u00f6l\u00fcm izle" }, { id: 15149, url: "https://animeler.pw/sousou-no-frieren/bolum-7", start: 7, end: 7, display: "7", title: "Sousou no Frieren 7. B\u00f6l\u00fcm izle" }, { id: 15150, url: "https://animeler.pw/sousou-no-frieren/bolum-8", start: 8, end: 8, display: "8", title: "Sousou no Frieren 8. B\u00f6l\u00fcm izle" }, { id: 15151, url: "https://animeler.pw/sousou-no-frieren/bolum-9", start: 9, end: 9, display: "9", title: "Sousou no Frieren 9. B\u00f6l\u00fcm izle" }, { id: 15152, url: "https://animeler.pw/sousou-no-frieren/bolum-10", start: 10, end: 10, display: "10", title: "Sousou no Frieren 10. B\u00f6l\u00fcm izle" }, { id: 15153, url: "https://animeler.pw/sousou-no-frieren/bolum-11", start: 11, end: 11, display: "11", title: "Sousou no Frieren 11. B\u00f6l\u00fcm izle" }, { id: 15154, url: "https://animeler.pw/sousou-no-frieren/bolum-12", start: 12, end: 12, display: "12", title: "Sousou no Frieren 12. B\u00f6l\u00fcm izle" }, { id: 15155, url: "https://animeler.pw/sousou-no-frieren/bolum-13", start: 13, end: 13, display: "13", title: "Sousou no Frieren 13. B\u00f6l\u00fcm izle" }, { id: 15156, url: "https://animeler.pw/sousou-no-frieren/bolum-14", start: 14, end: 14, display: "14", title: "Sousou no Frieren 14. B\u00f6l\u00fcm izle" }, { id: 15157, url: "https://animeler.pw/sousou-no-frieren/bolum-15", start: 15, end: 15, display: "15", title: "Sousou no Frieren 15. B\u00f6l\u00fcm izle" }, { id: 15158, url: "https://animeler.pw/sousou-no-frieren/bolum-16", start: 16, end: 16, display: "16", title: "Sousou no Frieren 16. B\u00f6l\u00fcm izle" }, { id: 15159, url: "https://animeler.pw/sousou-no-frieren/bolum-17", start: 17, end: 17, display: "17", title: "Sousou no Frieren 17. B\u00f6l\u00fcm izle" }, { id: 15160, url: "https://animeler.pw/sousou-no-frieren/bolum-18", start: 18, end: 18, display: "18", title: "Sousou no Frieren 18. B\u00f6l\u00fcm izle" }, { id: 15161, url: "https://animeler.pw/sousou-no-frieren/bolum-19", start: 19, end: 19, display: "19", title: "Sousou no Frieren 19. B\u00f6l\u00fcm izle" }, { id: 15162, url: "https://animeler.pw/sousou-no-frieren/bolum-20", start: 20, end: 20, display: "20", title: "Sousou no Frieren 20. B\u00f6l\u00fcm izle" }, { id: 15163, url: "https://animeler.pw/sousou-no-frieren/bolum-21", start: 21, end: 21, display: "21", title: "Sousou no Frieren 21. B\u00f6l\u00fcm izle" }, { id: 15164, url: "https://animeler.pw/sousou-no-frieren/bolum-22", start: 22, end: 22, display: "22", title: "Sousou no Frieren 22. B\u00f6l\u00fcm izle" }, { id: 15165, url: "https://animeler.pw/sousou-no-frieren/bolum-23", start: 23, end: 23, display: "23", title: "Sousou no Frieren 23. B\u00f6l\u00fcm izle" }, { id: 15166, url: "https://animeler.pw/sousou-no-frieren/bolum-24", start: 24, end: 24, display: "24", title: "Sousou no Frieren 24. B\u00f6l\u00fcm izle" }, { id: 15167, url: "https://animeler.pw/sousou-no-frieren/bolum-25", start: 25, end: 25, display: "25", title: "Sousou no Frieren 25. B\u00f6l\u00fcm izle" }, { id: 15168, url: "https://animeler.pw/sousou-no-frieren/bolum-26", start: 26, end: 26, display: "26", title: "Sousou no Frieren 26. B\u00f6l\u00fcm izle" }, { id: 15169, url: "https://animeler.pw/sousou-no-frieren/bolum-27", start: 27, end: 27, display: "27", title: "Sousou no Frieren 27. B\u00f6l\u00fcm izle" }, { id: 15170, url: "https://animeler.pw/sousou-no-frieren/bolum-28", start: 28, end: 28, display: "28", title: "Sousou no Frieren 28. 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 (62)';
|
||
btnIcon.classList.replace('fa-chevron-up', 'fa-chevron-down');
|
||
}
|
||
}
|
||
})(jQuery);
|
||
</script>
|
||
</body>
|
||
</html>
|