Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid file overwritten #124

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Avoid file overwritten #124

wants to merge 3 commits into from

Conversation

yawwwwwn
Copy link

批量下载视频时,如果保存路径相同的文件同名,则先下载好的文件会被覆盖,而最终只留下一个。
所以对同名视频加上后缀,以分别保存。

批量下载视频时,如果保存路径相同的文件同名,则先下载好的文件会被覆盖,而最终只留下一个。
所以对同名视频加上后缀,以分别保存。
@icesunx
Copy link

icesunx commented May 11, 2019

建议文件名加上下载地址的hash值来判断。适合断点续传和后续检查更新

@yawwwwwn
Copy link
Author

hash可以啊,加个crc32的尾巴。我懒所以就直接加123了。
断点续传没必要吧,毕竟抖音视频都不大。原作者同名直接覆盖估计也是这样想的。
后续检查更新是什么?

@icesunx
Copy link

icesunx commented May 15, 2019

@yawwwwwn 同名直接覆盖的问题我遇到比较多是作者没填标题或者默认标题……那种就是成片的同名了。
后续检查更新是更新作者视频咯,挺多作者有持续在发布新视频的呢

卑微 Windows 用户会因视频文件名中有英文问号 `?` 等而报错 `OSError(22, 'Invalid argument')`。
进一步优化后缀的添加,并结合原本的文件大小检查避免重复下载。
@yawwwwwn
Copy link
Author

卑微 Windows 用户会因视频文件名中有英文问号 ? 等而报错 OSError(22, 'Invalid argument')
进一步优化后缀的添加,并结合原本的文件大小检查避免重复下载。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants