Tu Nombre commited on
Commit
e0d62e7
·
1 Parent(s): 05fb8be

boton youtube en pagina espera

Browse files
Files changed (1) hide show
  1. main.py +7 -5
main.py CHANGED
@@ -423,7 +423,8 @@ async function activar(){
423
  });
424
  const d = await r.json();
425
  if(d.url){
426
- window.location.href = "/esperando?url=" + encodeURIComponent(d.url);
 
427
  } else {
428
  alert('Error: ' + (d.error||'Inténtalo de nuevo'));
429
  document.getElementById('btn').disabled = false;
@@ -487,7 +488,7 @@ async def check_space(url: str = ""):
487
  return {"ready": False}
488
 
489
  @app.get("/esperando", response_class=HTMLResponse)
490
- async def esperando(url: str = ""):
491
  return f"""<!DOCTYPE html>
492
  <html lang="es">
493
  <head>
@@ -514,6 +515,7 @@ p{{color:#888;font-size:.95rem;line-height:1.6;margin-bottom:12px;}}
514
  <p>Tu sistema está siendo construido en nuestros servidores.</p>
515
  <p>Este proceso tarda entre <strong style="color:#fff;">3-5 minutos</strong> la primera vez.</p>
516
  <p class="status" id="status">⚡ Instalando dependencias...</p>
 
517
  <a href="{url}" class="btn" id="enlace" target="_blank" style="display:none;">🚀 ENTRAR A MI CANAL</a>
518
  </div>
519
  <script>
@@ -537,10 +539,10 @@ async function checkReady() {{
537
  const r = await fetch(`/check-space?url=${{encodeURIComponent(url)}}`); const d = await r.json(); if(!d.ready) throw new Error('not ready');
538
  clearInterval(msgInterval);
539
  clearInterval(checkInterval);
540
- statusEl.textContent = "✅ ¡Tu canal está listo!";
541
  statusEl.style.color = "#4caf50";
542
- document.getElementById('enlace').style.display = 'block';
543
- setTimeout(() => window.location.href = url, 2000);
 
544
  }} catch(e) {{}}
545
  }}
546
  const checkInterval = setInterval(checkReady, 15000);
 
423
  });
424
  const d = await r.json();
425
  if(d.url){
426
+ const emailVal = document.getElementById("email").value.trim();
427
+ window.location.href = "/esperando?url=" + encodeURIComponent(d.url) + "&email=" + encodeURIComponent(emailVal);
428
  } else {
429
  alert('Error: ' + (d.error||'Inténtalo de nuevo'));
430
  document.getElementById('btn').disabled = false;
 
488
  return {"ready": False}
489
 
490
  @app.get("/esperando", response_class=HTMLResponse)
491
+ async def esperando(url: str = "", email: str = ""):
492
  return f"""<!DOCTYPE html>
493
  <html lang="es">
494
  <head>
 
515
  <p>Tu sistema está siendo construido en nuestros servidores.</p>
516
  <p>Este proceso tarda entre <strong style="color:#fff;">3-5 minutos</strong> la primera vez.</p>
517
  <p class="status" id="status">⚡ Instalando dependencias...</p>
518
+ <a href="/oauth-youtube?email={email}" id="yt-btn" target="_blank" class="btn" style="display:none;background:#ff0000;margin-bottom:12px;">📺 Conectar YouTube primero</a>
519
  <a href="{url}" class="btn" id="enlace" target="_blank" style="display:none;">🚀 ENTRAR A MI CANAL</a>
520
  </div>
521
  <script>
 
539
  const r = await fetch(`/check-space?url=${{encodeURIComponent(url)}}`); const d = await r.json(); if(!d.ready) throw new Error('not ready');
540
  clearInterval(msgInterval);
541
  clearInterval(checkInterval);
 
542
  statusEl.style.color = "#4caf50";
543
+ statusEl.innerHTML = "✅ ¡Tu canal está listo! Conecta YouTube para publicar videos.";
544
+ document.getElementById('yt-btn').style.display = 'block';
545
+ document.getElementById('enlace').style.display = 'block';
546
  }} catch(e) {{}}
547
  }}
548
  const checkInterval = setInterval(checkReady, 15000);