{"record":{"id":"fa87b6d3369647cc","repo":"DIYgod/RSSHub","slug":"unable-to-resolve-the-locals-community-metadata","errorCode":null,"errorMessage":"Unable to resolve the Locals community metadata.","messagePattern":"Unable to resolve the Locals community metadata\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/locals/feed.ts","lineNumber":232,"sourceCode":"    };\n\n    sandbox.self.$R = sandbox.$R;\n\n    vm.createContext(sandbox);\n    vm.runInContext(body, sandbox, { timeout: 5000 });\n\n    const value = sandbox.self.$R?.[instanceId]?.[0] as T | undefined;\n    if (!value) {\n        throw new Error('Unable to decode the Locals server response.');\n    }\n\n    return value;\n}\n\nfunction extractCommunityInfo(html: string, community: string) {\n    const markerIndex = html.indexOf(`hashtag:\"${community}\"`);\n    if (markerIndex === -1) {\n        throw new Error('Unable to resolve the Locals community metadata.');\n    }\n\n    const context = html.slice(Math.max(0, markerIndex - 200), markerIndex + 1200);\n    const idMatch = context.match(/id:(\\d+)/);\n    const titleMatch = context.match(/title:\"([^\"]+)\"/);\n    const descriptionMatch = context.match(/description:\"([^\"]*)\"/);\n    const imageMatch = context.match(/image:\\$R\\[\\d+\\]=\\{big:\"([^\"]*)\",thumb:\"([^\"]*)\"/);\n\n    if (!idMatch || !titleMatch) {\n        throw new Error('Unable to resolve the Locals community metadata.');\n    }\n\n    return {\n        description: descriptionMatch?.[1],\n        design: {\n            image: {\n                big: imageMatch?.[1],\n                thumb: imageMatch?.[2],","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/locals/feed.ts#L214-L250","documentation":"Thrown by `extractCommunityInfo` when the literal marker `hashtag:\"<community>\"` is not found anywhere in the Locals content-page HTML (lib/routes/locals/feed.ts:230). The marker is the anchor from which community id, title, description, and image are regex-extracted. Its absence means the community slug is unknown to Locals, or the page no longer embeds that inline metadata.","triggerScenarios":"Requesting `/locals/<community>/...` for a community that does not exist or was renamed; Locals changes its inline JSON-in-HTML bootstrap format and drops the `hashtag:\"...\"` literal; the content page returned a login/age-gate/captcha interstitial instead of community HTML.","commonSituations":"Misspelled community slug; community deleted or migrated; unauthenticated request hitting a gate because `config.locals.session` is invalid or expired.","solutions":["Verify the community slug by opening `https://locals.com/<community>/feed?mode=content` in a browser.","Confirm `config.locals.session` is a valid, non-expired session cookie so the real content page (not a gate) is returned.","Clear `locals:content-page:<community>` cache and retry to fetch a fresh page.","If Locals changed the bootstrap format, update the marker string in `extractCommunityInfo`."],"exampleFix":"// before\nconst markerIndex = html.indexOf(`hashtag:\"${community}\"`);\n// after: also accept the new JSON bootstrap shape\nconst markerIndex = html.indexOf(`hashtag:\"${community}\"`) !== -1\n    ? html.indexOf(`hashtag:\"${community}\"`)\n    : html.indexOf(`\"community\":\"${community}\"`);","handlingStrategy":"validation","validationCode":"function communityMarkerPresent(html: string, community: string): boolean {\n    return html.includes(`hashtag:\"${community}\"`);\n}\n// after fetching the content page:\nif (!communityMarkerPresent(html, community)) {\n    throw new TypeError(`Community '${community}' not found on Locals`);\n}","typeGuard":"function hasCommunityMarker(html: string, community: string): boolean {\n    return html.indexOf(`hashtag:\"${community}\"`) !== -1;\n}","tryCatchPattern":"try {\n    return await extractCommunityInfo(html, community);\n} catch (e) {\n    if (e instanceof Error && /Unable to resolve the Locals community metadata/.test(e.message) && !html.includes(`hashtag:\"${community}\"`)) {\n        throw new TypeError(`Locals community '${community}' does not exist`);\n    }\n    throw e;\n}","preventionTips":["Validate the community slug format before requesting.","Keep the session cookie fresh so content pages are not gated.","Cache-bust per-community after a suspected upstream change."],"tags":["upstream-change","html-scraping","locals","session"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}