LifeActor / ykdl

a video downloader focus on China mainland video sites.(一款专注于中国大陆视频网站的视频下载器。)
https://github.com/LifeActor/ykdl
Other
1.45k stars 285 forks source link

-l playlist 模式补全下载有问题的文件bug #522

Closed zz5678 closed 4 years ago

zz5678 commented 4 years ago

单独下载 bilibili 的 某个分p,如果分p文件大小与服务器不同,ykdl 会自动去重新 或 补全此文件,如果文件没问题,也会出错,错误信息如下。单个文件下载,出错退出问题还不大

但用 -l 下载整个 playlist 后,可能有多个 分p 是失败损坏的,再运行同一个 -l 的命令去试图 让 ykdl 去挨个测试 服务器端返回的 文件大小是否和本地 分p 文件相同,如果不同,就再重新下载,这个机制会在 分p 数字最小的且已经成功下载的 分p 上出错失败退出,不会再继续测算或下载之后的 分p 了

希望 ykdl 能作正确判断,比如 文件大小与服务器相同,返回成功,继续下一个分p 大小对比,这样可以自动化校验大量分p 的下载。

出错日志如下:

Traceback (most recent call last):
  File "/Users/uuu/.pyenv/versions/3.7.6/envs/376/bin/ykdl", line 11, in <module>
    load_entry_point('ykdl==1.6.3', 'console_scripts', 'ykdl')()
  File "/Users/uuu/.pyenv/versions/3.7.6/envs/376/lib/python3.7/site-packages/cykdl/__main__.py", line 203, in main
    handle_videoinfo(info)
  File "/Users/uuu/.pyenv/versions/3.7.6/envs/376/lib/python3.7/site-packages/cykdl/__main__.py", line 131, in handle_videoinfo
    download(urls, name, ext, live)
  File "/Users/uuu/.pyenv/versions/3.7.6/envs/376/lib/python3.7/site-packages/cykdl/__main__.py", line 83, in download
    if save_urls(urls, name, ext, jobs = args.jobs):
  File "/Users/uuu/.pyenv/versions/3.7.6/envs/376/lib/python3.7/site-packages/ykdl/util/download.py", line 84, in save_urls
    save_url(urls[0], name, ext, status)
  File "/Users/uuu/.pyenv/versions/3.7.6/envs/376/lib/python3.7/site-packages/ykdl/util/download.py", line 51, in save_url
    response = urlopen(req, None)
  File "/Users/uuu/.pyenv/versions/3.7.6/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/uuu/.pyenv/versions/3.7.6/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/Users/uuu/.pyenv/versions/3.7.6/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/Users/uuu/.pyenv/versions/3.7.6/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/Users/uuu/.pyenv/versions/3.7.6/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/Users/uuu/.pyenv/versions/3.7.6/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 416: Requested Range Not Satisfiable
SeaHOH commented 4 years ago

感谢你的反馈! 已修复,请更新。