bonfy / leetcode

:sparkles::v::sparkles:leetcode刷题 内附leetcode solution代码自动下载生成器(Leetcode solution auto generator)
554 stars 181 forks source link

i think leetcode changes his website again #25

Closed mengban closed 6 years ago

mengban commented 6 years ago

emmmmm.... the log as follows: File ".\leetcode_generate.py", line 611, in <module> do_job(leetcode) File ".\leetcode_generate.py", line 588, in do_job leetcode.load() File ".\leetcode_generate.py", line 263, in load self.load_submissions() File ".\leetcode_generate.py", line 320, in load_submissions assert resp.status_code == 200 AssertionError ORZ

mengban commented 6 years ago

And another question is that after running the script , my account in browser was loged out.

johnnysuns commented 6 years ago

@mengban Inload_submissions(), Session.get(), line 319, could failed. So I simply add a retry mechanism when resp.status_code != 200 and it works. see my version leetcode_generate.py in line 324

mengban commented 6 years ago

It works. @johnnysuns The beauty of brute force!!!

bonfy commented 6 years ago

@mengban @johnnysuns

I add time.sleep(2.5) when load submissions .And it works now.

Leetcode change its website policy and will return 403 if you load submissions too frequent.

mengban commented 6 years ago

@bonfy niubility bro.