tiger2005's blog

By tiger2005, history, 3 years ago, In English

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.

  • Vote: I like it
  • +126
  • Vote: I do not like it

»
3 years ago, # |
Rev. 2   Vote: I like it +26 Vote: I do not like it

The redirection is closed.

»
4 months ago, # |
  Vote: I like it +7 Vote: I do not like it

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

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I see, I've tried a few forks already, such as https://github.com/woshiluo/cf-tool that seems to have added RCPC support and is 8 commits ahead, but it fails on my mac with the same error. Wondering if anyone else has a working macOS set up, in which case I would search more.