patron_tips
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| patron_tips [2026/03/10 16:22] – ↷ Page name changed from other to patron_tips winwinner | patron_tips [2026/03/15 22:13] (current) – winwinner | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Open the console and put this which should return the numeric value to use with sites that archive patron such as kemono (tld/domain changes semi-frequently): | Open the console and put this which should return the numeric value to use with sites that archive patron such as kemono (tld/domain changes semi-frequently): | ||
| + | |||
| + | for non /cw/ patreon accounts you can use: | ||
| < | < | ||
| __NEXT_DATA__.props.pageProps.bootstrapEnvelope.pageBootstrap.campaign.data.relationships.creator.data.id | __NEXT_DATA__.props.pageProps.bootstrapEnvelope.pageBootstrap.campaign.data.relationships.creator.data.id | ||
| + | </ | ||
| + | |||
| + | |||
| + | but with /cw/ patreon accounts you have to parse the script tags to get the value since the nextjs architecture is changed away from %%__NEXT_DATA__%% to using %%self.__next_f.push%% where the .push function on the %%self.__next_f%% is overwritten and doesn' | ||
| + | < | ||
| + | (function extractUserIdFromDOM() { | ||
| + | let userId = null; | ||
| + | // 1. Grab every script tag currently on the page | ||
| + | const scripts = document.querySelectorAll(' | ||
| + | |||
| + | for (const script of scripts) { | ||
| + | const text = script.textContent; | ||
| + | |||
| + | // 2. Filter only the ones pushing data to Next.js | ||
| + | if (!text || !text.includes(' | ||
| + | |||
| + | // 3. The data inside the script tag is heavily escaped (e.g., \" | ||
| + | // We replace the escaped quotes so it reads like standard JSON. | ||
| + | const cleanText = text.replace(/ | ||
| + | |||
| + | // 4. Search for your specific pattern | ||
| + | const match = cleanText.match(/" | ||
| + | |||
| + | if (match && match[1]) { | ||
| + | userId = match[1]; | ||
| + | break; // Stop searching once we have a hit | ||
| + | } | ||
| + | } | ||
| + | |||
| + | if (userId) { | ||
| + | console.log(" | ||
| + | return userId; | ||
| + | } else { | ||
| + | console.log(" | ||
| + | return null; | ||
| + | } | ||
| + | })(); | ||
| </ | </ | ||
patron_tips.1773159755.txt.gz · Last modified: by winwinner