File tree 2 files changed +288
-33
lines changed
2 files changed +288
-33
lines changed Original file line number Diff line number Diff line change
1
+
2
+ const CRAWL_SITE = "gitee"
3
+
1
4
module . exports = {
2
5
3
6
/**
4
7
* 爬取的数据源站点 github | gitee
5
8
*/
6
9
7
- CRAWL_SITE : "github" ,
10
+ CRAWL_SITE ,
8
11
9
12
/**
10
13
* 需解析的语言类型
@@ -35,26 +38,27 @@ module.exports = {
35
38
/**
36
39
* 获取问题列表地址
37
40
*/
38
- PROBLEMS_URL : "https://github.com/azl397985856/leetcode/tree/master/problems" ,
41
+ PROBLEMS_URL : CRAWL_SITE === "gitee" ? "https://gitee.com/golong/leetcode/tree/master/problems" : "https://github.com/azl397985856/leetcode/tree/master/problems" ,
39
42
40
43
/**
41
44
* 抓取页面问题内容的dom元素选择器
42
45
*/
43
- QUESTION_DOM_SELECTOR : ".position-relative.js-navigation-item .js-navigation-open" ,
46
+ QUESTION_DOM_SELECTOR : CRAWL_SITE === "gitee" ? ".tree-item-file-name.tree-list-item a" : ".position-relative.js-navigation-item .js-navigation-open" ,
47
+
44
48
45
49
/**
46
50
* markdwon下载地址
47
51
*/
48
- BASE_MARKDWON_DOWNLOAD_URL :
49
- "https://raw.githubusercontent.com/azl397985856/leetcode/master/problems/" ,
52
+ BASE_MARKDWON_DOWNLOAD_URL : CRAWL_SITE === "gitee" ? "https://gitee.com/golong/leetcode/raw/master/problems/" : "https://raw.githubusercontent.com/azl397985856/leetcode/master/problems/" ,
53
+
50
54
51
55
/**
52
56
* 过滤英文文档末尾标识
53
57
*/
54
58
ENGLISH_MARKDOWN_SIGN : ".en.md" ,
55
59
56
60
/**
57
- * 爬虫抓取同一文件时的最大失败次数(多为网络原因导致)
61
+ * 爬虫抓取同一文件时的最大失败次数(多为网络原因导致, 切换到gitee源 )
58
62
*/
59
63
MAX_CRAWL_RETRY_NUMBER : 100
60
64
} ;
You can’t perform that action at this time.
0 commit comments