Skip to content

fix: use /c/ prefix in campaign page URL for userId-style vanities#144

Open
dantr4n wants to merge 1 commit into
patrickkfkan:masterfrom
dantr4n:fix/userid-vanity-campaign-page-url
Open

fix: use /c/ prefix in campaign page URL for userId-style vanities#144
dantr4n wants to merge 1 commit into
patrickkfkan:masterfrom
dantr4n:fix/userid-vanity-campaign-page-url

Conversation

@dantr4n

@dantr4n dantr4n commented Jun 11, 2026

Copy link
Copy Markdown

Fixes #143

Problem

Downloading posts from a creator without a custom vanity name fails:

patreon-dl https://www.patreon.com/c/u58344051/posts
...
error: PostsFetcher: Error parsing initial data from "https://www.patreon.com/u58344051": Initial data not found - no regex matches

analyzeURL() extracts u58344051 as the vanity from the /c/-prefixed URL, but constructCampaignPageURL() rebuilds the page URL without the /c/ prefix. For u{userId}-style placeholder vanities, the bare patreon.com/u{userId} path is the user profile page rather than the creator page, so PageParser.parseInitialData() finds none of its expected patterns.

Fix

In constructCampaignPageURL(), keep the /c/ prefix when the vanity matches the u{digits} pattern Patreon uses for creators who never set a custom vanity.

Verification

Ran the failing command against the patched build:

info: PostsFetcher: Fetch posts
info: PostsFetcher: Fetched posts: 20 / 199
info: PostDownloader: Save campaign info #7110673

Campaign ID resolves and posts fetch and download normally. Creators with regular custom vanities are unaffected (/^u\d+$/ does not match them).

🤖 Generated with Claude Code

For creators without a custom vanity name, Patreon serves their page at
/c/u{userId}. analyzeURL() extracts u{userId} as the vanity from such
URLs, but constructCampaignPageURL() rebuilt the page URL without the
/c/ prefix, landing on the user profile page instead of the creator
page. Initial data parsing then failed with "Initial data not found -
no regex matches".

Fixes patrickkfkan#143

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initial data not found (no regex matches) for creators without a custom vanity (/c/u{userId}/posts URLs)

2 participants