leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

Locked problem with Leetcode Premium

Open ZhuonanLin opened this issue 7 years ago • 3 comments

Thanks for your script. I subscribed the Leetcode premium, however with this script, the locked problems still shows as locked. Can you please fix this?

ZhuonanLin avatar Sep 09 '18 05:09 ZhuonanLin

I don't have the the Leetcode premium, I don't know the premium's info json.

Can you login to Leetcode and type this url: https://leetcode.com/api/problems/algorithms/ in your browser. And find the question_id : "question_id": 865 info for me?

example json:

// https://leetcode.com/api/problems/algorithms/

{
  "user_name": "xxx",
  "num_solved": 98,
  "num_total": 855,
  "ac_easy": 44,
  "ac_medium": 45,
  "ac_hard": 9,
  "stat_status_pairs": [
    {
....

{
      "stat": {
        "question_id": 865,
        "question__article__live": null,
        "question__article__slug": null,
        "question__title": "Robot Room Cleaner",
        "question__title_slug": "robot-room-cleaner",
        "question__hide": false,
        "total_acs": 4543,
        "total_submitted": 9275,
        "frontend_question_id": 489,
        "is_new_question": false
      },
      "status": null,
      "difficulty": {
        "level": 3
      },
      "paid_only": true,
      "is_favor": false,
      "frequency": 0,
      "progress": 0
    },
....

Maybe can find why the problem still show as locked.

bonfy avatar Sep 20 '18 01:09 bonfy

Hi, here is my info of Problem 865, copied from the webpage file:

{"stat": {"question_id": 865, "question__article__live": null, "question__article__slug": null, "question__title": "Robot Room Cleaner", "question__title_slug": "robot-room-cleaner", "question__hide": false, "total_acs": 4886, "total_submitted": 9812, "frontend_question_id": 489, "is_new_question": false}, "status": null, "difficulty": {"level": 3}, "paid_only": true, "is_favor": false, "frequency": 1.1304095257238957, "progress": 23.671685278258746}

ZhuonanLin avatar Sep 24 '18 17:09 ZhuonanLin

"is_favor": false

the same as me, a normal leetcode user. the lock logic in my code is

    @property
    def is_lock(self):
        return not self.is_favor and self.paid_only

this is why the problems still show as locked.

Maybe I should find the field which shows the user is premium.

bonfy avatar Sep 25 '18 01:09 bonfy