UI: purge every recording mention (intro, card stats, archive confirm, storage footer) — broadcast-only wording
Browse files- app.py +1 -1
- index.html +7 -7
app.py
CHANGED
|
@@ -272,7 +272,7 @@ def state():
|
|
| 272 |
disk=shutil.disk_usage(ROOT)
|
| 273 |
# Never leak the RTMP destination; expose presence only.
|
| 274 |
task_list=[{'username':u,'enabled':t.get('enabled'),'status':t.get('status'),
|
| 275 |
-
'
|
| 276 |
'has_rtmp':bool(t.get('rtmp'))} for u,t in tasks.items()]
|
| 277 |
tiktok_state=tiktok_auth.describe([t['username'] for t in task_list])
|
| 278 |
free_mb = round(disk.free/1048576,1)
|
|
|
|
| 272 |
disk=shutil.disk_usage(ROOT)
|
| 273 |
# Never leak the RTMP destination; expose presence only.
|
| 274 |
task_list=[{'username':u,'enabled':t.get('enabled'),'status':t.get('status'),
|
| 275 |
+
'has_token':bool(get_token(u)),
|
| 276 |
'has_rtmp':bool(t.get('rtmp'))} for u,t in tasks.items()]
|
| 277 |
tiktok_state=tiktok_auth.describe([t['username'] for t in task_list])
|
| 278 |
free_mb = round(disk.free/1048576,1)
|
index.html
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
<!doctype html><html lang="ar" dir="rtl"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>قصي • مدير البثوث</title><style>
|
| 2 |
-
:root{color-scheme:dark;font-family:system-ui}body{margin:0;background:#0c1220;color:#e4eaf7}main{max-width:1100px;margin:40px auto;padding:0 20px}header{display:flex;justify-content:space-between;align-items:center}h1{font-size:32px;margin:0}p{color:#9daec8;line-height:1.8}small{color:#9daec8}.badge{border:1px solid #355445;border-radius:30px;padding:8px 15px;color:#78e1b7}.panel{background:#151e30;border:1px solid #28364f;padding:24px;border-radius:18px;margin:22px 0}input,button{font:inherit;border-radius:10px;padding:12px;border:1px solid #364864}input{background:#0c1220;color:white;flex:1;min-width:100px}button{background:#70e1b4;color:#10251d;cursor:pointer;font-weight:650}button.secondary{background:#23324b;color:#d4e0f5}button.danger{background:#452735;color:#ffbccb}form{display:flex;gap:12px;flex-wrap:wrap}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.card{border:1px solid #32405a;border-radius:12px;padding:18px}.card h3{direction:ltr;text-align:right}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
|
| 3 |
|
| 4 |
textarea,select{font:inherit;background:#0c1220;color:#e4eaf7;border:1px solid #364864;border-radius:10px;padding:12px;box-sizing:border-box;width:100%}label{display:block;margin:14px 0 6px;color:#becce2}.settings{display:grid;grid-template-columns:1fr 1fr;gap:18px}.settings input{width:100%;box-sizing:border-box}.wide{grid-column:1/-1}.notice{border-right:3px solid #70e1b4;padding:10px 15px;background:#142b2b}#ytstate{white-space:pre-line}button:disabled{cursor:wait} @media(max-width:650px){.settings{grid-template-columns:1fr}header{gap:10px}.wide{grid-column:auto}}
|
| 5 |
</style></head><body><main>
|
| 6 |
-
<header><div><small>
|
| 7 |
-
<p>
|
| 8 |
<div id="error" role="alert" class="notice" hidden></div>
|
| 9 |
<section class="panel"><h2>الحسابات التابعة للمذيع</h2>
|
| 10 |
<form id="add"><input id="username" placeholder="اسم المستخدم أو رابط الحساب الكامل" required><input id="token" placeholder="توكن الجلسة sessionid — اختياري، للبثوث المقيدة عمريًا"><input id="rtmp" dir="ltr" placeholder="rtmps://a.rtmps.youtube.com:443/live2/KEY — مفتاح البث (اختياري)"><button>إضافة وبث</button></form>
|
|
@@ -12,7 +12,7 @@ textarea,select{font:inherit;background:#0c1220;color:#e4eaf7;border:1px solid #
|
|
| 12 |
<p class="notice">التوكن هو كوكيز جلسة تيك توك لحساب بالغ، يُستخدم فقط لفتح البثوث المقيدة بفئة عمرية. يُخزن في مجلد البيانات ولا يظهر في الواجهة أو السجلات. استخدم حسابًا مخصصًا له.</p></section>
|
| 13 |
|
| 14 |
<section class="panel"><h2>توكن تيك توك — للبثوث المقيدة عمريًا (18+)</h2>
|
| 15 |
-
<p>تيك توك يخفي روابط الفيديو عن الزائر غير المسجّل في البثوث المقيّدة عمريًا، فلا يمكن رصدها و
|
| 16 |
<label for="tokinput">الصق <b>كامل سطر Cookie</b> (أو قيمة <code dir="ltr">sessionid</code> وحدها)</label>
|
| 17 |
<textarea id="tokinput" rows="3" dir="ltr" placeholder="sessionid=...; sessionid_ss=...; sid_tt=...; tt-target-idc=useast1a; sid_guard=..."></textarea>
|
| 18 |
<div class="row" style="margin-top:12px">
|
|
@@ -44,7 +44,7 @@ textarea,select{font:inherit;background:#0c1220;color:#e4eaf7;border:1px solid #
|
|
| 44 |
<button type="submit" id="savesettings">حفظ إعدادات الأحداث</button></form></details>
|
| 45 |
</section>
|
| 46 |
<section class="panel"><h2>سجل التشغيل</h2><div id="logs"></div></section>
|
| 47 |
-
<footer>أسرار OAuth وتوكنات الجلسات تبقى في Secrets ومجلد البيانات فقط، ولا تظهر في الواجهة.
|
| 48 |
</main><script>
|
| 49 |
const $=id=>document.getElementById(id),esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
| 50 |
let settingsLoaded=false,channelId='',lastY=null,polling=false;
|
|
@@ -63,7 +63,7 @@ $('budget').textContent=`استهلاك API محلي تقديري: ${y.budget?.e
|
|
| 63 |
$('ytstart').disabled=!!y.automatic;$('ytstop').disabled=!y.automatic&&!evs.length;
|
| 64 |
$('savesettings').disabled=!!y.automatic||!!evs.length;
|
| 65 |
if(!settingsLoaded&&y.settings)fillSettings(y.settings);
|
| 66 |
-
$('tasks').innerHTML=s.tasks.length?s.tasks.map(t=>`<article class="card"><h3>@${esc(t.username)}</h3><p>${esc(t.status)}</p><small>
|
| 67 |
$('logs').innerHTML=s.logs.slice().reverse().map(l=>`<div>${esc(l.time)} · @${esc(l.user)} · ${esc(l.message)}</div>`).join('');
|
| 68 |
renderTiktok(s.tiktok);
|
| 69 |
}catch(e){error(e.message)}finally{polling=false}}
|
|
@@ -95,7 +95,7 @@ const r=await api('/api/tiktok/token/check/'+encodeURIComponent(u),'POST');
|
|
| 95 |
tokShow(`<b>${r.ok===false?'✖ ':'✔ '}${esc(r.message||r.result||'')}</b><br><small dir="ltr">result=${esc(r.result||'')} · anonymous=${r.anonymous?.urls??'—'} urls · authenticated=${r.authenticated?.urls??'—'} urls · token_configured=${r.token_configured}</small>`)}catch(e){tokShow('✖ '+esc(e.message))}finally{$('tokcheck').disabled=false}};
|
| 96 |
$('ytcheck').onclick=async()=>{try{error('');$('ytcheck').disabled=true;const j=await api('/api/youtube/check','POST');channelId=j.channel.id;await refresh();alert(`تم تفويض القناة: ${j.channel.title}\n${j.channel.id}\nلم يُنشأ أو يُنشر أي حدث بهذا الفحص.`)}catch(e){error(e.message)}finally{$('ytcheck').disabled=false}};
|
| 97 |
$('ytstart').onclick=async()=>{try{if(!channelId)throw Error('اضغط فحص OAuth أولًا');if(!confirm(`تفعيل إنشاء وبدء أحداث تلقائية لقناة ${lastY?.channel?.title||channelId}؟\nالخصوصية: ${lastY?.settings?.privacy}\nلكل مذيع مباشر حدث مستقل يبث بنفس الوقت (حتى ${lastY?.max_events||3} أحداث)، واسمه وعنوانه وهاشتاكاته تُجلب من حساب تيك توك نفسه.`))return;error('');await api('/api/youtube/start','POST',{channel_id:channelId});await refresh()}catch(e){error(e.message)}};
|
| 98 |
-
$('ytstop').onclick=async()=>{if(!confirm('تعطيل الإدارة وإنهاء جميع الأحداث الجارية
|
| 99 |
$('settingsform').onsubmit=async e=>{e.preventDefault();try{error('');await api('/api/youtube/settings','POST',{name:'',privacy:$('privacy').value,title:$('titletemplate').value,description:$('desctemplate').value});settingsLoaded=false;await refresh()}catch(e){error(e.message)}};
|
| 100 |
$('add').onsubmit=async e=>{e.preventDefault();try{error('');await api('/api/accounts','POST',{username:$('username').value,token:$('token').value,rtmp:$('rtmp').value});$('username').value='';$('token').value='';$('rtmp').value='';await refresh()}catch(e){error(e.message)}};
|
| 101 |
document.addEventListener('click',async e=>{const b=e.target.closest('button');if(!b)return;try{
|
|
|
|
| 1 |
<!doctype html><html lang="ar" dir="rtl"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>قصي • مدير البثوث</title><style>
|
| 2 |
+
:root{color-scheme:dark;font-family:system-ui}body{margin:0;background:#0c1220;color:#e4eaf7}main{max-width:1100px;margin:40px auto;padding:0 20px}header{display:flex;justify-content:space-between;align-items:center}h1{font-size:32px;margin:0}p{color:#9daec8;line-height:1.8}small{color:#9daec8}.badge{border:1px solid #355445;border-radius:30px;padding:8px 15px;color:#78e1b7}.panel{background:#151e30;border:1px solid #28364f;padding:24px;border-radius:18px;margin:22px 0}input,button{font:inherit;border-radius:10px;padding:12px;border:1px solid #364864}input{background:#0c1220;color:white;flex:1;min-width:100px}button{background:#70e1b4;color:#10251d;cursor:pointer;font-weight:650}button.secondary{background:#23324b;color:#d4e0f5}button.danger{background:#452735;color:#ffbccb}form{display:flex;gap:12px;flex-wrap:wrap}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.card{border:1px solid #32405a;border-radius:12px;padding:18px}.card h3{direction:ltr;text-align:right}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}a{color:#79dcc5}#logs{max-height:280px;overflow:auto;font:14px/1.9 monospace}#error{color:#ffc1c1}h2{font-size:20px}footer{color:#8e9eb6;font-size:13px;margin:30px 0}code{overflow-wrap:anywhere}button:disabled{opacity:.5}
|
| 3 |
|
| 4 |
textarea,select{font:inherit;background:#0c1220;color:#e4eaf7;border:1px solid #364864;border-radius:10px;padding:12px;box-sizing:border-box;width:100%}label{display:block;margin:14px 0 6px;color:#becce2}.settings{display:grid;grid-template-columns:1fr 1fr;gap:18px}.settings input{width:100%;box-sizing:border-box}.wide{grid-column:1/-1}.notice{border-right:3px solid #70e1b4;padding:10px 15px;background:#142b2b}#ytstate{white-space:pre-line}button:disabled{cursor:wait} @media(max-width:650px){.settings{grid-template-columns:1fr}header{gap:10px}.wide{grid-column:auto}}
|
| 5 |
</style></head><body><main>
|
| 6 |
+
<header><div><small>بث مباشر فقط — بدون أي تسجيل • حدث يوتيوب لكل مذيع • توكن تيك توك للبثوث المقيدة عمريًا</small><h1>قصي مهاجر عراقي</h1></div><span class="badge">مرصد البثوث</span></header>
|
| 7 |
+
<p>نقل مباشر فقط — التطبيق لا يسجّل ولا يحفظ أي ملف • حدث يوتيوب مستقل لكل مذيع مباشر يبث بنفس الوقت • اسم المذيع وعنوان البث والهاشتاكات تُجلب تلقائيًا من حسابه</p>
|
| 8 |
<div id="error" role="alert" class="notice" hidden></div>
|
| 9 |
<section class="panel"><h2>الحسابات التابعة للمذيع</h2>
|
| 10 |
<form id="add"><input id="username" placeholder="اسم المستخدم أو رابط الحساب الكامل" required><input id="token" placeholder="توكن الجلسة sessionid — اختياري، للبثوث المقيدة عمريًا"><input id="rtmp" dir="ltr" placeholder="rtmps://a.rtmps.youtube.com:443/live2/KEY — مفتاح البث (اختياري)"><button>إضافة وبث</button></form>
|
|
|
|
| 12 |
<p class="notice">التوكن هو كوكيز جلسة تيك توك لحساب بالغ، يُستخدم فقط لفتح البثوث المقيدة بفئة عمرية. يُخزن في مجلد البيانات ولا يظهر في الواجهة أو السجلات. استخدم حسابًا مخصصًا له.</p></section>
|
| 13 |
|
| 14 |
<section class="panel"><h2>توكن تيك توك — للبثوث المقيدة عمريًا (18+)</h2>
|
| 15 |
+
<p>تيك توك يخفي روابط الفيديو عن الزائر غير المسجّل في البثوث المقيّدة عمريًا، فلا يمكن رصدها أو نقلها. التوكن يفتحها.</p>
|
| 16 |
<label for="tokinput">الصق <b>كامل سطر Cookie</b> (أو قيمة <code dir="ltr">sessionid</code> وحدها)</label>
|
| 17 |
<textarea id="tokinput" rows="3" dir="ltr" placeholder="sessionid=...; sessionid_ss=...; sid_tt=...; tt-target-idc=useast1a; sid_guard=..."></textarea>
|
| 18 |
<div class="row" style="margin-top:12px">
|
|
|
|
| 44 |
<button type="submit" id="savesettings">حفظ إعدادات الأحداث</button></form></details>
|
| 45 |
</section>
|
| 46 |
<section class="panel"><h2>سجل التشغيل</h2><div id="logs"></div></section>
|
| 47 |
+
<footer>أسرار OAuth وتوكنات الجلسات تبقى في Secrets ومجلد البيانات فقط، ولا تظهر في الواجهة. التطبيق يبث فقط ولا يكتب أي تسجيلات على التخزين. تقدير API محلي وليس قراءة لحصة Google الفعلية. استخدمه للمحتوى الذي تملك حق إعادة نشره.</footer>
|
| 48 |
</main><script>
|
| 49 |
const $=id=>document.getElementById(id),esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
| 50 |
let settingsLoaded=false,channelId='',lastY=null,polling=false;
|
|
|
|
| 63 |
$('ytstart').disabled=!!y.automatic;$('ytstop').disabled=!y.automatic&&!evs.length;
|
| 64 |
$('savesettings').disabled=!!y.automatic||!!evs.length;
|
| 65 |
if(!settingsLoaded&&y.settings)fillSettings(y.settings);
|
| 66 |
+
$('tasks').innerHTML=s.tasks.length?s.tasks.map(t=>`<article class="card"><h3>@${esc(t.username)}</h3><p>${esc(t.status)}</p><small>بث مباشر فقط — لا تسجيل</small><p>${t.enabled?'المراقبة مفعّلة':'المراقبة معطّلة'} · توكن الجلسة: ${t.has_token?'موجود ✓':'غير مضاف'} · مفتاح يوتيوب: ${t.has_rtmp?'موجود ✓ (بث فقط)':'غير مضاف'}</p><div class="row"><button data-user="${esc(t.username)}" data-action="start">تشغيل</button><button class="secondary" data-user="${esc(t.username)}" data-action="stop">إيقاف</button><button class="secondary" data-user="${esc(t.username)}" data-action="token">توكن</button><button class="danger" data-user="${esc(t.username)}" data-action="delete">حذف</button></div></article>`).join(''):'<p>أضف حسابات المذيع المطلوبة فقط.</p>';
|
| 67 |
$('logs').innerHTML=s.logs.slice().reverse().map(l=>`<div>${esc(l.time)} · @${esc(l.user)} · ${esc(l.message)}</div>`).join('');
|
| 68 |
renderTiktok(s.tiktok);
|
| 69 |
}catch(e){error(e.message)}finally{polling=false}}
|
|
|
|
| 95 |
tokShow(`<b>${r.ok===false?'✖ ':'✔ '}${esc(r.message||r.result||'')}</b><br><small dir="ltr">result=${esc(r.result||'')} · anonymous=${r.anonymous?.urls??'—'} urls · authenticated=${r.authenticated?.urls??'—'} urls · token_configured=${r.token_configured}</small>`)}catch(e){tokShow('✖ '+esc(e.message))}finally{$('tokcheck').disabled=false}};
|
| 96 |
$('ytcheck').onclick=async()=>{try{error('');$('ytcheck').disabled=true;const j=await api('/api/youtube/check','POST');channelId=j.channel.id;await refresh();alert(`تم تفويض القناة: ${j.channel.title}\n${j.channel.id}\nلم يُنشأ أو يُنشر أي حدث بهذا الفحص.`)}catch(e){error(e.message)}finally{$('ytcheck').disabled=false}};
|
| 97 |
$('ytstart').onclick=async()=>{try{if(!channelId)throw Error('اضغط فحص OAuth أولًا');if(!confirm(`تفعيل إنشاء وبدء أحداث تلقائية لقناة ${lastY?.channel?.title||channelId}؟\nالخصوصية: ${lastY?.settings?.privacy}\nلكل مذيع مباشر حدث مستقل يبث بنفس الوقت (حتى ${lastY?.max_events||3} أحداث)، واسمه وعنوانه وهاشتاكاته تُجلب من حساب تيك توك نفسه.`))return;error('');await api('/api/youtube/start','POST',{channel_id:channelId});await refresh()}catch(e){error(e.message)}};
|
| 98 |
+
$('ytstop').onclick=async()=>{if(!confirm('تعطيل الإدارة وإنهاء جميع الأحداث الجارية؟'))return;try{error('');await api('/api/youtube/stop','POST');await refresh()}catch(e){error(e.message)}};
|
| 99 |
$('settingsform').onsubmit=async e=>{e.preventDefault();try{error('');await api('/api/youtube/settings','POST',{name:'',privacy:$('privacy').value,title:$('titletemplate').value,description:$('desctemplate').value});settingsLoaded=false;await refresh()}catch(e){error(e.message)}};
|
| 100 |
$('add').onsubmit=async e=>{e.preventDefault();try{error('');await api('/api/accounts','POST',{username:$('username').value,token:$('token').value,rtmp:$('rtmp').value});$('username').value='';$('token').value='';$('rtmp').value='';await refresh()}catch(e){error(e.message)}};
|
| 101 |
document.addEventListener('click',async e=>{const b=e.target.closest('button');if(!b)return;try{
|