Skip to content

获取小说内容随机失败? #408

Description

@assassingyk

Extract novel content error: 'NoneType' object has no attribute 'groups'

if not match or len(match.groups()) < 1:

写了个简单的脚本用来定期批量保存我关注的作者作品,但是存小说时偶尔会出现如上报错,而且一旦出现就是同一个作者的全部作品都失败。我设置了3次延时后retry,都会稳定出这个报错,感觉应该不是随机的网络波动问题。但比较怪的是我事后手动单独重试下载出问题的novel id的时候又经常是能正常下载的,无法找到会稳定复现的小说id……

Activity

  1. Xdynix commented on May 22, 2025

    @Xdynix
    Collaborator

    无端猜测有可能是请求频率太高触发了速率限制,那段时间返回的都是错误结果。可以考虑在请求之间加一些几秒的暂停。

  2. assassingyk commented on May 22, 2025

    @assassingyk
    Author

    应该不是,或者说至少不是普通的Rate Limit错误,我代码里加了判断发现返回的error是Rate Limit的话会自动暂停3分钟。而且这个报错很明显在发生时只限定于当前某一个作者的作品,轮到下一个作者时就又全都正常了……

    以这个报错位置看的话应该是对webview/v2/novel的请求返回了一些东西,但是里面不包含novel:\s({.+}),\s+isOwnWork的部分……我回头改下源码出错时print一下内容试试……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions