@@ -71,7 +71,7 @@ function requestWithReLogin(opts, cb) {
7171var leetcodeClient = { } ;
7272
7373leetcodeClient . getProblems = function ( cb ) {
74- var opts = makeOpts ( config . PROBLEMS_URL ) ;
74+ var opts = makeOpts ( config . URL_PROBLEMS ) ;
7575
7676 requestWithReLogin ( opts , function ( e , resp , body ) {
7777 e = checkError ( e , resp , 200 ) ;
@@ -94,7 +94,7 @@ leetcodeClient.getProblems = function(cb) {
9494 id : p . stat . question_id ,
9595 name : p . stat . question__title ,
9696 key : p . stat . question__title_slug ,
97- link : config . PROBLEM_URL . replace ( '$id' , p . stat . question__title_slug ) ,
97+ link : config . URL_PROBLEM . replace ( '$id' , p . stat . question__title_slug ) ,
9898 locked : p . paid_only ,
9999 percent : p . stat . total_acs * 100 / p . stat . total_submitted ,
100100 level : h . levelToName ( p . difficulty . level )
@@ -138,17 +138,17 @@ leetcodeClient.getProblem = function(problem, cb) {
138138} ;
139139
140140leetcodeClient . login = function ( user , cb ) {
141- request ( config . LOGIN_URL , function ( e , resp , body ) {
141+ request ( config . URL_LOGIN , function ( e , resp , body ) {
142142 e = checkError ( e , resp , 200 ) ;
143143 if ( e ) return cb ( e ) ;
144144
145145 user . loginCSRF = h . getSetCookieValue ( resp , 'csrftoken' ) ;
146146
147147 var opts = {
148- url : config . LOGIN_URL ,
148+ url : config . URL_LOGIN ,
149149 headers : {
150- Origin : config . BASE_URL ,
151- Referer : config . LOGIN_URL ,
150+ Origin : config . URL_BASE ,
151+ Referer : config . URL_LOGIN ,
152152 Cookie : 'csrftoken=' + user . loginCSRF + ';'
153153 } ,
154154 form : {
@@ -176,7 +176,7 @@ function verifyResult(opts, jobs, results, cb) {
176176 return cb ( null , results ) ;
177177
178178 opts . method = 'GET' ;
179- opts . url = config . VERIFY_URL . replace ( '$id' , jobs [ 0 ] . id ) ;
179+ opts . url = config . URL_VERIFY . replace ( '$id' , jobs [ 0 ] . id ) ;
180180
181181 requestWithReLogin ( opts , function ( e , resp , body ) {
182182 e = checkError ( e , resp , 200 ) ;
@@ -196,8 +196,8 @@ function verifyResult(opts, jobs, results, cb) {
196196leetcodeClient . testProblem = function ( problem , cb ) {
197197 var opts = makeOpts ( ) ;
198198 opts . method = 'POST' ;
199- opts . url = config . TEST_URL . replace ( '$key' , problem . key ) ;
200- opts . headers . Origin = config . BASE_URL ;
199+ opts . url = config . URL_TEST . replace ( '$key' , problem . key ) ;
200+ opts . headers . Origin = config . URL_BASE ;
201201 opts . headers . Referer = problem . link ;
202202 opts . headers [ 'X-Requested-With' ] = 'XMLHttpRequest' ;
203203 opts . json = true ;
@@ -227,8 +227,8 @@ leetcodeClient.testProblem = function(problem, cb) {
227227leetcodeClient . submitProblem = function ( problem , cb ) {
228228 var opts = makeOpts ( ) ;
229229 opts . method = 'POST' ;
230- opts . url = config . SUBMIT_URL . replace ( '$key' , problem . key ) ;
231- opts . headers . Origin = config . BASE_URL ;
230+ opts . url = config . URL_SUBMIT . replace ( '$key' , problem . key ) ;
231+ opts . headers . Origin = config . URL_BASE ;
232232 opts . headers . Referer = problem . link ;
233233 opts . headers [ 'X-Requested-With' ] = 'XMLHttpRequest' ;
234234 opts . json = true ;
0 commit comments