New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSRF token expires #181
Comments
Is it able to delete any pages at all, or do you get this error in the middle of a long run? Could you try something like this:
If this helps, we could add this into mwclient. I've noticed that |
I usually got this error about 24 hours after it started. I've updated the code and observing its output. |
Yes it works! 👍 It once deleted a page successfully shortly after printing "Got badtoken, retrying". |
Good, thanks for testing! Did you notice if it was more or less 24 hours after the start? Not too surprisining if the tokens don't last forever, but I haven't been able to find documentation on it. In any case, it seems like token-refreshing when getting 'badtoken' is something that should be part of mwclient itself, just need to find the best place in the code to handle it (there is already a special handling in the |
It's about 18 hours this time. (Maybe shorter. I'm not quite sure about it.) |
I have met a problem with the delete method for page object. Here's the code.
It prints error information like this:
Sysop flag has already been granted to the bot account. Could anyone tell me what's the problem? Thank you!
The text was updated successfully, but these errors were encountered: