{"record":{"id":"6dd281d89db117a6","repo":"DIYgod/RSSHub","slug":"no-posts-found-for-this-channel-please-make-sure","errorCode":null,"errorMessage":"No posts found for this channel. Please make sure the channel ID is correct and that the channel contains posts.","messagePattern":"No posts found for this channel\\. Please make sure the channel ID is correct and that the channel contains posts\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/ganjingworld/channel/posts.ts","lineNumber":44,"sourceCode":"            target: '/channel/posts/:id',\n        },\n    ],\n    url: 'www.ganjingworld.com',\n    name: 'posts in a channel',\n    maintainers: ['yixiangli2001'],\n\n    handler,\n};\n\nasync function handler(ctx) {\n    const id = ctx.req.param('id');\n    const url = `https://www.ganjingworld.com/channel/${id}?tab=posts`;\n    const apiUrl = `https://gw.ganjingworld.com/v1.0c/social-content/get-owner-posts?owner_id=${id}&start_key=&page_size=48&post_image=true&query=basic,post,owner,comment,view,like,is_liked,share `;\n    // const apiUrl = `https://gw.ganjingworld.com/v1.0c/social-content/get-owner-posts?owner_id=1fcahpcut9t3gz4zIvYSJR7qd1cs0c&start_key=&page_size=48&post_image=true&query=basic,post,owner,comment,view,like,is_liked,share%20Request%20Method `;\n\n    const parsed: ApiResponse = await ofetch<ApiResponse>(apiUrl);\n    if (parsed.data.list.length === 0) {\n        throw new Error('No posts found for this channel. Please make sure the channel ID is correct and that the channel contains posts.');\n    }\n    const title = parsed.data.list[0].channel.name;\n    const items = parsed.data.list.map((item) => {\n        const pubDate = new Date(item.time_scheduled);\n\n        const raw = item.text?.replaceAll('\\n', '<br>') || '';\n        const textWithMedia = item.media?.length > 0 ? raw + `<figure><img src=\"${item.media[0].url}\"></figure>` : raw;\n        return {\n            title: item.title,\n            link: `https://www.ganjingworld.com/news/${item.id}`,\n            pubDate,\n            description: textWithMedia,\n        };\n    });\n\n    return {\n        title,\n        link: url,","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/ganjingworld/channel/posts.ts#L26-L62","documentation":"The Ganjing World posts route calls the v1.0c social-content API for a channel/owner id. If data.list is empty, it throws. Note the apiUrl query string has a stray trailing space inside the template literal, which can corrupt the query and contribute to empty results.","triggerScenarios":"Passing an id with no posts, an id that is a channel id rather than an owner id (the API param is owner_id), or the trailing space in the query string causing the server to misparse parameters and return an empty list.","commonSituations":"Channel-vs-owner id confusion; brand-new channels with no posts; the stray trailing space bug intermittently breaking the request.","solutions":["Remove the trailing space in the apiUrl query string (it sits after 'share' inside the backticks).","Confirm the id is an owner_id accepted by the social-content endpoint.","Open the channel's posts tab in a browser to confirm posts exist.","If the channel only has articles/shorts, use the corresponding route."],"exampleFix":"// before\nconst apiUrl = `https://gw.ganjingworld.com/v1.0c/social-content/get-owner-posts?owner_id=${id}&start_key=&page_size=48&post_image=true&query=basic,post,owner,comment,view,like,is_liked,share `;\n\n// after\nconst apiUrl = `https://gw.ganjingworld.com/v1.0c/social-content/get-owner-posts?owner_id=${id}&start_key=&page_size=48&post_image=true&query=basic,post,owner,comment,view,like,is_liked,share`;","handlingStrategy":"validation","validationCode":"// fix the trailing-space bug AND validate\nconst apiUrl = `https://gw.ganjingworld.com/v1.0c/social-content/get-owner-posts?owner_id=${encodeURIComponent(id)}&start_key=&page_size=48&post_image=true&query=basic,post,owner,comment,view,like,is_liked,share`;\nif (!id.trim()) throw new InvalidParameterError('id is required');","typeGuard":"const hasPosts = (res: ApiResponse): boolean => res.data.list.length > 0;","tryCatchPattern":null,"preventionTips":["Remove the stray trailing space in the query string.\nConfirm owner_id vs channel_id semantics.\nURL-encode the id."],"tags":["api","bug","validation","empty-result"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}