recycleactor commited on
Commit
ddbc64d
·
verified ·
1 Parent(s): 948a9f2

Upload server.js

Browse files
Files changed (1) hide show
  1. server.js +42 -0
server.js CHANGED
@@ -459,6 +459,48 @@ const server = http.createServer(async (req, res) => {
459
 
460
  if (pathname === '/health') { jsonResp(res, { ok: true, time: new Date().toISOString() }); return; }
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  // Show outbound IP of this server
463
  if (pathname === '/debug/ip') {
464
  fetchRaw('https://api.ipify.org?format=json', { 'user-agent': 'curl/7.0' })
 
459
 
460
  if (pathname === '/health') { jsonResp(res, { ok: true, time: new Date().toISOString() }); return; }
461
 
462
+ if (pathname === '/veoveo/embed') {
463
+ const embedUrl = query.url;
464
+ if (!embedUrl || !embedUrl.includes('kinoserial')) {
465
+ jsonResp(res, { ok: false, error: 'invalid url' }, 400); return;
466
+ }
467
+ fetchRaw(embedUrl, {
468
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
469
+ 'referer': 'https://veoveo.ru/',
470
+ 'origin': 'https://veoveo.ru',
471
+ 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
472
+ }).then(text => {
473
+ res.writeHead(200, {
474
+ 'Access-Control-Allow-Origin': '*',
475
+ 'Content-Type': 'text/html; charset=utf-8'
476
+ });
477
+ res.end(text);
478
+ }).catch(e => {
479
+ console.log('[veoveo/embed] error:', e.message);
480
+ jsonResp(res, { ok: false, error: e.message }, 500);
481
+ });
482
+ return;
483
+ }
484
+
485
+ if (pathname === '/veoveo/balancer') {
486
+ const contentId = query.id;
487
+ if (!contentId) { jsonResp(res, { ok: false, error: 'no id' }, 400); return; }
488
+ fetchRaw('https://api.rstprgapipt.com/balancer-api/proxy/playlists/catalog-api/episodes?content-id=' + contentId, {
489
+ 'referer': 'https://veoveo.ru/',
490
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36'
491
+ }).then(text => {
492
+ res.writeHead(200, {
493
+ 'Access-Control-Allow-Origin': '*',
494
+ 'Content-Type': 'application/json; charset=utf-8'
495
+ });
496
+ res.end(text);
497
+ }).catch(e => {
498
+ console.log('[veoveo/balancer] error:', e.message);
499
+ jsonResp(res, { ok: false, error: e.message }, 500);
500
+ });
501
+ return;
502
+ }
503
+
504
  // Show outbound IP of this server
505
  if (pathname === '/debug/ip') {
506
  fetchRaw('https://api.ipify.org?format=json', { 'user-agent': 'curl/7.0' })