fix(xiaoyuzhou): migrate from broken SSR scraping to authenticated API (fixes #1023)#1059
Merged
jackwener merged 3 commits intojackwener:mainfrom Apr 16, 2026
Merged
Conversation
fixes jackwener#1023) Xiaoyuzhou removed SSR rendering — /podcast/<id> and /episode/<id> pages now return 404, breaking fetchPageProps() which scraped __NEXT_DATA__. Migrate podcast, podcast-episodes, episode, and download commands to use the existing authenticated API client (requestXiaoyuzhouJson) that transcript.js already uses successfully. Changes: - podcast.js: use /v1/podcast/get API endpoint - podcast-episodes.js: use /v1/podcast/listEpisode API endpoint - episode.js: use /v1/episode/get API endpoint - download.js: use /v1/episode/get API endpoint - utils.js: remove unused fetchPageProps, keep format helpers - Update all affected tests (download.test.js, utils.test.js) - Change strategy from PUBLIC to LOCAL (requires credentials)
jackwener
added a commit
that referenced
this pull request
Apr 17, 2026
PR #1059 migrated xiaoyuzhou from SSR scraping to authenticated API. The E2E tests run without credentials, producing exit code 78 (CONFIG_ERROR). The existing `isExpectedChineseSiteRestriction` guard only caught FETCH_ERROR, PARSE_ERROR, and NOT_FOUND — not config errors from missing auth credentials.
2 tasks
jackwener
added a commit
that referenced
this pull request
Apr 17, 2026
PR #1059 migrated xiaoyuzhou from SSR scraping to authenticated API. The E2E tests run without credentials, producing exit code 78 (CONFIG_ERROR). The existing `isExpectedChineseSiteRestriction` guard only caught FETCH_ERROR, PARSE_ERROR, and NOT_FOUND — not config errors from missing auth credentials.
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.
Summary
Fixes #1023 — Xiaoyuzhou
podcast,podcast-episodes,episode, anddownloadcommands all return 404 errors.Root Cause
Xiaoyuzhou (小宇宙) switched their website from Next.js SSR to a static export (SSG). The
/podcast/<id>and/episode/<id>pages now return HTTP 404, which brokefetchPageProps()inutils.jsthat relied on scraping<script id="__NEXT_DATA__">from server-rendered HTML.Fix
Migrated all four affected commands from HTML scraping (
fetchPageProps) to the authenticated REST API (requestXiaoyuzhouJson) that already exists inauth.jsand is used successfully bytranscript.js.podcastGET /v1/podcast/get?pid=<id>podcast-episodesPOST /v1/podcast/listEpisodeepisodeGET /v1/episode/get?eid=<id>downloadGET /v1/episode/get?eid=<id>Other changes:
PUBLICtoLOCAL(requires~/.opencli/xiaoyuzhou.jsoncredentials)fetchPageProps()fromutils.js(no longer used)download.test.js(mocks migrated),utils.test.js(removed fetchPageProps tests)podcast-episodes: removed "(up to 15, SSR limit)" description, default limit changed from 15 to 20Testing