Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
初步加入延时
Browse files Browse the repository at this point in the history
  • Loading branch information
shing-yu committed Oct 14, 2023
1 parent a7d914a commit 3e0dcde
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/fanqie_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def download_novels(url, encoding, user_agent, path_choice, folder_path, data_fo

# 遍历每个章节链接
for chapter in chapters:

time.sleep(2)
# 获取章节标题
chapter_title = chapter.find("a").get_text()

Expand Down
3 changes: 3 additions & 0 deletions src/fanqie_chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from urllib.parse import urljoin
import re
import os
import time


# 定义分章节保存模式用来下载番茄小说的函数
Expand Down Expand Up @@ -90,6 +91,8 @@ def fanqie_c(url, encoding, user_agent, path_choice, start_chapter_id):

# 遍历每个章节链接
for chapter in chapters[start_index:]:

time.sleep(0.5)
# 获取章节标题
chapter_title = chapter.find("a").get_text()

Expand Down
3 changes: 3 additions & 0 deletions src/fanqie_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import re
import datetime
import os
import time


# 定义调试模式用来下载番茄小说的函数
Expand Down Expand Up @@ -97,6 +98,8 @@ def fanqie_d(url, encoding, user_agent, path_choice, data_folder, start_chapter_

# 遍历每个章节链接
for chapter in chapters[start_index:]:

time.sleep(0.5)
# 获取章节标题
chapter_title = chapter.find("a").get_text()
print(f"[DEBUG]正在获取章节:{chapter_title}")
Expand Down
2 changes: 2 additions & 0 deletions src/fanqie_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import re
import datetime
import os
import time


# 定义正常模式用来下载番茄小说的函数
Expand Down Expand Up @@ -84,6 +85,7 @@ def fanqie_n(url, encoding, user_agent, path_choice, data_folder, start_chapter_

# 遍历每个章节链接
for chapter in chapters[start_index:]:
time.sleep(0.5)
# 获取章节标题
chapter_title = chapter.find("a").get_text()

Expand Down

0 comments on commit 3e0dcde

Please sign in to comment.