{"record":{"id":"02a804cb7f700a9a","repo":"DIYgod/RSSHub","slug":"no-shorts-found-for-this-channel-please-make-sure","errorCode":null,"errorMessage":"No shorts found for this channel. Please make sure the channel ID is correct and that the channel contains shorts.","messagePattern":"No shorts found for this channel\\. Please make sure the channel ID is correct and that the channel contains shorts\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"lib/routes/ganjingworld/channel/shorts.ts","lineNumber":41,"sourceCode":"        {\n            source: ['ganjingworld.com'],\n            target: '/channel/shorts/:id',\n        },\n    ],\n    url: 'www.ganjingworld.com',\n    name: 'Shorts in a channel',\n    maintainers: ['yixiangli2001'],\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=shorts`;\n    const apiUrl = `https://gw.ganjingworld.com/v1.1/content/get-by-channel?channel_id=${id}&content_type=Shorts&page_size=30&query=basic%2Cwatch_count&visibility=public&mode=ready`;\n\n    const parsed: ApiResponse = await ofetch<ApiResponse>(apiUrl);\n    if (parsed.data.list.length === 0) {\n        throw new Error('No shorts found for this channel. Please make sure the channel ID is correct and that the channel contains shorts.');\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        const videoUrl = item.video_url || (item.media.length > 0 ? item.media[0].url : '');\n        const posterUrl = item.poster_url || item.image_auto_url || '';\n\n        let description = item.description || '';\n        if (videoUrl) {\n            description = `<video controls src=\"${videoUrl}\" poster=\"${posterUrl}\" style=\"max-width: 100%;\"></video><br/>${description}`;\n        }\n\n        return {\n            title: item.title,\n            link: `https://www.ganjingworld.com/video/${item.id}`,\n            pubDate,\n            description,\n        };","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/ganjingworld/channel/shorts.ts#L23-L59","documentation":"The Ganjing World shorts route queries the v1.1 content API with content_type=Shorts. If data.list is empty, the channel has no shorts (or is wrong/non-existent), and the route throws rather than emit an empty feed.","triggerScenarios":"Querying a channel that only produces News articles or text posts (no Shorts), a non-existent channel id, or a channel whose shorts are not in visibility=public / mode=ready.","commonSituations":"Using an articles-only channel id for shorts; copying a user id instead of a channel id; all shorts being in draft/non-ready mode.","solutions":["Open https://www.ganjingworld.com/channel/{id}?tab=shorts in a browser to confirm shorts exist.","Verify the id is a channel id (content API uses channel_id).","Point the user at the articles or posts route if the channel has no shorts."],"exampleFix":"// before\nif (parsed.data.list.length === 0) {\n    throw new Error('No shorts found for this channel. ...');\n}\n\n// after\nif (parsed.data.list.length === 0) {\n    throw new InvalidParameterError(`Channel \"${id}\" has no shorts. Verify the channel ID and try the articles or posts route.`);\n}","handlingStrategy":"validation","validationCode":"const probe = await ofetch(`https://gw.ganjingworld.com/v1.1/content/get-by-channel?channel_id=${id}&content_type=Shorts&page_size=1`);\nif (probe.data.list.length === 0) {\n  throw new InvalidParameterError(`Channel ${id} has no shorts`);\n}","typeGuard":"const hasShorts = (res: ApiResponse): boolean => res.data.list.length > 0;","tryCatchPattern":null,"preventionTips":["Confirm the channel has a Shorts tab.\nUse the correct channel id.\nPoint users at articles/posts routes when no shorts exist."],"tags":["api","validation","empty-result"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}