Блог пользователя tiger2005

Автор tiger2005, история, 3 года назад, По-английски

Is Codeforces' page redirection temporary?

It does is a way to get rid of web crawlers, but it makes CF Tool unusable. If you try to do any operation in CF Tool, you can only get "Not logged in" and "cannot find csrf" message. Same things happens on "Codeforces Contest Helper" developed by myself, so I can explain why.

CF Tool fetches the website page before each operation, so that it can know if you are logged out by searching for your username in the element ".lang-chooser" (Look at the upper right corner of this page and you'll know why). Also, Codeforces uses csrf-token to verify if you are a humen. These tokens are generated randomly when you open a new Codeforces page, and they're attached to verify every request on this page. CF Tool also needs this token for further operations, so it will get the token from the website page by regex.

If you are lucky to copy the redirect page source, you can see that there is no ".lang-chooser" and "Csrf-Token" any more. Thus, CF Tool thought that you are not logged in, but when it tried to get csrf-token to log in, it cannot get csrf-token and eventually fail.

I thought that projects like CF Tool can more or less solve the problems about slow Internet. I'm from China, and I can tell that most of Chinese CP lovers need to wait for a long time if they want to check out the standing lists, view problems and submit solutions. As a way to avoid loading unnecessary resources (just like css file, js file, font file, etc.), CF Tool really helps us.

So, back to the main question, I really want to know when the page redirection can be closed. As a coder, I hopes to get lower penalties by CF Tool. As a developer, I need to test new features I've made.

  • Проголосовать: нравится
  • +126
  • Проголосовать: не нравится

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +26 Проголосовать: не нравится

The redirection is closed.

»
3 месяца назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

Has redirection been added again? I'm getting cannot find csrf error again on macOS.

  • »
    »
    3 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    The error is mainly based on CodeForces network authorizing system. Official cf-tool cannot handle this issue, and you can find forks that solve this issue, which should work on your machine.