dongsik22 commited on
Commit
36dd22e
·
1 Parent(s): 7e0c5e7

diag(tvchak): diag/proxy에 body len + parsePlayerAaaa 결과 5회 — player_aaaa not found 원인 추적

Browse files
Files changed (1) hide show
  1. server.js +14 -3
server.js CHANGED
@@ -2650,9 +2650,20 @@ async function handleApi(req, res, parsed) {
2650
  });
2651
  out2.health = health;
2652
  // 실제 fetch 1회
2653
- const t1 = Date.now();
2654
- const fr = await nasFetch('https://tvchak204.com/index.php/vod/play/id/122862/sid/1/nid/1.html', 12000);
2655
- out2.fetch = { ok: fr.ok, status: fr.status, hasPlayer: typeof fr.body === 'string' && fr.body.includes('player_aaaa'), err: fr.error, ms: Date.now() - t1 };
 
 
 
 
 
 
 
 
 
 
 
2656
  out = out2;
2657
  }
2658
  else if (p === '/api/diag/tvchak') {
 
2650
  });
2651
  out2.health = health;
2652
  // 실제 fetch 1회
2653
+ // 5회 반복해서 body 길이 + parsePlayerAaaa 성공 여부 일관성 확인 (간헐 player_aaaa not found 진단)
2654
+ out2.fetches = [];
2655
+ for (let k = 0; k < 5; k++) {
2656
+ const t1 = Date.now();
2657
+ const fr = await nasFetch('https://tvchak204.com/index.php/vod/play/id/122862/sid/1/nid/1.html', 12000);
2658
+ const body = typeof fr.body === 'string' ? fr.body : '';
2659
+ const idx = body.indexOf('player_aaaa');
2660
+ const parsed = idx >= 0 ? parsePlayerAaaa(body) : null;
2661
+ out2.fetches.push({
2662
+ ok: fr.ok, status: fr.status, len: body.length,
2663
+ playerIdx: idx, parsedOk: !!parsed, hasUrl: !!(parsed && (parsed.url || parsed.url_next)),
2664
+ err: fr.error, ms: Date.now() - t1,
2665
+ });
2666
+ }
2667
  out = out2;
2668
  }
2669
  else if (p === '/api/diag/tvchak') {