fix(CHZZK): read stream info from api instead of hashed dom classes#10978
Open
lcmykr wants to merge 1 commit into
Open
fix(CHZZK): read stream info from api instead of hashed dom classes#10978lcmykr wants to merge 1 commit into
lcmykr wants to merge 1 commit into
Conversation
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.
Contributor
🖼️ Activity asset previewI rummaged through the diff and found these. Finders keepers? No? Fine, they're yours. CHZZK (
|
| 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. 🤖
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
CHZZK switched its build to fully hashed CSS module class names (e.g.
_title_1aj24_25) that change on every deploy. The existingvideo_information_*selectors all returnnull, and because the streamer-logo lookup used a non-null assertion (querySelector(...)!.src), the wholeUpdateDatahandler 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:
https://api.chzzk.naver.com/service/v3/channels/{channelId}/live-detailhttps://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 soUpdateDatadoesn't refetch on every tick.Two things worth calling out:
api.chzzk.naver.com, which is the activity website's own API, and use the Fetch API only.kstToUnixis a small custom helper: CHZZK returnsopenDateas 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
npm run lintScreenshots
Proof showing the modification is working as expected