DIYgod/RSSHub · error · Error

未获取到数据!

Error message

未获取到数据!

What it means

Generic Error ('No data retrieved!') thrown by the follow-list route when response.data.data.result is missing. The Miyoushe following API returned HTTP 200 but the expected 'result' array is absent — usually an auth or rate-limit envelope.

Source

Thrown at lib/routes/mihoyo/bbs/follow-list.ts:46

    const searchParams = {
        gids: 2,
        uid,
        page_size,
    };
    const link = `https://www.miyoushe.com/ys/accountCenter/followList?id=${uid}`;
    const url = 'https://bbs-api.miyoushe.com/user/wapi/following';
    const response = await got({
        method: 'get',
        url,
        searchParams,
        headers: {
            Origin: 'https://www.miyoushe.com',
            Referer: link,
        },
    });
    const list = response?.data?.data?.result;
    if (!list) {
        throw new Error('未获取到数据!');
    }
    const { nickname: username } = await cache.getUserFullInfo(ctx, uid);
    const title = `米游社 - ${username} 的关注`;
    const items = list.map((e) => {
        const title = e.user.nickname;
        const link = `https://www.miyoushe.com/ys/accountCenter/postList?id=${e.user.uid}`;
        const description = renderDescription(`${e.user.certification.label || ''}\n${e.user.introduce || ''}`.trim(), [e.user.avatar_url]);
        return {
            title,
            link,
            description,
        };
    });

    const data = {
        title,
        link,
        item: items,

View on GitHub (pinned to bed535e087)

Solutions

  1. Refresh MIHOYO_COOKIE with a fresh login.
  2. Confirm the uid has followings visible on miyoushe.com.
  3. Wait and retry if rate-limited.
  4. If the envelope changed, report to the route maintainer.

Example fix

// before
MIHOYO_COOKIE=expired

// after
MIHOYO_COOKIE=account_id=...; cookie_token=...fresh...
Defensive patterns

Strategy: retry

Validate before calling

if (!config.mihoyo.cookie) throw new ConfigNotFoundError('MIHOYO_COOKIE missing for follow-list');

Type guard

function hasFollowResult(res: any): boolean {
    return Array.isArray(res?.data?.data?.result);
}

Try / catch

try {
    const list = response?.data?.data?.result;
    if (!list) throw new Error('No data from Miyoushe');
} catch (e) { /* refresh cookie / retry */ throw e; }

Prevention

When it happens

Trigger: got(following) resolves, but response.data.data.result is falsy. Typically: invalid cookie returns an unauthenticated envelope; uid has zero followings in an edge format; upstream API shape changed; rate limit returns an error envelope.

Common situations: Expired/invalid MIHOYO_COOKIE; uid is private or has no followings; Miyoushe rate-limited the IP; API envelope changed after a site update.

Related errors


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