• Más de 30 años de experiencia

  • Envío al mundo entero sin complicaciones

  • Un grupo Funky Junk en 6 Sucursales

Activate Viaplay Access

async function fetchNewCode() try const res = await fetch('/api/request-code', method: 'POST' ); const data = await res.json(); currentCode = data.code; document.getElementById('activationCode').innerText = currentCode; document.getElementById('statusMessage').innerHTML = '⬅️ Go to viaplay.com/activate and enter this code'; document.getElementById('statusMessage').style.color = '#aaa';

app.listen(PORT, () => console.log( Viaplay activation server running on http://localhost:$PORT ); ); <!-- public/tv.html --> <!DOCTYPE html> <html> <head> <title>Viaplay – Activate Your Device</title> <style> body background: linear-gradient(135deg, #0a0f1e 0%, #0a1a2a 100%); color: white; font-family: 'Segoe UI', system-ui, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; .tv-container text-align: center; background: rgba(0,0,0,0.7); padding: 3rem; border-radius: 2rem; box-shadow: 0 0 40px rgba(0,255,255,0.2); border: 1px solid cyan; .code font-size: 5rem; letter-spacing: 0.5rem; background: #000; padding: 0.5rem 2rem; border-radius: 1rem; font-family: monospace; font-weight: bold; color: cyan; margin: 2rem 0; .status font-size: 1.5rem; margin-top: 2rem; color: #aaa; .activated color: #0f0; font-weight: bold; animation: pulse 1s infinite; @keyframes pulse 0% opacity: 0.6; 100% opacity: 1; button background: cyan; color: black; border: none; padding: 10px 20px; font-size: 1rem; border-radius: 30px; cursor: pointer; margin-top: 20px; </style> </head> <body> <div class="tv-container"> <h1>📺 Viaplay</h1> <p>To watch, activate this device:</p> <div class="code" id="activationCode">------</div> <div class="status" id="statusMessage">Waiting for activation...</div> <button id="refreshBtn">⟳ New Code</button> </div> <script> let currentCode = null; let pollInterval = null; activate viaplay

async function activateDevice(code) messageDiv.innerHTML = ''; try const res = await fetch('/api/activate', method: 'POST', headers: 'Content-Type': 'application/json' , body: JSON.stringify( code, deviceId: 'web-browser' ) ); const data = await res.json(); if (res.ok) messageDiv.innerHTML = '✅ Success! Your TV is now activated. Enjoy Viaplay!'; messageDiv.className = 'success'; codeInput.value = ''; else messageDiv.innerHTML = ❌ $data.error ; messageDiv.className = 'error'; async function fetchNewCode() try const res = await

if (pollInterval) clearInterval(pollInterval); startPolling(currentCode); catch (err) console.error(err); document.getElementById('statusMessage').innerText = 'Error getting code. Retry.'; const code = req.body

// API: Check if a code has been activated (polling by TV) app.post('/api/check-code', (req, res) => const code = req.body; const entry = codes.get(code); if (entry && entry.status === 'activated') res.json( activated: true, deviceId: entry.deviceId ); codes.delete(code); // one-time use else res.json( activated: false );

, 10 * 60 * 1000);

close