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 | |
|---|---|---|---|
|
|
5c3c22999f | ||
|
|
24a81d92b4 | ||
|
|
74b36ec6ba | ||
|
|
96e6750f99 | ||
|
|
2d4dcafe82 | ||
|
|
8c3d49ec76 | ||
|
|
3950d91070 | ||
|
|
eef5bd85ac | ||
|
|
9ad6f12223 | ||
|
|
afdb78a479 | ||
|
|
caea63d4a5 | ||
|
|
6462410b02 | ||
|
|
a67bb3339e | ||
|
|
b952663f3a | ||
|
|
0c98d079be | ||
|
|
0bf905f81f | ||
|
|
f1720448c7 | ||
|
|
f73a1171c4 | ||
|
|
64afa7c5e9 | ||
|
|
c0af4e86b2 | ||
|
|
3cc2711e8c | ||
|
|
330ff2da2e | ||
|
|
80ea826948 | ||
|
|
e7dc5136e5 | ||
|
|
1aba41c992 | ||
|
|
afaf4ef856 | ||
|
|
52480401c8 | ||
|
|
46a9c8ab8c | ||
|
|
a5568de3cc | ||
|
|
d629c97dd8 | ||
|
|
3016fc6328 | ||
|
|
dac3137330 | ||
|
|
15361a21b6 | ||
|
|
c6e5abf87e | ||
|
|
e161dea9da | ||
|
|
6fc0f0ef97 | ||
|
|
c4fc917677 | ||
|
|
551b6d1ab6 | ||
|
|
51e41df3ca | ||
|
|
97079931f2 | ||
|
|
22ed7a4bda | ||
|
|
774c8f0f02 | ||
|
|
b5c2c97559 | ||
|
|
b71e2a83a0 | ||
|
|
85340b85c6 | ||
|
|
efa61318f6 | ||
|
|
7572ddb565 |
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
docs/
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
dist/
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
docs/
|
||||||
|
*.log
|
||||||
|
.git
|
||||||
|
.github
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 120,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"endOfLine": "auto"
|
||||||
|
}
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
- **⚡ Live Web & YouTube On-Demand Search:** Seamlessly search YouTube directly within your instance search bar. If the video is already on your instance, it plays immediately; otherwise, users can import it in 1 click.
|
- **⚡ Live Web & YouTube On-Demand Search:** Seamlessly search YouTube directly within your instance search bar. If the video is already on your instance, it plays immediately; otherwise, users can import it in 1 click.
|
||||||
- **🔥 Hybrid Smart Recommendations:** Intelligently discovers related content across local federated videos first, supplemented with relevant live discoveries.
|
- **🔥 Hybrid Smart Recommendations:** Intelligently discovers related content across local federated videos first, supplemented with relevant live discoveries.
|
||||||
- **♿ Full Screen Reader Accessibility (A11y):**
|
- **♿ Full Screen Reader Accessibility (A11y):**
|
||||||
- Dynamic result counters with live polite announcements (`aria-live`).
|
- Dynamic result counters with live polite and assertive announcements (`aria-live`).
|
||||||
|
- Auto-clearing live regions after speech lifecycle (WCAG 2.2 AAA compliant, prevents persistent DOM clutter for virtual cursors).
|
||||||
- Accessible keyboard navigation modal (`?` shortcut).
|
- Accessible keyboard navigation modal (`?` shortcut).
|
||||||
- Auto-labeled player controls, buttons, and thumbnails.
|
- Auto-labeled player controls, buttons, and thumbnails.
|
||||||
- **💬 Dynamic Live YouTube Comments:** View original YouTube community comments under imported videos on demand.
|
- **💬 Dynamic Live YouTube Comments:** View original YouTube community comments under imported videos on demand.
|
||||||
|
|||||||
@@ -1,10 +1,95 @@
|
|||||||
const { execFile } = require('child_process');
|
const { execFile } = require('child_process');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
const searchCache = new Map();
|
const searchCache = new Map();
|
||||||
const CACHE_TTL = 30 * 60 * 1000; // 30 minutes
|
const CACHE_TTL = 30 * 60 * 1000; // 30 minutes
|
||||||
|
|
||||||
|
let cachedYtDlpPath = null;
|
||||||
|
function resolveYtDlpPath(logger) {
|
||||||
|
if (cachedYtDlpPath && (cachedYtDlpPath === 'yt-dlp' || fs.existsSync(cachedYtDlpPath))) {
|
||||||
|
return cachedYtDlpPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. Environment variable override
|
||||||
|
if (process.env.YTDLP_PATH && fs.existsSync(process.env.YTDLP_PATH)) {
|
||||||
|
cachedYtDlpPath = process.env.YTDLP_PATH;
|
||||||
|
return cachedYtDlpPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Cross-platform candidates
|
||||||
|
const isWin = process.platform === 'win32';
|
||||||
|
const candidates = isWin
|
||||||
|
? [
|
||||||
|
'D:\\yaktube_storage\\bin\\yt-dlp.exe',
|
||||||
|
'C:\\laragon\\bin\\yt-dlp.exe',
|
||||||
|
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'];
|
||||||
|
|
||||||
|
for (const candidate of candidates) {
|
||||||
|
try {
|
||||||
|
if (candidate.includes(path.sep) && fs.existsSync(candidate)) {
|
||||||
|
cachedYtDlpPath = candidate;
|
||||||
|
if (logger) logger.info(`[YakTube OnDemand] Auto-detected yt-dlp binary at: ${cachedYtDlpPath}`);
|
||||||
|
return cachedYtDlpPath;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
cachedYtDlpPath = isWin ? 'D:\\yaktube_storage\\bin\\yt-dlp.exe' : 'yt-dlp';
|
||||||
|
return cachedYtDlpPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
let cachedChannels = null;
|
||||||
|
let channelsExpiresAt = 0;
|
||||||
|
|
||||||
|
async function getDefaultChannelId(category) {
|
||||||
|
// Category mapping defaults
|
||||||
|
const cat = String(category || '').toLowerCase();
|
||||||
|
if (cat.includes('tekno') || cat.includes('tech') || cat.includes('egitim')) return '3299';
|
||||||
|
if (cat.includes('podcast') || cat.includes('sohbet')) return '3298';
|
||||||
|
if (cat.includes('genel') || cat.includes('haber')) return '1';
|
||||||
|
if (cat.includes('muzik') || cat.includes('music')) return '1146';
|
||||||
|
|
||||||
|
if (cachedChannels && Date.now() < channelsExpiresAt) {
|
||||||
|
return cachedChannels.defaultId || '1146';
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
const req = http.request(
|
||||||
|
{
|
||||||
|
hostname: '127.0.0.1',
|
||||||
|
port: 9000,
|
||||||
|
path: '/api/v1/accounts/yaktube/video-channels',
|
||||||
|
method: 'GET',
|
||||||
|
headers: { Host: 'yaktube.yakhub.com.tr' }
|
||||||
|
},
|
||||||
|
res => {
|
||||||
|
let body = '';
|
||||||
|
res.on('data', c => (body += c));
|
||||||
|
res.on('end', () => {
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(body);
|
||||||
|
if (data && Array.isArray(data.data) && data.data.length > 0) {
|
||||||
|
const musicCh = data.data.find(c => c.name && c.name.includes('muzik'));
|
||||||
|
const defaultId = musicCh ? String(musicCh.id) : String(data.data[0].id);
|
||||||
|
cachedChannels = { defaultId, list: data.data };
|
||||||
|
channelsExpiresAt = Date.now() + 60 * 60 * 1000;
|
||||||
|
return resolve(defaultId);
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
resolve('1146');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
req.on('error', () => resolve('1146'));
|
||||||
|
req.end();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getCached(q) {
|
function getCached(q) {
|
||||||
const item = searchCache.get(q);
|
const item = searchCache.get(q);
|
||||||
if (item && Date.now() - item.time < CACHE_TTL) {
|
if (item && Date.now() - item.time < CACHE_TTL) {
|
||||||
@@ -99,7 +184,7 @@ async function getAdminToken() {
|
|||||||
|
|
||||||
async function register({ getRouter, peertubeHelpers, logger }) {
|
async function register({ getRouter, peertubeHelpers, logger }) {
|
||||||
const router = getRouter();
|
const router = getRouter();
|
||||||
const ytdlpPath = 'D:\\yaktube_storage\\bin\\yt-dlp.exe';
|
const ytdlpPath = resolveYtDlpPath(logger);
|
||||||
|
|
||||||
router.get('/search', async (req, res) => {
|
router.get('/search', async (req, res) => {
|
||||||
const query = (req.query.q || '').trim();
|
const query = (req.query.q || '').trim();
|
||||||
@@ -157,16 +242,17 @@ async function register({ getRouter, peertubeHelpers, logger }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.post('/import', async (req, res) => {
|
router.post('/import', async (req, res) => {
|
||||||
const { targetUrl } = req.body;
|
const { targetUrl, channelId, category } = req.body;
|
||||||
if (!targetUrl || (!targetUrl.includes('youtube.com') && !targetUrl.includes('youtu.be'))) {
|
if (!targetUrl || (!targetUrl.includes('youtube.com') && !targetUrl.includes('youtu.be'))) {
|
||||||
return res.status(400).json({ error: 'Invalid YouTube URL' });
|
return res.status(400).json({ error: 'Invalid YouTube URL' });
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const token = await getAdminToken();
|
const token = await getAdminToken();
|
||||||
|
const resolvedChannelId = channelId ? String(channelId) : await getDefaultChannelId(category);
|
||||||
const postData = new URLSearchParams({
|
const postData = new URLSearchParams({
|
||||||
targetUrl: targetUrl,
|
targetUrl: targetUrl,
|
||||||
channelId: '1146', // Türkçe Müzik channel
|
channelId: resolvedChannelId,
|
||||||
privacy: '1'
|
privacy: '1'
|
||||||
}).toString();
|
}).toString();
|
||||||
|
|
||||||
|
|||||||
+13
-5
@@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-yaktube-ondemand",
|
"name": "peertube-plugin-yaktube-ondemand",
|
||||||
"version": "1.2.4",
|
"version": "1.5.4",
|
||||||
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube",
|
"description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations, Sleep Timer, Touch Gestures, Voice Assistant & A11y Engine for PeerTube",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
|
"library": "./main.js",
|
||||||
|
"staticDirs": {},
|
||||||
|
"translations": {},
|
||||||
"clientScripts": [
|
"clientScripts": [
|
||||||
{
|
{
|
||||||
|
"script": "client.js",
|
||||||
"scopes": [
|
"scopes": [
|
||||||
"common"
|
"common"
|
||||||
],
|
]
|
||||||
"script": "client.js"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
@@ -27,6 +30,10 @@
|
|||||||
"accessibility",
|
"accessibility",
|
||||||
"a11y",
|
"a11y",
|
||||||
"screen-reader",
|
"screen-reader",
|
||||||
|
"sleep-timer",
|
||||||
|
"touch-gestures",
|
||||||
|
"voice-assistant",
|
||||||
|
"qr-transfer",
|
||||||
"fediverse",
|
"fediverse",
|
||||||
"voice-search",
|
"voice-search",
|
||||||
"speech-recognition",
|
"speech-recognition",
|
||||||
@@ -36,8 +43,9 @@
|
|||||||
"author": "Enes Yakıştır <[email protected]>",
|
"author": "Enes Yakıştır <[email protected]>",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/enesyakistir/peertube-plugin-yaktube-ondemand.git"
|
"url": "git+https://github.com/yakistir98/peertube-plugin-yaktube-ondemand.git"
|
||||||
},
|
},
|
||||||
"homepage": "https://yaktube.yakhub.com.tr",
|
"homepage": "https://yaktube.yakhub.com.tr",
|
||||||
|
"bugs": "https://github.com/yakistir98/peertube-plugin-yaktube-ondemand/issues",
|
||||||
"license": "AGPL-3.0-or-later"
|
"license": "AGPL-3.0-or-later"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user