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

Commit

Permalink
refactor: 移除无用传参和导入
Browse files Browse the repository at this point in the history
  • Loading branch information
shing-yu committed Nov 23, 2023
1 parent 87e38ce commit 12f2f37
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/fanqie_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def download_novels(url, encoding, user_agent, path_choice, folder_path, data_fo

time.sleep(1)

result = p.get_api(chapter, headers, url)
result = p.get_api(chapter, headers)

if result is None:
continue
Expand Down
2 changes: 1 addition & 1 deletion src/fanqie_chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def fanqie_c(url, encoding, user_agent, path_choice, start_chapter_id):

time.sleep(0.25)

result = p.get_api(chapter, headers, url)
result = p.get_api(chapter, headers)

if result is None:
continue
Expand Down
1 change: 0 additions & 1 deletion src/fanqie_epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
无论您对程序进行了任何操作,请始终保留此信息。
"""
import os
import sys

# 导入必要的模块
import requests
Expand Down
2 changes: 1 addition & 1 deletion src/fanqie_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def fanqie_n(url, encoding, user_agent, path_choice, data_folder, start_chapter_
for chapter in tqdm(chapters[start_index:]):
time.sleep(0.25)

result = p.get_api(chapter, headers, url)
result = p.get_api(chapter, headers)

if result is None:
continue
Expand Down
2 changes: 1 addition & 1 deletion src/fanqie_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def download_novel(url, encoding, user_agent, start_chapter_id, txt_file_path):

chapter_id_now = re.search(r"/reader/(\d+)", str(chapter)).group(1)

result = p.get_api(chapter, headers, url)
result = p.get_api(chapter, headers)

if result is None:
continue
Expand Down
3 changes: 1 addition & 2 deletions src/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from bs4 import BeautifulSoup
import requests
from tqdm import tqdm
from urllib.parse import urljoin
from colorama import Fore, Style, init

init(autoreset=True)
Expand Down Expand Up @@ -112,7 +111,7 @@ def get_fanqie(url, user_agent):
return headers, title, content, chapters


def get_api(chapter, headers, url):
def get_api(chapter, headers):
# 获取章节标题
chapter_title = chapter.find("a").get_text()

Expand Down

0 comments on commit 12f2f37

Please sign in to comment.