aropan / clist

Your comprehensive guide to global programming contests. Track events, get details, and never miss a competition.
https://clist.by
Apache License 2.0
344 stars 37 forks source link

Support questionFrontendId for leetcode.com #384

Closed chinesedfan closed 4 months ago

chinesedfan commented 4 months ago

Now clist invokes https://leetcode.com/contest/api/info/{contestSlug}/ to get question_id, which is different with the id that we see in browsers.

For example, "1791. Find Center of Star Graph", question_id is 1916, but questionFrontendId is 1791.

FYI, I find it can be queried by GraphQL. Not sure whether it can be implemented by clist. You can also search in Github and find more examples.

// https://leetcode.com/graphql/, the request payload is,
{"query":"\n    query questionTitle($titleSlug: String!) {\n  question(titleSlug: $titleSlug) {\n    questionId\n    questionFrontendId\n    title\n    titleSlug\n    isPaidOnly\n    difficulty\n    likes\n    dislikes\n    categoryTitle\n  }\n}\n    ","variables":{"titleSlug":"find-center-of-star-graph"},"operationName":"questionTitle"}
aropan commented 4 months ago
image

Added id field by default for leetcode.com resource.

chinesedfan commented 4 months ago

@aropan Did you refresh all leetcode's problems, or just recent contests?