DIYgod/RSSHub · error · InvalidParameterError

不支持指定类型!

Error message

不支持指定类型!

What it means

Thrown by the DLsite new/current release route when the `type` path parameter does not match any key in the `infos` lookup object. Valid keys are: `home`, `comic`, `soft`, `maniax`, `books`, `pro`, `girls`, `bl`. Identical validation pattern to the campaign route but for the 'new releases' feed.

Source

Thrown at lib/routes/dlsite/new.ts:88

        antiCrawler: false,
        supportBT: false,
        supportPodcast: false,
        supportScihub: false,
        nsfw: true,
    },
    name: 'Current Release',
    maintainers: ['cssxsh'],
    handler,
    description: `| Doujin | Comics | PC Games | Doujin (R18) | Adult Comics | H Games | Otome | BL |
| ------ | ------ | -------- | ------------ | ------------ | ------- | ----- | -- |
| home   | comic  | soft     | maniax       | books        | pro     | girls | bl |`,
};

async function handler(ctx) {
    const info = infos[ctx.req.param('type')];
    // 判断参数是否合理
    if (info === undefined) {
        throw new InvalidParameterError('不支持指定类型!');
    }

    const link = info.url.slice(1);

    const response = await got(new URL(link, host), {
        method: 'GET',
    });
    const data = response.data;
    const $ = load(data);

    const title = $('title').text();
    const description = $('meta[name="description"]').attr('content');
    const list = $('.n_worklist_item');
    const dateText = $('.work_update')
        .text()
        .trim()
        .replaceAll(/(.*)/g, '');
    const pubDate = parseDate(dateText, 'YYYY年M月D日');

View on GitHub (pinned to bed535e087)

Solutions

  1. Refer to the route description table for valid values: home, comic, soft, maniax, books, pro, girls, bl.
  2. Ensure the parameter is lowercase.
  3. Confirm the route path: /dlsite/new/<type> (e.g. /dlsite/new/maniax).

Example fix

// before
const info = infos[ctx.req.param('type')];
if (info === undefined) {
    throw new InvalidParameterError('不支持指定类型!');
}

// after
if (info === undefined) {
    throw new InvalidParameterError(`Unsupported type '${ctx.req.param('type')}'. Valid: ${Object.keys(infos).join(', ')}`);
}
Defensive patterns

Strategy: validation

Validate before calling

const validTypes = ['home', 'comic', 'soft', 'maniax', 'books', 'pro', 'girls', 'bl'];
function isValidDlsiteNewType(type: string): boolean {
    return validTypes.includes(type.toLowerCase());
}

Type guard

function isDlsiteNewType(value: string): value is 'home' | 'comic' | 'soft' | 'maniax' | 'books' | 'pro' | 'girls' | 'bl' {
    return ['home', 'comic', 'soft', 'maniax', 'books', 'pro', 'girls', 'bl'].includes(value);
}

Try / catch

try {
    const feed = await fetch(`${rsshubUrl}/dlsite/new/${type}`);
} catch (e) {
    if (e.message.includes('不支持指定类型')) {
        console.error(`Invalid type '${type}'. Valid: home, comic, soft, maniax, books, pro, girls, bl`);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling /dlsite/new/<type> with a type not in the infos table; typos; case mismatch (keys are lowercase); using a deprecated or renamed category name.

Common situations: Developer refers to outdated docs listing different type names; user tries a category name from the DLsite UI that differs from the route's internal key.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/bc9989b6f6e53c37. Report an issue: GitHub.