Closed Saurav-Paul closed 4 years ago
Thank you for reporting! It seems that there is an update of Codeforces and this breaks our code. I'll fix soon.
Now the /enter
redirects to ?f0a28=1
with JavaScript. why?
$ curl 'https://codeforces.com/enter'
<html><body>Redirecting... Please, wait.<script type="text/javascript" src="/aes.min.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("e9ee4b03c1d0822987185d27bca23378"),b=toNumbers("188fafdbe0f87ef0fc2810d5b3e34705"),c=toNumbers("ebe0e82fefc615e78c3acba688bf16b1");document.cookie="RCPC="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";document.location.href="https://codeforces.com/enter?f0a28=1";</script></body></html>
I found blog posts about this https://codeforces.com/blog/entry/80065 https://codeforces.com/blog/entry/80070
related issue https://github.com/xalanq/cf-tool/issues/112
Yeah it seems like recent change. That's why this problem suddenly start appearing. Please let me know if you solve that issue.
I checked the blogs. Lot's of people facing the bug
This issue is difficult and I cannot fix immediately because this, the feature of RCPC tokens, is the feature to kill scraping scripts. Of course the main target is scripts with terrible manners, but affects almost all tools including online-judge-tools, cf-tool, etc.
(BTW, the bug of RCPC tokens doesn't affects us.)
If i could help you to solve this problem, it would awesome. But i don't have that great knowledge. Yeah it's really very difficult. I hope this problem will be solved.
RCPC token will not affect us that's awesome to hear.
I found this problem also breaks the feature to download sample cases.
Shit man, they makes it so complex... Now may be need to use oj login.... Today i will change my code and turn towards using webdriver.
It seems that Codeforces reverted the change. (I found this while trying to parse the <script>
and compute RCPC value)
(edit)
$ oj --version
[!] update available for online-judge-tools: 10.0.4 -> 10.0.5
[*] run: $ pip3 install -U online-judge-tools
[!] update available for online-judge-api-client: 10.2.1 -> 10.2.3
[*] run: $ pip3 install -U online-judge-api-client
online-judge-tools 10.0.4 (+ online-judge-api-client 10.2.1)
$ oj d https://codeforces.com/contest/1/problem/A
[!] update available for online-judge-tools: 10.0.4 -> 10.0.5
[*] run: $ pip3 install -U online-judge-tools
[!] update available for online-judge-api-client: 10.2.1 -> 10.2.3
[*] run: $ pip3 install -U online-judge-api-client
[*] online-judge-tools 10.0.4 (+ online-judge-api-client 10.2.1)
[x] clear the downloading history for this directory: /home/ryo/.cache/online-judge-tools/download-history.jsonl
[x] append the downloading history: /home/ryo/.cache/online-judge-tools/download-history.jsonl
[*] sample 0
[x] input: sample-1
6 6 4
[+] saved to: test/sample-1.in
[x] output: sample-1
4
[+] saved to: test/sample-1.out
Description
A few user from my project ai-virtual-assistant inform me they tried to login into codeforces that is not working. Then i looked it into this it seems like oj-api login for codeforces not working. i tried to login manually even tried to login using oj-tools still it is not working. I hope you will check it.
Error log