리뷰 피드백 반영: rules.json 추가, v3.2 URL/timeMachinePlayback 대응

- rules.json: 빈 배열로 추가. manifest 의 declarative_net_request 가
  참조하는 파일이 없어 확장 로드 자체가 실패하던 문제 해결.
- timemachine.js: live-detail URL 정규식이 `service/v3.2/...` 같은
  마이너 버전 경로를 매칭하도록 `v\d+` → `v[\d.]+` 로 수정. 실제 치지직
  공개 API 는 v3.2 를 사용 중 (참고: jaesung9507/nvver chzzk/live.go).
- timemachine.js: live-detail 응답 필드는 `timeMachine` 이 아니라
  `timeMachineActive` 와 `timeMachinePlayback` 두 개. 둘 다 true 로
  세팅해야 플레이어가 되감기 UI 를 띄운다. alreadyOn 판정도 두 플래그
  AND 로 변경.
- PLAYBACK_JSON_VERSIONS 에 v3.2, v3.1 추가.
This commit is contained in:
Claude (chzzk-bypass owner)
2026-05-28 01:33:50 +09:00
parent 2c6a345219
commit 7d4c994712
2 changed files with 12 additions and 5 deletions

View File

@@ -19,10 +19,11 @@
'use strict';
const TAG = '[chzzk-bypass:timemachine]';
const LIVE_DETAIL_RE = /^https:\/\/api\.chzzk\.naver\.com\/service\/v\d+\/channels\/([^\/?#]+)\/live-detail/;
// 치지직은 `service/v3.2/...` 처럼 minor 가 붙은 버전을 쓴다. 점(.) 포함 허용.
const LIVE_DETAIL_RE = /^https:\/\/api\.chzzk\.naver\.com\/service\/v[\d.]+\/channels\/([^\/?#]+)\/live-detail/;
// 일부 빌드에서는 v3, 어떤 시점에는 v2/v1 만 응답하므로 순차 시도한다.
const PLAYBACK_JSON_VERSIONS = ['v3', 'v2', 'v1'];
// 시점/빌드별로 다른 버전이 응답하므로 순차 시도한다.
const PLAYBACK_JSON_VERSIONS = ['v3.2', 'v3.1', 'v3', 'v2', 'v1'];
function log() {
try {
@@ -78,7 +79,12 @@
const content = data && data.content;
if (!content) return response;
const alreadyOn = content.timeMachineActive === true || content.timeMachine === true;
// 치지직 live-detail 응답에는 두 개의 별개 플래그가 존재한다.
// - timeMachineActive : 채널/방송 단위 타임머신 활성 여부
// - timeMachinePlayback : 플레이어가 실제 되감기 UI 를 켤지 결정하는 플래그
// 둘 중 어느 하나라도 false 면 UI 가 안 뜨므로 둘 다 true 로 만든다.
// (참고: github.com/jaesung9507/nvver chzzk/live.go LiveDetail 구조체)
const alreadyOn = content.timeMachineActive === true && content.timeMachinePlayback === true;
const channelId = (content.channel && content.channel.channelId) || channelIdFromUrl;
if (alreadyOn) {
@@ -88,7 +94,7 @@
log('forcing timeMachine ON for', channelId);
content.timeMachineActive = true;
content.timeMachine = true;
content.timeMachinePlayback = true;
// DVR 매니페스트로 교체 시도. 실패해도 플래그는 살려서 UI 만이라도 노출.
if (channelId) {