Skip to content

Commit

Permalink
Merge pull request #12 from Zeal-L/develop
Browse files Browse the repository at this point in the history
🐛🔒 修复总进度条bug;优化多线程的设置选项
  • Loading branch information
Zeal-L authored Mar 11, 2023
2 parents 8d0d521 + 4b04cd7 commit 384a7c7
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 52 deletions.
12 changes: 6 additions & 6 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🎉 哔哩哔哩漫画下载器 v1.0.1 💖
# 🎉 哔哩哔哩漫画下载器 💖

![GitHub Pipenv locked Python version](https://img.shields.io/github/pipenv/locked/python-version/Zeal-L/BiliBili-Manga-Downloader)
![GitHub top language](https://img.shields.io/github/languages/top/Zeal-L/BiliBili-Manga-Downloader)
Expand Down Expand Up @@ -29,7 +29,7 @@
- **易操作的图形界面!~~(不用再费劲的部署环境跑命令行)~~**
- **无需漫画ID,可直接关键词搜索漫画!并附带搜索词高亮!**
- **丰富的漫画详情信息,以及双击漫画封面即可跳转B漫链接!**
- **最高可达64的多线程下载,速度拉满!~~(好吧我承认这并不是一个可以吹的点...)~~**
- **可配置的多线程下载,速度拉满!**
- **实现了应对网络波动等情况的异常重试,以及应用了指数级退让来避免在短时间大量重试被拉黑名单**
- **本地漫画管理功能,一键检查更新!**
- **通过正则匹配过滤重复的章节名称内容!**
Expand Down Expand Up @@ -79,6 +79,7 @@
- 🟦 添加一个启动程序加载进度条
- 🟦 添加我的追漫界面,以及追漫功能
- 🟦 下载任务的暂停和继续功能,断点续传。以及下载任务的持久化,本地缓存
- 🟦 对于有特典的漫画,提供特典下载界面
- **已解决**
-~~添加检测cookie无效或者过期功能,并且弹窗~~
-~~鼠标移动到漫画封面改变鼠标图标,提示用户可以点击跳转~~
Expand Down Expand Up @@ -126,6 +127,10 @@
- 是否更改依赖性

## ⚰️ 更新记录
### v1.0.2 - *2022-03-11*
- 修复bug:总进度条数值错误更新为0
- 优化设置选项:以防在网络不好的情况下高线程数导致的频繁重试警告,最大线程数现在设为32

### v1.0.1 - *2022-03-9*
- 优化UI视觉:因为网络错误跳过任务后,更新总进度条的进度,速度和剩余时间信息
- 更新关于界面:添加了作者的联系方式
Expand Down
20 changes: 10 additions & 10 deletions src/ui/DownloadUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ def _(result: dict):
#? deleteLater 会有延迟,为了显示效果,先将父控件设为None
to_delete.setParent(None)
to_delete.deleteLater()

#? 删除字典中的条目
del curr_task
self.download_info.removeTask(result['taskID'])
self.all_tasks.pop(result['taskID'])
#? 更新跳过章节任务相关信息
if result['rate'] == -1:
self.download_info.updateTask(result['taskID'], 100)
curr_task['rate'] = 100

#? 更新总进度条的进度,速度和剩余时间
if len(self.all_tasks) != 0:
mainGUI.progressBar_total_progress.setValue(
sum(task[1]['rate'] for task in self.all_tasks.items()) / len(self.all_tasks)
)
total_progress = sum(task[1]['rate'] for task in self.all_tasks.items()) / len(self.all_tasks)
mainGUI.progressBar_total_progress.setValue(total_progress)
if total_progress != 100:
mainGUI.label_total_progress_speed.setText(f"{self.download_info.getTotalSmoothSpeedStr()}")
mainGUI.label_total_progress_time.setText(f"{self.download_info.getTotalRemainingTimeStr()}")
else:
mainGUI.progressBar_total_progress.setValue(100)
#? 100% 后删除所有任务字典中的条目
self.download_info.removeAllTasks()
self.all_tasks.clear()
mainGUI.label_total_progress_speed.setText("总下载速度:")
mainGUI.label_total_progress_time.setText("剩余时间:")

Expand Down
6 changes: 3 additions & 3 deletions src/ui/MainGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(self):
#?###########################################################
#? 初始化UI绑定事件
self.mangaUI = MangaUI(self)
self.SettingUI = SettingUI(self)
self.DownloadUI = DownloadUI(self)
self.settingUI = SettingUI(self)
self.downloadUI = DownloadUI(self)


############################################################
Expand All @@ -75,7 +75,7 @@ def _(path: str) -> None:
os.remove(file_path)
os.rmdir(path)

if self.SettingUI.clearUserData:
if self.settingUI.clearUserData:
try:
_(self.app_folder)
except OSError as e:
Expand Down
2 changes: 1 addition & 1 deletion src/ui/MangaUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def _() -> None:
for i in range(mainGUI.listWidget_chp_detail.count()):
item = mainGUI.listWidget_chp_detail.item(i)
if item.flags() != Qt.NoItemFlags and item.checkState() == Qt.Checked:
mainGUI.DownloadUI.addTask(mainGUI, self.epi_list[i])
mainGUI.downloadUI.addTask(mainGUI, self.epi_list[i])
item.setFlags(Qt.NoItemFlags)
item.setBackground(QColor(0, 255, 0, 50))
mainGUI.listWidget_chp_detail.itemChanged.connect(checkbox_change)
Expand Down
10 changes: 5 additions & 5 deletions src/ui/mainWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>534</width>
<height>191</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="v_Layout_myLibrary"/>
Expand Down Expand Up @@ -711,7 +711,7 @@
<number>1</number>
</property>
<property name="maximum">
<number>64</number>
<number>32</number>
</property>
<property name="singleStep">
<number>2</number>
Expand All @@ -720,7 +720,7 @@
<number>2</number>
</property>
<property name="value">
<number>32</number>
<number>16</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -730,7 +730,7 @@
<item>
<widget class="QLabel" name="label_num_thread">
<property name="text">
<string>线程数并不是越多越好,请根据自己的网络情况和平均任务大小合理配置(推荐:32)</string>
<string>线程数并不是越多越好,请根据自己的网络情况和平均任务大小合理配置(推荐:16)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/myAbout.ui
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<item>
<widget class="QLabel" name="outline">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:700; color:#00aaff;&quot;&gt;哔哩哔哩&lt;/span&gt;&lt;span style=&quot; font-size:16pt; font-weight:700;&quot;&gt;漫画下载器 &lt;/span&gt;&lt;span style=&quot; font-size:16pt; font-weight:700; color:#aa00ff;&quot;&gt;v1.0.1&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;作者:Zeal-L&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;项目地址:&lt;/span&gt;&lt;a href=&quot;https://github.com/Zeal-L/BiliBili-Manga-Downloader&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/Zeal-L/BiliBili-Manga-Downloader&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;本程序仅供学习交流使用,严禁用于商业用途&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:700; color:#00aa00;&quot;&gt;联系方式:&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;Q群号:&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:700; color:#aa00ff;&quot;&gt;244029317&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;&lt;br/&gt;欢迎进群讨论程序,漫画,资源分享, 提交问题等等&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt; font-weight:700;&quot;&gt;-- LICENSE --&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;BiliBili-Manga-Downloader&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;Copyright (C) 2023 Zeal L&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;You should have received a copy of the GNU Affero General Public License along with this program. If not, see &lt;/span&gt;&lt;a href=&quot;https://www.gnu.org/licenses&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://www.gnu.org/licenses&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:700; color:#00aaff;&quot;&gt;哔哩哔哩&lt;/span&gt;&lt;span style=&quot; font-size:16pt; font-weight:700;&quot;&gt;漫画下载器 &lt;/span&gt;&lt;span style=&quot; font-size:16pt; font-weight:700; color:#aa00ff;&quot;&gt;v1.0.2&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;作者:Zeal-L&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;项目地址:&lt;/span&gt;&lt;a href=&quot;https://github.com/Zeal-L/BiliBili-Manga-Downloader&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/Zeal-L/BiliBili-Manga-Downloader&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;本程序仅供学习交流使用,严禁用于商业用途&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:16pt; font-weight:700; color:#00aa00;&quot;&gt;联系方式:&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;Q群号:&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:700; color:#aa00ff;&quot;&gt;244029317&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:700;&quot;&gt;&lt;br/&gt;欢迎进群讨论程序,漫画,资源分享, 提交问题等等&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt; font-weight:700;&quot;&gt;-- LICENSE --&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;BiliBili-Manga-Downloader&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;Copyright (C) 2023 Zeal L&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;You should have received a copy of the GNU Affero General Public License along with this program. If not, see &lt;/span&gt;&lt;a href=&quot;https://www.gnu.org/licenses&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://www.gnu.org/licenses&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'HYWenHei-85W'; font-size:12pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand Down
8 changes: 4 additions & 4 deletions src/ui/ui_mainWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def setupUi(self, MainWidget):
self.scrollArea_myLibrary.setWidgetResizable(True)
self.scrollAreaWidgetContents_myLibrary = QWidget()
self.scrollAreaWidgetContents_myLibrary.setObjectName(u"scrollAreaWidgetContents_myLibrary")
self.scrollAreaWidgetContents_myLibrary.setGeometry(QRect(0, 0, 534, 191))
self.scrollAreaWidgetContents_myLibrary.setGeometry(QRect(0, 0, 98, 28))
self.v_Layout_myLibrary = QVBoxLayout(self.scrollAreaWidgetContents_myLibrary)
self.v_Layout_myLibrary.setObjectName(u"v_Layout_myLibrary")
self.scrollArea_myLibrary.setWidget(self.scrollAreaWidgetContents_myLibrary)
Expand Down Expand Up @@ -482,10 +482,10 @@ def setupUi(self, MainWidget):
self.h_Slider_num_thread.setMinimumSize(QSize(200, 0))
self.h_Slider_num_thread.setMaximumSize(QSize(200, 16777215))
self.h_Slider_num_thread.setMinimum(1)
self.h_Slider_num_thread.setMaximum(64)
self.h_Slider_num_thread.setMaximum(32)
self.h_Slider_num_thread.setSingleStep(2)
self.h_Slider_num_thread.setPageStep(2)
self.h_Slider_num_thread.setValue(32)
self.h_Slider_num_thread.setValue(16)
self.h_Slider_num_thread.setOrientation(Qt.Horizontal)

self.h_Layout_num_thread.addWidget(self.h_Slider_num_thread)
Expand Down Expand Up @@ -621,7 +621,7 @@ def retranslateUi(self, MainWidget):
self.pushButton_save_path.setText(QCoreApplication.translate("MainWidget", u"\u6d4f\u89c8...", None))
self.groupBox.setTitle(QCoreApplication.translate("MainWidget", u"\u6ce8\u610f\uff1a\u4ee5\u4e0b\u8bbe\u7f6e\u53ea\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u751f\u6548\uff01", None))
self.label_num_thread_count.setText(QCoreApplication.translate("MainWidget", u"\u540c\u65f6\u4e0b\u8f7d\u7ebf\u7a0b\u6570\uff1a", None))
self.label_num_thread.setText(QCoreApplication.translate("MainWidget", u"\u7ebf\u7a0b\u6570\u5e76\u4e0d\u662f\u8d8a\u591a\u8d8a\u597d\uff0c\u8bf7\u6839\u636e\u81ea\u5df1\u7684\u7f51\u7edc\u60c5\u51b5\u548c\u5e73\u5747\u4efb\u52a1\u5927\u5c0f\u5408\u7406\u914d\u7f6e\uff08\u63a8\u8350\uff1a32\uff09", None))
self.label_num_thread.setText(QCoreApplication.translate("MainWidget", u"\u7ebf\u7a0b\u6570\u5e76\u4e0d\u662f\u8d8a\u591a\u8d8a\u597d\uff0c\u8bf7\u6839\u636e\u81ea\u5df1\u7684\u7f51\u7edc\u60c5\u51b5\u548c\u5e73\u5747\u4efb\u52a1\u5927\u5c0f\u5408\u7406\u914d\u7f6e\uff08\u63a8\u8350\uff1a16\uff09", None))
self.groupBox_save_method.setTitle(QCoreApplication.translate("MainWidget", u"\u6f2b\u753b\u4fdd\u5b58\u683c\u5f0f\uff1a", None))
self.radioButton_save_method_pdf.setText(QCoreApplication.translate("MainWidget", u"PDF", None))
self.radioButton_save_method_7z.setText(QCoreApplication.translate("MainWidget", u"7z\u538b\u7f29\u5305", None))
Expand Down
Loading

0 comments on commit 384a7c7

Please sign in to comment.