Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
798c850cef | ||
|
|
4e4c7d37eb | ||
|
|
97b4592946 | ||
|
|
b5ebb1d19c | ||
|
|
723c827e2a | ||
|
|
14bae6d365 |
@@ -1016,15 +1016,18 @@ try {
|
||||
return;
|
||||
}
|
||||
|
||||
if (img.src && (img.src.includes('logo') || img.className.includes('logo'))) {
|
||||
img.setAttribute('alt', getInstanceName() + ' Logo');
|
||||
return;
|
||||
}
|
||||
|
||||
var parentLink = img.closest('a');
|
||||
if (parentLink && parentLink.textContent && parentLink.textContent.trim().length > 0) {
|
||||
img.setAttribute('alt', '');
|
||||
} else if (parentLink && parentLink.getAttribute('title')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (img.src && (img.src.includes('logo') || img.className.includes('logo'))) {
|
||||
img.setAttribute('alt', getInstanceName());
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentLink && parentLink.getAttribute('title')) {
|
||||
img.setAttribute('alt', parentLink.getAttribute('title'));
|
||||
} else {
|
||||
img.setAttribute('alt', 'Görsel');
|
||||
@@ -1960,6 +1963,15 @@ try {
|
||||
}
|
||||
|
||||
function injectControlBarSeekButtons(playerWrapper) {
|
||||
// A11y: Video.js büyük oynat butonunu ve denetim çubuğu butonlarını ekran okuyuculara erişilebilir kıl
|
||||
// big-play-button custom label removed per user preference
|
||||
var playBtn = (playerWrapper || document).querySelector('.vjs-play-control');
|
||||
if (playBtn && !playBtn.hasAttribute('data-yaktube-a11y-label')) {
|
||||
playBtn.setAttribute('data-yaktube-a11y-label', 'true');
|
||||
var videoEl = getVideoElement();
|
||||
var isPaused = videoEl ? videoEl.paused : true;
|
||||
playBtn.setAttribute('aria-label', isPaused ? 'Oynat (Boşluk veya K)' : 'Duraklat (Boşluk veya K)');
|
||||
}
|
||||
var controlBar = (playerWrapper || document).querySelector('.vjs-control-bar');
|
||||
if (!controlBar) return;
|
||||
|
||||
@@ -2199,7 +2211,7 @@ try {
|
||||
}
|
||||
|
||||
// Left Arrow or J: Rewind 10s
|
||||
if (e.key === 'ArrowLeft' || e.key === 'j' || e.key === 'J') {
|
||||
if ((e.key === 'ArrowLeft' && !e.altKey) || e.key === 'j' || e.key === 'J') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
video.currentTime = Math.max(0, video.currentTime - 10);
|
||||
@@ -2209,7 +2221,7 @@ try {
|
||||
}
|
||||
|
||||
// Right Arrow or L: Forward 10s
|
||||
if (e.key === 'ArrowRight' || e.key === 'l' || e.key === 'L') {
|
||||
if ((e.key === 'ArrowRight' && !e.altKey) || e.key === 'l' || e.key === 'L') {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
video.currentTime = Math.min(video.duration || 999999, video.currentTime + 10);
|
||||
@@ -2349,6 +2361,7 @@ try {
|
||||
|
||||
bar.innerHTML =
|
||||
'<span class="yaktube-player-bar-label">🛠️ Video Araçları:</span>' +
|
||||
'<button id="yaktube-bar-back-btn" class="yaktube-player-action-btn" aria-label="Önceki Sayfaya Geri Dön (Alt+Sol Ok)" title="Önceki Sayfaya Geri Dön (Alt+Sol Ok)">⬅️ Geri Dön</button>' +
|
||||
'<button id="yaktube-bar-speed-btn" class="yaktube-player-action-btn" aria-label="Oynatma Hızını Değiştir (Alt+.)">⚡ Hız</button>' +
|
||||
'<button id="yaktube-bar-sleep-btn" class="yaktube-player-action-btn" aria-label="Uyku Zamanlayıcısı (Alt+U)">⏱️ Uyku</button>' +
|
||||
'<button id="yaktube-bar-qr-btn" class="yaktube-player-action-btn" aria-label="Telefonda Devam Et / QR Kod (Alt+Q)">📱 Telefonda Aç</button>' +
|
||||
@@ -2375,6 +2388,17 @@ try {
|
||||
}
|
||||
|
||||
// Attach button actions
|
||||
var backBtn = bar.querySelector('#yaktube-bar-back-btn');
|
||||
if (backBtn) {
|
||||
backBtn.addEventListener('click', function () {
|
||||
if (window.history.length > 1) {
|
||||
window.history.back();
|
||||
} else {
|
||||
window.location.href = '/videos/overview';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bar.querySelector('#yaktube-bar-speed-btn').addEventListener('click', function () {
|
||||
adjustPlaybackSpeed(true);
|
||||
});
|
||||
@@ -2541,11 +2565,11 @@ try {
|
||||
announce('10 saniye ileri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
}
|
||||
// Seek 5s Back / Forward (ArrowLeft / ArrowRight or Alt+Left/Right)
|
||||
else if (e.key === 'ArrowLeft' || (alt && e.key === 'ArrowLeft')) {
|
||||
else if (e.key === 'ArrowLeft' && !alt) {
|
||||
e.preventDefault();
|
||||
video.currentTime = Math.max(0, video.currentTime - 5);
|
||||
announce('5 saniye geri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
} else if (e.key === 'ArrowRight' || (alt && e.key === 'ArrowRight')) {
|
||||
} else if (e.key === 'ArrowRight' && !alt) {
|
||||
e.preventDefault();
|
||||
video.currentTime = Math.min(video.duration || 99999, video.currentTime + 5);
|
||||
announce('5 saniye ileri sarıldı. Konum: ' + formatTime(video.currentTime));
|
||||
@@ -3679,6 +3703,18 @@ try {
|
||||
})
|
||||
})
|
||||
.then(function (data) {
|
||||
if (data && data.blocked) {
|
||||
hideModal();
|
||||
btn.disabled = false;
|
||||
btn.innerHTML = '📥 ' + escapeHtml(getInstanceName()) + "'a Aktar & İzle";
|
||||
showModal(
|
||||
'🛡️ Çocuk ve Aile Güvenliği',
|
||||
data.error ||
|
||||
"Bu video içeriği, Çocuk ve Aile Güvenliği (Child & Family Safety) politikaları gereğince YakTube'a aktarılamaz."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data && data.quotaExceeded) {
|
||||
hideModal();
|
||||
btn.disabled = false;
|
||||
@@ -3901,6 +3937,24 @@ try {
|
||||
cachedGuestImportLimit = ytData.guestImportLimit;
|
||||
}
|
||||
|
||||
if (ytData && ytData.blocked) {
|
||||
var safetyMsg =
|
||||
ytData.message ||
|
||||
'Bu arama terimi veya içerik, Çocuk ve Aile Güvenliği (Child & Family Safety) politikaları gereğince filtrelenmiştir.';
|
||||
container.innerHTML =
|
||||
'<div class="yaktube-header" style="border-left: 4px solid #ef4444; background: rgba(239, 68, 68, 0.08); padding: 18px 20px; border-radius: 8px; margin-bottom: 24px;">' +
|
||||
'<div class="yaktube-header-left">' +
|
||||
'<span class="yaktube-badge" style="background:#ef4444; color:#fff; font-weight:700;">🛡️ Çocuk ve Aile Güvenliği Koruması</span>' +
|
||||
'<h2 class="yaktube-title-h3" style="margin:8px 0 4px; font-size:1.15rem; color:#f87171;">Arama Filtrelendi</h2>' +
|
||||
'<p style="margin:0; font-size:0.95rem; color:#cbd5e1;">' +
|
||||
escapeHtml(safetyMsg) +
|
||||
'</p>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
announce(safetyMsg, true);
|
||||
return;
|
||||
}
|
||||
|
||||
var rawYtResults = ytData.results || [];
|
||||
var uniqueYtResults = [];
|
||||
var seenIds = {};
|
||||
@@ -4354,18 +4408,52 @@ try {
|
||||
var q = query.trim();
|
||||
try {
|
||||
var list = getRecentSearches();
|
||||
// Remove previous occurrence of the exact term (case-insensitive) and bubble it to the very top (#1)
|
||||
list = list.filter(function (item) {
|
||||
return item.toLowerCase() !== q.toLowerCase();
|
||||
});
|
||||
list.unshift(q);
|
||||
if (list.length > 12) list = list.slice(0, 12);
|
||||
if (list.length > 20) list = list.slice(0, 20);
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
||||
} catch (e) {}
|
||||
|
||||
// If user is logged in and sync is active, sync with YakNet account
|
||||
if (isAccountSyncEnabled()) {
|
||||
callCloudSearchHistory('POST', '', { query: q, device_name: 'YakTube Web' });
|
||||
callCloudSearchHistory('POST', '', { query: q, device_name: 'YakTube Web' }, function (data) {
|
||||
if (data && data.status === 'success' && Array.isArray(data.history) && data.history.length > 0) {
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteRecentSearch(targetQuery) {
|
||||
if (!targetQuery) return;
|
||||
var q = targetQuery.trim();
|
||||
try {
|
||||
var list = getRecentSearches();
|
||||
list = list.filter(function (item) {
|
||||
return item.toLowerCase() !== q.toLowerCase();
|
||||
});
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(list));
|
||||
} catch (e) {}
|
||||
|
||||
if (isAccountSyncEnabled()) {
|
||||
callCloudSearchHistory('DELETE', '?query=' + encodeURIComponent(q), { query: q }, function (data) {
|
||||
if (data && data.status === 'success' && Array.isArray(data.history)) {
|
||||
localStorage.setItem('yaktube_recent_searches', JSON.stringify(data.history));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
var filterVal = '';
|
||||
if (modal) {
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
if (inp) filterVal = inp.value;
|
||||
}
|
||||
renderDynamicSearchChips(filterVal);
|
||||
announce('"' + q + '" araması geçmişten silindi.');
|
||||
}
|
||||
|
||||
function clearRecentSearches() {
|
||||
@@ -4406,7 +4494,7 @@ try {
|
||||
captureUrlSearchQuery();
|
||||
window.addEventListener('popstate', captureUrlSearchQuery);
|
||||
|
||||
function renderDynamicSearchChips() {
|
||||
function renderDynamicSearchChips(filterText) {
|
||||
var modal = document.getElementById('yaktube-full-search-modal');
|
||||
if (!modal) return;
|
||||
|
||||
@@ -4416,12 +4504,28 @@ try {
|
||||
var recent = getRecentSearches();
|
||||
var loggedIn = isUserLoggedIn();
|
||||
var syncEnabled = isAccountSyncEnabled();
|
||||
var filter = (filterText || '').trim().toLowerCase();
|
||||
|
||||
var displayedRecent = recent;
|
||||
var displayedPopular = popularTrendingQueries;
|
||||
|
||||
if (filter.length > 0) {
|
||||
displayedRecent = recent.filter(function (term) {
|
||||
return term.toLowerCase().includes(filter);
|
||||
});
|
||||
displayedPopular = popularTrendingQueries.filter(function (item) {
|
||||
return item.q.toLowerCase().includes(filter) || item.title.toLowerCase().includes(filter);
|
||||
});
|
||||
}
|
||||
|
||||
var html = '';
|
||||
|
||||
// 1. Recent searches section
|
||||
html +=
|
||||
'<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px;">' +
|
||||
'<div class="yaktube-modal-section-title" style="margin-bottom: 0;">🕒 Son Aramalarınız</div>' +
|
||||
'<div class="yaktube-modal-section-title" style="margin-bottom: 0;">🕒 ' +
|
||||
(filter.length > 0 ? 'Eşleşen Son Aramalarınız' : 'Son Aramalarınız') +
|
||||
'</div>' +
|
||||
'<div style="display: flex; align-items: center; gap: 8px;">';
|
||||
|
||||
if (loggedIn) {
|
||||
@@ -4448,35 +4552,52 @@ try {
|
||||
'<span style="font-size: 11px; color: #94a3b8; background: #1e293b; border-radius: 6px; padding: 2px 8px;" title="Misafir modundasınız, aramalar sadece bu cihazda saklanır">🔒 Bu Cihazda</span>';
|
||||
}
|
||||
|
||||
if (recent.length > 0) {
|
||||
if (recent.length > 0 && filter.length === 0) {
|
||||
html +=
|
||||
'<button id="yaktube-clear-recent-btn" style="background: transparent; border: none; color: #ff8f37; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline;" aria-label="Arama geçmişini temizle">Geçmişi Temizle</button>';
|
||||
'<button id="yaktube-clear-recent-btn" style="background: transparent; border: none; color: #ff8f37; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline;" aria-label="Tüm arama geçmişini temizle">Geçmişi Temizle</button>';
|
||||
}
|
||||
|
||||
html += '</div></div>';
|
||||
|
||||
if (recent.length > 0) {
|
||||
if (displayedRecent.length > 0) {
|
||||
html += '<div class="yaktube-modal-chips-grid" style="margin-bottom: 18px;">';
|
||||
recent.forEach(function (term) {
|
||||
displayedRecent.forEach(function (term) {
|
||||
var safeTerm = term.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip yaktube-recent-chip" data-query="' +
|
||||
'<div class="yaktube-modal-chip yaktube-recent-chip" data-query="' +
|
||||
safeTerm +
|
||||
'" aria-label="Son arama: ' +
|
||||
'" title="' +
|
||||
safeTerm +
|
||||
' için ara">' +
|
||||
'<span class="yaktube-recent-chip-text" data-query="' +
|
||||
safeTerm +
|
||||
'">🕒 ' +
|
||||
safeTerm +
|
||||
'</button>';
|
||||
'</span>' +
|
||||
'<button type="button" class="yaktube-recent-chip-delete" data-delete-query="' +
|
||||
safeTerm +
|
||||
'" title="Bu aramayı geçmişten kaldır" aria-label="' +
|
||||
safeTerm +
|
||||
' aramasını geçmişten kaldır">✕</button>' +
|
||||
'</div>';
|
||||
});
|
||||
html += '</div>';
|
||||
} else if (filter.length > 0) {
|
||||
html +=
|
||||
'<div style="font-size: 12px; color: #94a3b8; margin-bottom: 14px; font-style: italic;">Geçmişte "' +
|
||||
filter.replace(/"/g, '"') +
|
||||
'" ile eşleşen kayıt bulunamadı.</div>';
|
||||
}
|
||||
|
||||
// 2. Popular & Trending searches section
|
||||
if (displayedPopular.length > 0) {
|
||||
html +=
|
||||
'<div class="yaktube-modal-section-title">🔥 Hızlı ve Popüler Aramalar</div>' +
|
||||
'<div class="yaktube-modal-section-title">🔥 ' +
|
||||
(filter.length > 0 ? 'Önerilen Aramalar' : 'Hızlı ve Popüler Aramalar') +
|
||||
'</div>' +
|
||||
'<div class="yaktube-modal-chips-grid">';
|
||||
|
||||
popularTrendingQueries.forEach(function (item) {
|
||||
displayedPopular.forEach(function (item) {
|
||||
var safeQ = item.q.replace(/"/g, '"');
|
||||
html +=
|
||||
'<button class="yaktube-modal-chip" data-query="' +
|
||||
@@ -4488,12 +4609,25 @@ try {
|
||||
'</button>';
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
container.innerHTML = html;
|
||||
|
||||
// Attach click events
|
||||
container.querySelectorAll('.yaktube-recent-chip-delete').forEach(function (delBtn) {
|
||||
delBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var delTerm = delBtn.getAttribute('data-delete-query');
|
||||
deleteRecentSearch(delTerm);
|
||||
});
|
||||
});
|
||||
|
||||
container.querySelectorAll('.yaktube-modal-chip').forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
chip.addEventListener('click', function (e) {
|
||||
if (e.target && e.target.classList.contains('yaktube-recent-chip-delete')) {
|
||||
return;
|
||||
}
|
||||
var query = chip.getAttribute('data-query');
|
||||
var inp = modal.querySelector('#yaktube-modal-input');
|
||||
if (inp) inp.value = query;
|
||||
@@ -4576,19 +4710,22 @@ try {
|
||||
var voiceBtn = modal.querySelector('#yaktube-modal-voice-btn');
|
||||
var micPulseBtn = modal.querySelector('#yaktube-modal-mic-pulse');
|
||||
|
||||
// Input typing & clear
|
||||
// Input typing & live search history filtering
|
||||
inp.addEventListener('input', function () {
|
||||
if (inp.value && inp.value.trim().length > 0) {
|
||||
var val = (inp.value || '').trim();
|
||||
if (val.length > 0) {
|
||||
clearBtn.style.display = 'inline-flex';
|
||||
} else {
|
||||
clearBtn.style.display = 'none';
|
||||
}
|
||||
renderDynamicSearchChips(val);
|
||||
});
|
||||
|
||||
clearBtn.addEventListener('click', function () {
|
||||
inp.value = '';
|
||||
clearBtn.style.display = 'none';
|
||||
inp.focus();
|
||||
renderDynamicSearchChips('');
|
||||
announce('Arama metni temizlendi.');
|
||||
});
|
||||
|
||||
@@ -4632,14 +4769,6 @@ try {
|
||||
}
|
||||
});
|
||||
|
||||
// Chips click
|
||||
modal.querySelectorAll('.yaktube-modal-chip').forEach(function (chip) {
|
||||
chip.addEventListener('click', function () {
|
||||
var query = chip.getAttribute('data-query');
|
||||
executeSearch(query);
|
||||
});
|
||||
});
|
||||
|
||||
// Voice button click
|
||||
voiceBtn.addEventListener('click', function () {
|
||||
toggleVoiceInsideModal();
|
||||
@@ -5860,3 +5989,11 @@ try {
|
||||
} catch (err) {
|
||||
console.error('[YakTube] Safe catch error:', err);
|
||||
}
|
||||
|
||||
// PeerTube Plugin Client Hook Registration
|
||||
export async function register({ registerHook, peertubeHelpers } = {}) {
|
||||
return true;
|
||||
}
|
||||
|
||||
export { register as registerClient };
|
||||
export default register;
|
||||
@@ -97,15 +97,140 @@ function postInnerTubeJSON(url, data) {
|
||||
|
||||
let pruneIntervalTimer = null;
|
||||
|
||||
async function register({ getRouter, registerSetting, settingsManager, peertubeHelpers, logger }) {
|
||||
const DEFAULT_BLOCKED_KEYWORDS = [
|
||||
'porn',
|
||||
'porno',
|
||||
'sex',
|
||||
'seksi',
|
||||
'sexy',
|
||||
'strip',
|
||||
'striptease',
|
||||
'bikini',
|
||||
'lingerie',
|
||||
'see-through',
|
||||
'sheer',
|
||||
'babydoll',
|
||||
'gravure',
|
||||
'nude',
|
||||
'nudes',
|
||||
'nudist',
|
||||
'erotik',
|
||||
'erotic',
|
||||
'erotizm',
|
||||
'çıplak',
|
||||
'ciplak',
|
||||
'soyunma',
|
||||
'soyun',
|
||||
'sikiş',
|
||||
'sikis',
|
||||
'amcık',
|
||||
'amcik',
|
||||
'yarak',
|
||||
'yarrak',
|
||||
'penis',
|
||||
'vagina',
|
||||
'vajina',
|
||||
'mastürbasyon',
|
||||
'masturbasyon',
|
||||
'adult',
|
||||
'+18',
|
||||
'nsfw',
|
||||
'xxx',
|
||||
'onlyfans',
|
||||
'sissy',
|
||||
'seduce',
|
||||
'seduces',
|
||||
'seducing',
|
||||
'seductress',
|
||||
'milf',
|
||||
'deepthroat',
|
||||
'blowjob',
|
||||
'anal',
|
||||
'hentai',
|
||||
'boob',
|
||||
'boobs',
|
||||
'uyuşturucu',
|
||||
'uyusturucu',
|
||||
'esrar',
|
||||
'kokain',
|
||||
'eroin',
|
||||
'bonzai',
|
||||
'bahis',
|
||||
'kumar',
|
||||
'bet',
|
||||
'casino'
|
||||
];
|
||||
|
||||
function isContentBlocked(text, list = DEFAULT_BLOCKED_KEYWORDS) {
|
||||
if (!text || typeof text !== 'string') return false;
|
||||
const clean = text.toLowerCase().replace(/['\"\-_\/\\.,;:\(\)\[\]#!\?]/g, ' ');
|
||||
const words = clean.split(/\s+/).filter(Boolean);
|
||||
|
||||
for (const item of list) {
|
||||
const target = item.trim().toLowerCase();
|
||||
if (!target) continue;
|
||||
if (target.includes(' ')) {
|
||||
if (clean.includes(target)) return true;
|
||||
} else {
|
||||
if (words.includes(target)) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async function register({ registerHook, getRouter, registerSetting, settingsManager, peertubeHelpers, logger }) {
|
||||
const router = getRouter();
|
||||
|
||||
// YakTube Bildirim Filtresi: Başarılı video içe aktarımları (type 7) bildirim kutusunu doldurmasın,
|
||||
// Sadece başarısız olanlar (type 8 / MY_VIDEO_IMPORT_ERROR) bildirim olarak düşsün
|
||||
if (typeof registerHook === 'function') {
|
||||
registerHook({
|
||||
target: 'filter:notifier.notification.enabled.result',
|
||||
handler: async (result, { notification }) => {
|
||||
if (notification && (notification.type === 7 || notification.type === 'my-video-import-success')) {
|
||||
return {
|
||||
webNotificationEnabled: false,
|
||||
emailNotificationEnabled: false
|
||||
};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
if (logger) logger.info('[YakTube OnDemand] Registered filter:notifier.notification.enabled.result (suppressing successful import notifications).');
|
||||
}
|
||||
|
||||
|
||||
let guestImportLimit = 5;
|
||||
let maxDiskUsagePercent = 85;
|
||||
let customChannelId = '';
|
||||
let customYtDlpPath = '';
|
||||
let safeSearchEnabled = true;
|
||||
let blockedKeywordsList = [...DEFAULT_BLOCKED_KEYWORDS];
|
||||
|
||||
if (typeof registerSetting === 'function') {
|
||||
registerSetting({
|
||||
name: 'safe-search-enabled',
|
||||
label: 'Güvenli Okul & Aile Araması (SafeSearch)',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: 'Açık (Önerilen - Katı Çocuk ve Aile Filtresi)', value: 'true' },
|
||||
{ label: 'Kapalı (Filtresiz)', value: 'false' }
|
||||
],
|
||||
description: 'Açık olduğunda arama sonuçlarında katı çocuk ve aile güvenliği filtresi uygulanır.',
|
||||
private: false,
|
||||
default: 'true'
|
||||
});
|
||||
|
||||
registerSetting({
|
||||
name: 'blocked-keywords',
|
||||
label: 'Yasaklı / Filtrelenecek Kelimeler (Çocuk & Aile Güvenliği)',
|
||||
type: 'input-textarea',
|
||||
description:
|
||||
'Arama ve video aktarma işlemlerinde filtrelenecek anahtar kelimeler listesi. Virgülle veya alt alta yazabilirsiniz. Bu kelimeleri içeren aramalar engellenir ve uygunsuz videolar sisteme aktarılamaz.',
|
||||
private: false,
|
||||
default: DEFAULT_BLOCKED_KEYWORDS.join(', ')
|
||||
});
|
||||
|
||||
registerSetting({
|
||||
name: 'guest-import-limit',
|
||||
label: 'Misafir Video İndirme Sınırı (Kota)',
|
||||
@@ -422,6 +547,24 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
}
|
||||
parsedHomeCategories = parseHomeCategories(rawHomeCategories);
|
||||
} catch (e) {}
|
||||
|
||||
try {
|
||||
const safeVal = await settingsManager.getSetting('safe-search-enabled');
|
||||
if (safeVal !== undefined && safeVal !== null) {
|
||||
safeSearchEnabled = String(safeVal).trim() !== 'false';
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
try {
|
||||
const wordsVal = await settingsManager.getSetting('blocked-keywords');
|
||||
if (wordsVal && typeof wordsVal === 'string' && wordsVal.trim() !== '') {
|
||||
const list = wordsVal
|
||||
.split(/[\n,]+/)
|
||||
.map(w => w.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
if (list.length > 0) blockedKeywordsList = list;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
await loadPluginSettings();
|
||||
@@ -843,6 +986,8 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
ok: true,
|
||||
guestImportLimit,
|
||||
maxDiskUsagePercent,
|
||||
safeSearchEnabled,
|
||||
blockedKeywords: blockedKeywordsList,
|
||||
categories: parsedHomeCategories
|
||||
});
|
||||
});
|
||||
@@ -887,9 +1032,22 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
return res.json({ results: [], guestImportLimit });
|
||||
}
|
||||
|
||||
if (safeSearchEnabled && isContentBlocked(query, blockedKeywordsList)) {
|
||||
return res.json({
|
||||
results: [],
|
||||
blocked: true,
|
||||
guestImportLimit,
|
||||
message:
|
||||
'Bu arama terimi veya içerik, Çocuk ve Aile Güvenliği (Child & Family Safety) politikaları gereğince filtrelenmiştir.'
|
||||
});
|
||||
}
|
||||
|
||||
const cached = getCached(query);
|
||||
if (cached) {
|
||||
const enriched = await enrichResultsWithLocalStatus(cached);
|
||||
const filteredCached = safeSearchEnabled
|
||||
? cached.filter(e => !isContentBlocked(e.title, blockedKeywordsList))
|
||||
: cached;
|
||||
const enriched = await enrichResultsWithLocalStatus(filteredCached);
|
||||
return res.json({ results: enriched, cached: true, guestImportLimit });
|
||||
}
|
||||
|
||||
@@ -911,7 +1069,7 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
}
|
||||
const json = JSON.parse(rawStr.substring(startIdx, endIdx + 1));
|
||||
const entries = json.entries || [];
|
||||
const rawResults = entries
|
||||
let rawResults = entries
|
||||
.filter(e => e && e.id)
|
||||
.map(e => {
|
||||
const duration = e.duration || 0;
|
||||
@@ -939,6 +1097,10 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
};
|
||||
});
|
||||
|
||||
if (safeSearchEnabled) {
|
||||
rawResults = rawResults.filter(e => !isContentBlocked(e.title, blockedKeywordsList));
|
||||
}
|
||||
|
||||
setCache(query, rawResults);
|
||||
const enrichedResults = await enrichResultsWithLocalStatus(rawResults);
|
||||
return res.json({ results: enrichedResults, cached: false, guestImportLimit });
|
||||
@@ -960,6 +1122,18 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
return res.status(400).json({ error: 'Invalid YouTube URL' });
|
||||
}
|
||||
|
||||
if (
|
||||
safeSearchEnabled &&
|
||||
(isContentBlocked(title, blockedKeywordsList) || isContentBlocked(targetUrl, blockedKeywordsList))
|
||||
) {
|
||||
return res.status(403).json({
|
||||
ok: false,
|
||||
blocked: true,
|
||||
error:
|
||||
"Bu video içeriği, Çocuk ve Aile Güvenliği (Child & Family Safety) politikaları gereğince YakTube'a aktarılamaz."
|
||||
});
|
||||
}
|
||||
|
||||
const isLoggedUser = await isRequestAuthenticated(req, res, isAuthenticated);
|
||||
if (!isLoggedUser && guestImportLimit > 0) {
|
||||
const clientCount = parseInt(String(guestImportCount || '0'), 10) || 0;
|
||||
@@ -1340,13 +1514,20 @@ async function register({ getRouter, registerSetting, settingsManager, peertubeH
|
||||
if (q && q.length >= 2) {
|
||||
const filtered = currentList.filter(item => String(item).toLowerCase() !== q.toLowerCase());
|
||||
filtered.unshift(q);
|
||||
store[userKey] = filtered.slice(0, 12);
|
||||
store[userKey] = filtered.slice(0, 20);
|
||||
writeHistoryStore(store);
|
||||
}
|
||||
return res.json({ status: 'success', history: store[userKey] || currentList });
|
||||
}
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
const target = ((req.body && req.body.query) || (req.query && req.query.query) || '').trim();
|
||||
if (target) {
|
||||
const filtered = currentList.filter(item => String(item).toLowerCase() !== target.toLowerCase());
|
||||
store[userKey] = filtered;
|
||||
writeHistoryStore(store);
|
||||
return res.json({ status: 'success', history: filtered });
|
||||
}
|
||||
delete store[userKey];
|
||||
writeHistoryStore(store);
|
||||
return res.json({ status: 'success', history: [] });
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "peertube-plugin-yaktube-ondemand",
|
||||
"version": "1.6.7",
|
||||
"version": "1.7.3",
|
||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations, Sleep Timer, Touch Gestures, Voice Assistant & A11y Engine for PeerTube",
|
||||
"main": "main.js",
|
||||
"library": "./main.js",
|
||||
|
||||
@@ -810,6 +810,42 @@ my-search-typeahead,
|
||||
transform: translateY(-1px) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-chip.yaktube-recent-chip {
|
||||
padding: 6px 10px 6px 14px !important;
|
||||
gap: 8px !important;
|
||||
}
|
||||
|
||||
.yaktube-recent-chip-text {
|
||||
cursor: pointer !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.yaktube-recent-chip-delete {
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
border: none !important;
|
||||
color: #94a3b8 !important;
|
||||
font-size: 11px !important;
|
||||
font-weight: 700 !important;
|
||||
line-height: 1 !important;
|
||||
cursor: pointer !important;
|
||||
width: 18px !important;
|
||||
height: 18px !important;
|
||||
border-radius: 50% !important;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
transition: all 0.2s ease !important;
|
||||
margin-left: 2px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.yaktube-recent-chip-delete:hover {
|
||||
background: rgba(239, 68, 68, 0.35) !important;
|
||||
color: #ff6b6b !important;
|
||||
transform: scale(1.15) !important;
|
||||
}
|
||||
|
||||
.yaktube-modal-hint-footer {
|
||||
display: flex !important;
|
||||
justify-content: space-between !important;
|
||||
@@ -1727,3 +1763,29 @@ my-date-toggle .date-toggle:focus-visible {
|
||||
background-color: rgba(255, 143, 55, 0.15) !important;
|
||||
outline: 2px solid #ff8f37 !important;
|
||||
}
|
||||
|
||||
|
||||
/* === YakTube WCAG 2.1 AAA Video Player Accessibility: Keep Controls Accessible === */
|
||||
|
||||
/* 1. Video duraklatıldığında veya klavye/ekran okuyucu odaklandığında denetim çubuğunu görünür tut */
|
||||
.video-js.vjs-paused .vjs-control-bar,
|
||||
.video-js:focus-within .vjs-control-bar,
|
||||
.video-js .vjs-control-bar:focus-within,
|
||||
.video-js.vjs-user-inactive.vjs-paused .vjs-control-bar {
|
||||
opacity: 1 !important;
|
||||
visibility: visible !important;
|
||||
display: flex !important;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
/* 2. Büyük merkez oynatma düğmesi PeerTube varsayılanında bırakıldı */
|
||||
|
||||
/* 3. Tüm Video.js düğmelerinin klavye odağını belirgin kıl */
|
||||
.video-js .vjs-control-bar .vjs-button:focus,
|
||||
.video-js .vjs-control-bar .vjs-button:focus-visible,
|
||||
.video-js .vjs-big-play-button:focus,
|
||||
.video-js .vjs-big-play-button:focus-visible {
|
||||
outline: 3px solid #ff8f37 !important;
|
||||
outline-offset: 2px !important;
|
||||
box-shadow: 0 0 10px rgba(255, 143, 55, 0.8) !important;
|
||||
}
|
||||
Reference in New Issue
Block a user