Skip to content

Commit 3c5f3c6

Browse files
committed
🐛 修复下载失败问题
1 parent b2a0c18 commit 3c5f3c6

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/DownloadManager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def __thread__EpisodeTask(self, curr_id: int, epi: Episode) -> None:
184184
self.signal_rate_progress.emit(
185185
{"taskID": curr_id, "rate": int(rate * 100), "path": save_path}
186186
)
187-
time.sleep(self.mainGUI.getConfig("download_gap"))
187+
time.sleep(self.mainGUI.getConfig("download_gap", 0))
188188

189189
############################################################
190190
# ? 为以后的特典下载留的接口

src/ui/MainGUI.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def getConfig(self, key: str, default: Any = None) -> Any:
235235
Any: 配置项的值
236236
"""
237237
if self.config:
238-
return self.config.get(key)
238+
return self.config.get(key, default)
239239

240240
# ?###########################################################
241241
# ? 检测配置文件是否存在, 不存在则创建
@@ -292,5 +292,9 @@ def getCookie(self) -> str:
292292
Returns:
293293
str: Cookie
294294
"""
295-
return f"SESSDATA={self.getConfig('cookie')};buvid3={uuid.uuid4()}infoc;"
295+
cookie = ""
296+
if sess_data := self.getConfig('cookie'):
297+
cookie += f"SESSDATA={self.getConfig('cookie')};"
298+
cookie += f"buvid3={uuid.uuid4()}infoc;"
299+
return cookie
296300

src/ui/MangaUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ def _() -> None:
10361036

10371037
# ?###########################################################
10381038
# ? 初始漫画对象
1039-
comic = BiliPlusComic(self.present_comic_id, self.mainGUI)
1039+
comic = Comic(self.present_comic_id, self.mainGUI)
10401040

10411041
if self.mainGUI.getConfig("save_meta"):
10421042
# ?###########################################################

0 commit comments

Comments
 (0)