Open
Conversation
批量下载视频时,如果保存路径相同的文件同名,则先下载好的文件会被覆盖,而最终只留下一个。 所以对同名视频加上后缀,以分别保存。
|
建议文件名加上下载地址的hash值来判断。适合断点续传和后续检查更新 |
Author
|
hash可以啊,加个crc32的尾巴。我懒所以就直接加123了。 |
|
@yawwwwwn 同名直接覆盖的问题我遇到比较多是作者没填标题或者默认标题……那种就是成片的同名了。 |
Keep pace
卑微 Windows 用户会因视频文件名中有英文问号 `?` 等而报错 `OSError(22, 'Invalid argument')`。 进一步优化后缀的添加,并结合原本的文件大小检查避免重复下载。
Author
|
卑微 Windows 用户会因视频文件名中有英文问号 |
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.
批量下载视频时,如果保存路径相同的文件同名,则先下载好的文件会被覆盖,而最终只留下一个。
所以对同名视频加上后缀,以分别保存。