diff --git a/client.js b/client.js index 3762a33..33f95cb 100644 --- a/client.js +++ b/client.js @@ -57,7 +57,11 @@ try { // Ensure Fediverse Global Search (SepiaSearch) is default in PeertubeServerConfig try { - if (window.PeertubeServerConfig && window.PeertubeServerConfig.search && window.PeertubeServerConfig.search.searchIndex) { + if ( + window.PeertubeServerConfig && + window.PeertubeServerConfig.search && + window.PeertubeServerConfig.search.searchIndex + ) { window.PeertubeServerConfig.search.searchIndex.isDefaultSearch = true; } } catch (e) {} @@ -157,34 +161,37 @@ try { // Intercept and sanitize YakNet Account Web Component popup menu function hookYakNetAccountComponent() { if (typeof customElements === 'undefined') return; - customElements.whenDefined('yaknet-account').then(function () { - var YakNetAccount = customElements.get('yaknet-account'); - if (!YakNetAccount || !YakNetAccount.prototype || YakNetAccount.prototype._yaktubeSanitizerHooked) return; - YakNetAccount.prototype._yaktubeSanitizerHooked = true; - var originalRender = YakNetAccount.prototype.render; - if (typeof originalRender === 'function') { - YakNetAccount.prototype.render = function () { - originalRender.call(this); - try { - if (this.shadowRoot) { - var isOfficial = isOfficialYakTubeServer(); - // 1. In YakTube: Suppress redundant/recursive link to YakTube inside services list - var selfLinks = this.shadowRoot.querySelectorAll('a[href*="yaktube.yakhub.com.tr"]'); - selfLinks.forEach(function (a) { - a.style.display = 'none'; - }); - // 2. In third-party PeerTube instances: Suppress entire external services grid & header to avoid community backlash - if (!isOfficial) { - var appsGrid = this.shadowRoot.querySelector('.yn-apps-grid'); - if (appsGrid) appsGrid.style.display = 'none'; - var sectionTitle = this.shadowRoot.querySelector('#yn-services-label, .yn-section-title'); - if (sectionTitle) sectionTitle.style.display = 'none'; + customElements + .whenDefined('yaknet-account') + .then(function () { + var YakNetAccount = customElements.get('yaknet-account'); + if (!YakNetAccount || !YakNetAccount.prototype || YakNetAccount.prototype._yaktubeSanitizerHooked) return; + YakNetAccount.prototype._yaktubeSanitizerHooked = true; + var originalRender = YakNetAccount.prototype.render; + if (typeof originalRender === 'function') { + YakNetAccount.prototype.render = function () { + originalRender.call(this); + try { + if (this.shadowRoot) { + var isOfficial = isOfficialYakTubeServer(); + // 1. In YakTube: Suppress redundant/recursive link to YakTube inside services list + var selfLinks = this.shadowRoot.querySelectorAll('a[href*="yaktube.yakhub.com.tr"]'); + selfLinks.forEach(function (a) { + a.style.display = 'none'; + }); + // 2. In third-party PeerTube instances: Suppress entire external services grid & header to avoid community backlash + if (!isOfficial) { + var appsGrid = this.shadowRoot.querySelector('.yn-apps-grid'); + if (appsGrid) appsGrid.style.display = 'none'; + var sectionTitle = this.shadowRoot.querySelector('#yn-services-label, .yn-section-title'); + if (sectionTitle) sectionTitle.style.display = 'none'; + } } - } - } catch (e) {} - }; - } - }).catch(function () {}); + } catch (e) {} + }; + } + }) + .catch(function () {}); } hookYakNetAccountComponent(); @@ -1296,20 +1303,34 @@ try { var header = document.createElement('div'); header.className = 'yaktube-feature-modal-header'; - header.innerHTML = '

⏱️ Uyku Zamanlayıcısı

' + + header.innerHTML = + '

⏱️ Uyku Zamanlayıcısı

' + ''; var body = document.createElement('div'); body.className = 'yaktube-feature-modal-body'; - body.innerHTML = '

Videonun ne zaman durdurulacağını seçin. Süre bittiğinde ses yavaşça kısılarak oynatma durdurulur.

' + + body.innerHTML = + '

Videonun ne zaman durdurulacağını seçin. Süre bittiğinde ses yavaşça kısılarak oynatma durdurulur.

' + '
' + - '' + - '' + - '' + - '' + + '' + + '' + + '' + + '' + '
' + - '' + - (sleepTimer.targetTime || sleepTimer.mode ? '' : ''); + '' + + (sleepTimer.targetTime || sleepTimer.mode + ? '' + : ''); card.appendChild(header); card.appendChild(body); @@ -1376,18 +1397,24 @@ try { var header = document.createElement('div'); header.className = 'yaktube-feature-modal-header'; - header.innerHTML = '

📱 Telefonda Devam Et

' + + header.innerHTML = + '

📱 Telefonda Devam Et

' + ''; var formattedTime = formatClockTime(currentSec); - var qrImageUrl = 'https://api.qrserver.com/v1/create-qr-code/?size=220x220&margin=8&data=' + encodeURIComponent(targetUrl); + var qrImageUrl = + 'https://api.qrserver.com/v1/create-qr-code/?size=220x220&margin=8&data=' + encodeURIComponent(targetUrl); var body = document.createElement('div'); body.className = 'yaktube-feature-modal-body'; body.innerHTML = - '

Telefonunuzun kamerasıyla QR kodu okutarak videoyu kaldığınız yerden (' + formattedTime + ') izlemeye devam edebilirsiniz.

' + + '

Telefonunuzun kamerasıyla QR kodu okutarak videoyu kaldığınız yerden (' + + formattedTime + + ') izlemeye devam edebilirsiniz.

' + '
' + - 'Video Bağlantısı QR Kodu' + + 'Video Bağlantısı QR Kodu' + '
' + ''; @@ -1409,15 +1436,18 @@ try { var copyBtn = body.querySelector('#yaktube-qr-copy-action-btn'); copyBtn.addEventListener('click', function () { if (navigator.clipboard && navigator.clipboard.writeText) { - navigator.clipboard.writeText(targetUrl).then(function () { - copyBtn.textContent = '✅ Bağlantı Kopyalandı!'; - announce('Bağlantı panoya kopyalandı: ' + targetUrl); - setTimeout(function () { - copyBtn.textContent = '📋 Bağlantıyı Kopyala'; - }, 2500); - }).catch(function () { - fallbackCopy(targetUrl, copyBtn); - }); + navigator.clipboard + .writeText(targetUrl) + .then(function () { + copyBtn.textContent = '✅ Bağlantı Kopyalandı!'; + announce('Bağlantı panoya kopyalandı: ' + targetUrl); + setTimeout(function () { + copyBtn.textContent = '📋 Bağlantıyı Kopyala'; + }, 2500); + }) + .catch(function () { + fallbackCopy(targetUrl, copyBtn); + }); } else { fallbackCopy(targetUrl, copyBtn); } @@ -1454,7 +1484,8 @@ try { if (!existing) { existing = document.createElement('div'); existing.className = 'yaktube-doubletap-overlay ' + className; - existing.innerHTML = '
' + (isLeft ? '⏪ 10sn Geri' : '10sn İleri ⏩') + '
'; + existing.innerHTML = + '
' + (isLeft ? '⏪ 10sn Geri' : '10sn İleri ⏩') + '
'; container.appendChild(existing); } existing.classList.add('yaktube-ripple-active'); @@ -1466,7 +1497,8 @@ try { function initTouchSeekGesture(video) { if (!video) return; - var playerContainer = video.closest('.video-js, .player-container, .player, my-video-watch') || video.parentElement; + var playerContainer = + video.closest('.video-js, .player-container, .player, my-video-watch') || video.parentElement; if (!playerContainer || playerContainer.hasAttribute('data-yaktube-touch-seek-hooked')) return; playerContainer.setAttribute('data-yaktube-touch-seek-hooked', 'true'); @@ -1543,7 +1575,8 @@ try { } if (text === 'tam ekran' || text === 'büyük ekran' || text === 'tam ekran yap') { - var playerWrap = document.querySelector('.player-container, .video-player-container, my-video-watch .player') || video; + var playerWrap = + document.querySelector('.player-container, .video-player-container, my-video-watch .player') || video; if (playerWrap) { if (!document.fullscreenElement) { if (playerWrap.requestFullscreen) playerWrap.requestFullscreen(); @@ -2004,24 +2037,40 @@ try { bridge.innerHTML = '
' + - '
' + - '
' + - '🌐 Fediverse Ağı' + - '' + - (isFediverse ? 'SepiaSearch Küresel Fediverse Arama Aktif' : escapeHtml(getInstanceName()) + ' Yerel Arama Aktif') + - '' + - '
' + - '

🌐 Fediverse & Küresel Ağ Arama Sonuçları

' + - '

Merkeziyetsiz federe ağdaki (SepiaSearch ve bağımsız PeerTube sunucuları) video sonuçları aşağıda listelenmektedir.

' + - '
' + - '
' + - '' + - '' + - '
' + + '
' + + '
' + + '🌐 Fediverse Ağı' + + '' + + (isFediverse + ? 'SepiaSearch Küresel Fediverse Arama Aktif' + : escapeHtml(getInstanceName()) + ' Yerel Arama Aktif') + + '' + + '
' + + '

🌐 Fediverse & Küresel Ağ Arama Sonuçları

' + + '

Merkeziyetsiz federe ağdaki (SepiaSearch ve bağımsız PeerTube sunucuları) video sonuçları aşağıda listelenmektedir.

' + + '
' + + '
' + + '' + + '' + + '
' + '
'; var globalBtn = document.getElementById('yaktube-scope-global-btn'); @@ -2494,7 +2543,9 @@ try { '' + '
' + '' + - '
YouTube ve ' + escapeHtml(getInstanceName()) + ' yerel kütüphanesindeki eşleşmeler taranıyor...
' + + '
YouTube ve ' + + escapeHtml(getInstanceName()) + + ' yerel kütüphanesindeki eşleşmeler taranıyor...
' + '
'; var shortcutsBtn = document.getElementById('yaktube-open-shortcuts'); @@ -2607,7 +2658,7 @@ try { statusBadge = '✅ ' + escapeHtml(getInstanceName()) + - '\'da Mevcut'; + "'da Mevcut"; } var actionButton = ''; @@ -2626,9 +2677,11 @@ try { escapeHtml(item.localVideo.url) + '" class="yaktube-play-btn" aria-label="' + escapeHtml(item.title) + - ' videosunu ' + escapeHtml(getInstanceName()) + '\'dan hemen izle">▶️ ' + + ' videosunu ' + escapeHtml(getInstanceName()) + - '\'dan İzle'; + '\'dan hemen izle">▶️ ' + + escapeHtml(getInstanceName()) + + "'dan İzle"; } else { actionButton = ''; + "'a Aktar & İzle"; } - var durationText = isLive ? 'CANLI' : (item.durationFormatted || formatClockTime(item.duration)); + var durationText = isLive ? 'CANLI' : item.durationFormatted || formatClockTime(item.duration); var cardLabel = item.title + (isLive ? ' (Canlı Yayın)' : isLocal ? ' (' + getInstanceName() + ' kütüphanenizde mevcut)' : '') + @@ -2705,20 +2758,34 @@ try { if (localResults.length > 0) { var localCardsHtml = ''; localResults.forEach(function (lItem) { - var lThumb = lItem.thumbnailPath || (lItem.thumbnails && lItem.thumbnails[0] ? lItem.thumbnails[0].fileUrl : '/client/assets/images/default-thumbnail.jpg'); + var lThumb = + lItem.thumbnailPath || + (lItem.thumbnails && lItem.thumbnails[0] + ? lItem.thumbnails[0].fileUrl + : '/client/assets/images/default-thumbnail.jpg'); var lDuration = formatClockTime(lItem.duration); - var lChannel = (lItem.channel && (lItem.channel.displayName || lItem.channel.name)) || - (lItem.account && (lItem.account.displayName || lItem.account.name)) || - getInstanceName(); - var lWatchUrl = lItem.url || ('/videos/watch/' + (lItem.shortUUID || lItem.uuid)); + var lChannel = + (lItem.channel && (lItem.channel.displayName || lItem.channel.name)) || + (lItem.account && (lItem.account.displayName || lItem.account.name)) || + getInstanceName(); + var lWatchUrl = lItem.url || '/videos/watch/' + (lItem.shortUUID || lItem.uuid); var lViews = (lItem.views || 0) + ' görüntüleme'; - var lLabel = lItem.name + ', ' + lChannel + ', ' + getInstanceName() + ' yerel sunucusunda mevcut, Süre: ' + lDuration; + var lLabel = + lItem.name + + ', ' + + lChannel + + ', ' + + getInstanceName() + + ' yerel sunucusunda mevcut, Süre: ' + + lDuration; localCardsHtml += '
' + - '' + + '' + '
' + '' + '
' + - '✅ ' + escapeHtml(getInstanceName()) + '\'da Mevcut' + + '✅ ' + + escapeHtml(getInstanceName()) + + "'da Mevcut" + '

' + escapeHtml(lItem.name) + '

' + '
' + - escapeHtml(lChannel) + ' • ' + escapeHtml(lViews) + + escapeHtml(lChannel) + + ' • ' + + escapeHtml(lViews) + '
' + '
' + - '
▶️ ' + escapeHtml(getInstanceName()) + '\'dan Hemen İzle
' + + '
▶️ ' + + escapeHtml(getInstanceName()) + + "'dan Hemen İzle
" + '
' + '
' + '
'; }); localShelfHtml = - '
' + + '
' + '
' + '
' + '✅ Yerel Kütüphane' + '

"' + escapeHtml(query) + - '" için ' + escapeHtml(getInstanceName()) + ' Sunucusunda ' + localTotal + ' Video Bulundu

' + + '" için ' + + escapeHtml(getInstanceName()) + + ' Sunucusunda ' + + localTotal + + ' Video Bulundu' + '
' + 'Doğrudan sunucumuzda barındırılan, yüksek hızlı ve anında izlenebilen videolar' + '
' + @@ -3350,7 +3429,8 @@ try { announce('"' + transcript + '" için arama başlatılıyor...', true); setTimeout(function () { closeFullSearchModal(); - window.location.href = '/search?search=' + encodeURIComponent(transcript) + '&searchTarget=search-index'; + window.location.href = + '/search?search=' + encodeURIComponent(transcript) + '&searchTarget=search-index'; }, 500); } } diff --git a/main.js b/main.js index dd73b3c..2811505 100644 --- a/main.js +++ b/main.js @@ -27,13 +27,7 @@ function resolveYtDlpPath(logger) { path.join(process.cwd(), 'bin', 'yt-dlp.exe'), 'yt-dlp.exe' ] - : [ - '/usr/local/bin/yt-dlp', - '/usr/bin/yt-dlp', - '/bin/yt-dlp', - path.join(process.cwd(), 'bin', 'yt-dlp'), - 'yt-dlp' - ]; + : ['/usr/local/bin/yt-dlp', '/usr/bin/yt-dlp', '/bin/yt-dlp', path.join(process.cwd(), 'bin', 'yt-dlp'), 'yt-dlp']; for (const candidate of candidates) { try { @@ -64,7 +58,7 @@ async function getDefaultChannelId(category) { return cachedChannels.defaultId || '1146'; } - return new Promise((resolve) => { + return new Promise(resolve => { const req = http.request( { hostname: '127.0.0.1', diff --git a/style.css b/style.css index c6eeb68..b04fddb 100644 --- a/style.css +++ b/style.css @@ -1151,9 +1151,18 @@ body:has(#yaktube-ondemand-container) my-error-page { } @keyframes yaktube-ripple-bounce { - 0% { transform: scale(0.7); opacity: 0.5; } - 50% { transform: scale(1.1); opacity: 1; } - 100% { transform: scale(1); opacity: 1; } + 0% { + transform: scale(0.7); + opacity: 0.5; + } + 50% { + transform: scale(1.1); + opacity: 1; + } + 100% { + transform: scale(1); + opacity: 1; + } } /* -------------------------------------------------------------------------- */ @@ -1285,9 +1294,15 @@ body:has(#yaktube-ondemand-container) my-error-page { } @keyframes yaktube-pulse { - 0% { transform: scale(1); } - 50% { transform: scale(1.04); } - 100% { transform: scale(1); } + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.04); + } + 100% { + transform: scale(1); + } } .yaktube-qr-wrapper { @@ -1339,4 +1354,3 @@ body:has(#yaktube-ondemand-container) my-error-page { box-shadow: 0 6px 20px rgba(255, 143, 55, 0.4) !important; outline: none !important; } -