Spaces:
Configuration error
Configuration error
Download frontend/src/App.jsx from DONFU2DS/YouTooooooooobReels_AI: direct link, hf CLI and curl.
- Browser
- Download file 3.43 kB
-
https://huggingface.co/spaces/DONFU2DS/YouTooooooooobReels_AI/resolve/main/frontend/src/App.jsx
- Command line
-
hf download hf://spaces/DONFU2DS/YouTooooooooobReels_AI/frontend/src/App.jsx
-
curl -L -o App.jsx https://huggingface.co/spaces/DONFU2DS/YouTooooooooobReels_AI/resolve/main/frontend/src/App.jsx
3.43 kB
| import React, {useState} from 'react' | |
| export default function App(){ | |
| const [url,setUrl] = useState(''); | |
| const [seconds,setSeconds] = useState(12); | |
| const [clips,setClips] = useState(3); | |
| const [password,setPassword] = useState(''); | |
| const [status,setStatus] = useState(''); | |
| const [results,setResults] = useState([]); | |
| const start = async ()=>{ | |
| setStatus('⏳ جاري المعالجة...'); | |
| setResults([]); | |
| try{ | |
| const res = await fetch('/api/process', { | |
| method:'POST', | |
| headers:{'Content-Type':'application/json'}, | |
| body: JSON.stringify({ youtube:url, seconds, clips, password }) | |
| }); | |
| const data = await res.json(); | |
| if(!res.ok){ setStatus('❌ ' + (data.error||'خطأ')); return; } | |
| setStatus('✅ انتهى!'); | |
| setResults(data.clips); | |
| }catch(e){ setStatus('خطأ: '+e.message); } | |
| } | |
| return ( | |
| <div style={{fontFamily:'Inter, system-ui', background: 'linear-gradient(180deg,#071428,#020617)', minHeight:'100vh', padding:30, color:'#e6eef8'}}> | |
| <div style={{maxWidth:980, margin:'0 auto', background:'rgba(255,255,255,0.03)', padding:24, borderRadius:16}}> | |
| <h1 style={{fontSize:28, marginBottom:12}}>🎛️ AI Reels Maker</h1> | |
| <div style={{display:'grid', gridTemplateColumns:'1fr 360px', gap:20}}> | |
| <div> | |
| <label>لينك الفيديو</label> | |
| <input value={url} onChange={e=>setUrl(e.target.value)} style={{width:'100%',padding:12,borderRadius:8,marginTop:6}} placeholder="https://youtube.com/..." /> | |
| <div style={{display:'flex',gap:12, marginTop:12}}> | |
| <input type="number" value={seconds} onChange={e=>setSeconds(Number(e.target.value))} style={{flex:1,padding:12,borderRadius:8}} /> | |
| <input type="number" value={clips} onChange={e=>setClips(Number(e.target.value))} style={{width:120,padding:12,borderRadius:8}} /> | |
| </div> | |
| <input value={password} onChange={e=>setPassword(e.target.value)} placeholder="PASSWORD" style={{width:'100%',padding:12,borderRadius:8,marginTop:12}} /> | |
| <div style={{display:'flex', gap:12, marginTop:12}}> | |
| <button onClick={start} style={{background:'linear-gradient(90deg,#6d28d9,#4f46e5)', color:'#fff', padding:'12px 18px', borderRadius:10}}>استخراج</button> | |
| <button onClick={()=>{setUrl(''); setStatus(''); setResults([])}} style={{padding:12,borderRadius:10}}>مسح</button> | |
| </div> | |
| <p style={{marginTop:12}}>{status}</p> | |
| <div> | |
| {results.map((r,i)=> ( | |
| <div key={i} style={{marginTop:8}}> | |
| <a href={r} style={{display:'inline-block',padding:10,background:'#0a7f5b',color:'#fff',borderRadius:8,textDecoration:'none'}}>⬇️ تحميل clip {i+1}</a> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| <div style={{background:'#071428', padding:16, borderRadius:12}}> | |
| <h3>نصائح احترافية</h3> | |
| <ul> | |
| <li>- الموقع ينزل فقط المقاطع المطلوبة بدون تحميل الفيديو بالكامل.</li> | |
| <li>- التأكد من حقوق المحتوى قبل النشر.</li> | |
| </ul> | |
| <div style={{marginTop:12}}>Server: <span id="srv">running</span></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| ) | |
| } | |