{"record":{"id":"7c7dbd7a24b834ec","repo":"DIYgod/RSSHub","slug":"no-articles-found-for-this-channel-please-make-su","errorCode":null,"errorMessage":"No articles found for this channel. Please make sure the channel ID is correct and that the channel contains articles.","messagePattern":"No articles found for this channel\\. Please make sure the channel ID is correct and that the channel contains articles\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"lib/routes/ganjingworld/channel/articles.ts","lineNumber":45,"sourceCode":"            target: '/channel/articles/:id',\n        },\n    ],\n    url: 'www.ganjingworld.com',\n    name: 'Articles 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=articles`;\n    const apiUrl = `https://gw.ganjingworld.com/v1.1/content/get-by-channel?channel_id=${id}&content_type=News`;\n    // const apiUrl = `https://gw.ganjingworld.com/v1.1/content/get-by-channel?channel_id=1fcahpcut9t3gz4zIvYSJR7qd1cs0c&content_type=News`;\n\n    const parsed: ApiResponse = await ofetch<ApiResponse>(apiUrl);\n    if (parsed.data.list.length === 0) {\n        throw new Error('No articles found for this channel. Please make sure the channel ID is correct and that the channel contains articles.');\n    }\n    const title = parsed.data.list[0].channel.name;\n    const items = await Promise.all(\n        parsed.data.list.map((item) =>\n            cache.tryGet(item.id, async () => {\n                const pubDate = new Date(item.time_scheduled);\n                const fetchArticleUrl = `https://gw.ganjingworld.com/v1.1/content/query?lang=zh-TW&query=basic%2Cfull%2Ctranslations%2Clike%2Cshare%2Csave%2Cview%2Ctag_list&ids=${item.id}`;\n                const parsedArticle: ApiResponse = await ofetch<ApiResponse>(fetchArticleUrl);\n\n                const description = parsedArticle.data.list[0]?.text ?? '';\n\n                return {\n                    title: item.title,\n                    link: `https://www.ganjingworld.com/news/${item.id}`,\n                    pubDate,\n                    description,\n                };\n            })","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/ganjingworld/channel/articles.ts#L27-L63","documentation":"The Ganjing World articles route calls the v1.1 content API filtered by content_type=News for a given channel id. If the returned data.list is empty, the channel either does not exist, is not a news channel, or has zero articles, so the route throws a descriptive error instead of returning an empty feed (which RSSHub's internal checks would also flag).","triggerScenarios":"Passing a channel id that exists but publishes only posts/shorts (not News), a channel id that does not exist at all (API returns 200 with empty list), or a channel whose articles are all in a non-public visibility state.","commonSituations":"Confusing channel types (a video-only channel queried for articles); copying a user id instead of a channel id; the channel being new with no articles yet.","solutions":["Open https://www.ganjingworld.com/channel/{id}?tab=articles in a browser and confirm articles are listed there.","Verify the id is a channel id and not a user/owner id.","If the channel intentionally has no articles, point the user at the /posts or /shorts route instead."],"exampleFix":"// before\nif (parsed.data.list.length === 0) {\n    throw new Error('No articles found for this channel. ...');\n}\n\n// after\nif (parsed.data.list.length === 0) {\n    throw new InvalidParameterError(`Channel \"${id}\" has no articles. Verify the channel ID and its content type (try the posts or shorts route).`);\n}","handlingStrategy":"validation","validationCode":"// pre-flight: confirm the channel exists and has a News tab\nconst probe = await ofetch(`https://gw.ganjingworld.com/v1.1/content/get-by-channel?channel_id=${id}&content_type=News&page_size=1`);\nif (probe.data.list.length === 0) {\n  throw new InvalidParameterError(`Channel ${id} has no articles`);\n}","typeGuard":"const hasArticles = (res: ApiResponse): boolean => res.data.list.length > 0;","tryCatchPattern":null,"preventionTips":["Confirm the channel id by opening the articles tab in a browser.\nDistinguish channel id from user/owner id.\nDirect users to posts/shorts routes when a channel has no News."],"tags":["api","validation","empty-result"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}