2
2
from urllib .parse import quote
3
3
4
4
from config import async_headers , cn_graphql_url , Req , all_problems_url , difficulties , lcof_problems_url , \
5
- lcci_problems_url
5
+ lcci_problems_url , problems_url
6
6
from fetch import fetch
7
7
8
8
@@ -41,7 +41,7 @@ def get_all_questions():
41
41
for question in questions :
42
42
qid = str (question ['stat' ]['question_id' ]).zfill (4 )
43
43
title = question ['stat' ]['question__title' ]
44
- link = 'https://leetcode-cn.com/problems/' + question ['stat' ]['question__title_slug' ]
44
+ link = problems_url + question ['stat' ]['question__title_slug' ]
45
45
git_link = '/solution/{}/README.md' .format (qid + '.' + quote (title ))
46
46
cn_title = cn_res .get (qid ) or title
47
47
col1 = '[{}]({})' .format (qid , link )
@@ -61,7 +61,7 @@ def get_lcof_questions():
61
61
fe_qid = question ['stat' ]['frontend_question_id' ]
62
62
qno = fe_qid .replace ('面试题' , '' ).strip ()
63
63
title = question ['stat' ]['question__title' ].replace (' LCOF' , '' ).strip ()
64
- link = 'https://leetcode-cn.com/problems/' + question ['stat' ]['question__title_slug' ]
64
+ link = problems_url + question ['stat' ]['question__title_slug' ]
65
65
git_link = '/lcof/{}/README.md' .format (quote (fe_qid + '. ' + title ))
66
66
col1 = '[{}]({})' .format (qno , link )
67
67
col2 = '[{}]({})' .format (title , git_link )
@@ -82,7 +82,7 @@ def get_lcci_questions():
82
82
fe_qid = question ['stat' ]['frontend_question_id' ]
83
83
qno = fe_qid .replace ('面试题' , '' ).strip ()
84
84
cn_title = cn_res .get (str (qid ))
85
- link = 'https://leetcode-cn.com/problems/' + question ['stat' ]['question__title_slug' ]
85
+ link = problems_url + question ['stat' ]['question__title_slug' ]
86
86
git_link = '/lcci/{}/README.md' .format (quote (fe_qid + '. ' + cn_title ))
87
87
col1 = '[{}]({})' .format (qno , link )
88
88
col2 = '[{}]({})' .format (cn_title , git_link )
0 commit comments