Skip to content

fix(CHZZK): read stream info from api instead of hashed dom classes#10978

Open
lcmykr wants to merge 1 commit into
PreMiD:mainfrom
lcmykr:fix-chzzk-detection
Open

fix(CHZZK): read stream info from api instead of hashed dom classes#10978
lcmykr wants to merge 1 commit into
PreMiD:mainfrom
lcmykr:fix-chzzk-detection

Conversation

@lcmykr

@lcmykr lcmykr commented Jul 8, 2026

Copy link
Copy Markdown

Description

CHZZK switched its build to fully hashed CSS module class names (e.g. _title_1aj24_25) that change on every deploy. The existing video_information_* selectors all return null, and because the streamer-logo lookup used a non-null assertion (querySelector(...)!.src), the whole UpdateData handler throws — so nothing shows up at all, on both live and video pages.

Instead of chasing the class names again (this has already been patched twice: #9025, #10219), this reads the stream metadata from CHZZK's public API, which is stable across deploys:

  • live: https://api.chzzk.naver.com/service/v3/channels/{channelId}/live-detail
  • video: https://api.chzzk.naver.com/service/v3/videos/{videoNo}

From there it uses the live/video title, channel name, channel image and openDate. The <video> element (stable player class, not a hashed module class) is still used for VOD progress and the paused state. Responses are cached per id with an in-flight guard so UpdateData doesn't refetch on every tick.

Two things worth calling out:

  • The requests go to api.chzzk.naver.com, which is the activity website's own API, and use the Fetch API only.
  • kstToUnix is a small custom helper: CHZZK returns openDate as an absolute wall-clock time in KST ("YYYY-MM-DD HH:mm:ss"), and none of the built-in timestamp helpers convert an absolute date to a unix timestamp, so it parses it in a timezone-independent way for the elapsed-time counter.

Acknowledgements

Screenshots

Proof showing the modification is working as expected premid-1 premid-2 premid-3

CHZZK now ships fully hashed css module class names like _title_1aj24_25
that change on every deploy, so the old video_information_* selectors all
return null and the presence throws instead of showing anything.

Pull the live/video title, channel name, image and open date from the
public api (api.chzzk.naver.com) and keep the <video> element only for
vod progress and paused state, which no longer depends on class names.
@dimerp

dimerp Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🖼️ Activity asset preview

I rummaged through the diff and found these. Finders keepers? No? Fine, they're yours.

CHZZK (websites/C/CHZZK) — update

Preview Source URL
logo https://cdn.rcd.gg/PreMiD/websites/C/CHZZK/assets/logo.png
thumbnail https://cdn.rcd.gg/PreMiD/websites/C/CHZZK/assets/thumbnail.png

Beep boop — I refresh this comment on every push, so no need to scroll. 🤖

@lcmykr lcmykr marked this pull request as ready for review July 8, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant