User Tools

Site Tools


patron_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
patron_tips [2026/03/10 16:22] – ↷ Page name changed from other to patron_tips winwinnerpatron_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:
 <code> <code>
 __NEXT_DATA__.props.pageProps.bootstrapEnvelope.pageBootstrap.campaign.data.relationships.creator.data.id __NEXT_DATA__.props.pageProps.bootstrapEnvelope.pageBootstrap.campaign.data.relationships.creator.data.id
 +</code>
 +
 +
 +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't store any of the data in the window for us to get easily.
 +<code>
 +(function extractUserIdFromDOM() {
 +  let userId = null;
 +  // 1. Grab every script tag currently on the page
 +  const scripts = document.querySelectorAll('script');
 +
 +  for (const script of scripts) {
 +    const text = script.textContent;
 +
 +    // 2. Filter only the ones pushing data to Next.js
 +    if (!text || !text.includes('__next_f.push')) continue;
 +
 +    // 3. The data inside the script tag is heavily escaped (e.g., \"creator\").
 +    // We replace the escaped quotes so it reads like standard JSON.
 +    const cleanText = text.replace(/\\"/g, '"');
 +
 +    // 4. Search for your specific pattern
 +    const match = cleanText.match(/"creator"\s*:\s*\{\s*"data"\s*:\s*\{\s*"id"\s*:\s*"?([^,"\}]+)"?/);
 +
 +    if (match && match[1]) {
 +      userId = match[1];
 +      break; // Stop searching once we have a hit
 +    }
 +  }
 +
 +  if (userId) {
 +    console.log("✅ Found User ID:", userId);
 +    return userId;
 +  } else {
 +    console.log("❌ User ID not found in the script tags.");
 +    return null;
 +  }
 +})();
 </code> </code>
  
patron_tips.1773159755.txt.gz · Last modified: by winwinner

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki