diff --git a/src/problem.rs b/src/problem.rs index bd920f45..05ac3788 100644 --- a/src/problem.rs +++ b/src/problem.rs @@ -3,8 +3,8 @@ extern crate reqwest; use std::fmt::{Display, Formatter, Error}; -const PROBLEMS_URL: &str = "https://leetcode.com/api/problems/algorithms/"; -const GRAPHQL_URL: &str = "https://leetcode.com/graphql"; +const PROBLEMS_URL: &str = "https://leetcode-cn.com/api/problems/algorithms/"; +const GRAPHQL_URL: &str = "https://leetcode-cn.com/graphql"; const QUESTION_QUERY_STRING: &str = r#" query questionData($titleSlug: String!) { question(titleSlug: $titleSlug) { @@ -20,7 +20,7 @@ const QUESTION_QUERY_OPERATION: &str = "questionData"; pub fn get_problem(id: u32) -> Option { let problems = get_problems().unwrap(); for problem in problems.stat_status_pairs.iter() { - if problem.stat.question_id == id { + if problem.stat.frontend_question_id == id { let client = reqwest::Client::new(); let resp: RawProblem = client.post(GRAPHQL_URL) .json(&Query::question_query(problem.stat.question_title_slug.as_ref().unwrap()))