fix: 失败的下载任务不再导致程序提前中止#35
Merged
Merged
Conversation
biliarchiver 最初的行为是:一旦有下载任务失败,程序会立即退出。`93d3635` 修改了这一行为,使得单个任务失败时,其他任务能够继续执行,并等待所有任务完成后再报错。但由于实现逻辑有误,程序还是会在有下载任务失败时立即退出。 这个 commit 修复了错误的逻辑。 Closes saveweb#34.
Contributor
Author
|
修好了一个 bug,又出现了一个:下载任务失败时,失败的下载任务的进度条会一直保留(显示进度为 100%),直到程序结束。 我研究一下。 |
Contributor
Author
结论:这是 bilix 的问题,没法修复。(bilix 的逻辑也是一旦有任务失败程序立即中止,出现这种问题也是意料之中的事情。) https://github.com/HFrost0/bilix/blob/bb5b234cdfe3fafc4db9d992b91091f2edf791e5/bilix/sites/bilibili/downloader.py#L345 |
bilix CLI 在启动时会开启进度条显示:
```python
try:
CLIProgress.start() # start progress
```
在结束时会关闭进度条显示:
```python
finally:
CLIProgress.stop() # stop rich progress to ensure cursor is repositioned
```
而且使用了 `try ... finally ...`,可以确保程序结束时进度条不会残留在控制台输出中。
biliarchiver 虽然在启动时开启了进度条显示,但没有在结束时关闭进度条显示,导致程序结束时进度条残留。
TripleCamera
commented
Jul 18, 2026
Contributor
|
|
biliarchiver 会在任何一个下载任务出错时立即输出错误,同时在程序结束时再输出一遍第一个错误。后者是不必要的,删掉。 同时优化输出内容并标记为可翻译。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
biliarchiver 最初的行为是:一旦有下载任务失败,程序会立即退出。
93d3635修改了这一行为,使得单个任务失败时,其他任务能够继续执行,并等待所有任务完成后再报错。但由于实现逻辑有误,程序还是会在有下载任务失败时立即退出。这个 commit 修复了错误的逻辑。
Closes #34.