Skip to content

Commit

Permalink
🐛 修复下载失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
shadlc committed Nov 22, 2024
1 parent b2a0c18 commit 3c5f3c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/DownloadManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __thread__EpisodeTask(self, curr_id: int, epi: Episode) -> None:
self.signal_rate_progress.emit(
{"taskID": curr_id, "rate": int(rate * 100), "path": save_path}
)
time.sleep(self.mainGUI.getConfig("download_gap"))
time.sleep(self.mainGUI.getConfig("download_gap", 0))

############################################################
# ? 为以后的特典下载留的接口
Expand Down
8 changes: 6 additions & 2 deletions src/ui/MainGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def getConfig(self, key: str, default: Any = None) -> Any:
Any: 配置项的值
"""
if self.config:
return self.config.get(key)
return self.config.get(key, default)

# ?###########################################################
# ? 检测配置文件是否存在, 不存在则创建
Expand Down Expand Up @@ -292,5 +292,9 @@ def getCookie(self) -> str:
Returns:
str: Cookie
"""
return f"SESSDATA={self.getConfig('cookie')};buvid3={uuid.uuid4()}infoc;"
cookie = ""
if sess_data := self.getConfig('cookie'):
cookie += f"SESSDATA={self.getConfig('cookie')};"
cookie += f"buvid3={uuid.uuid4()}infoc;"
return cookie

2 changes: 1 addition & 1 deletion src/ui/MangaUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ def _() -> None:

# ?###########################################################
# ? 初始漫画对象
comic = BiliPlusComic(self.present_comic_id, self.mainGUI)
comic = Comic(self.present_comic_id, self.mainGUI)

if self.mainGUI.getConfig("save_meta"):
# ?###########################################################
Expand Down

0 comments on commit 3c5f3c6

Please sign in to comment.