提交 ebe1e3e8 编写于 作者: H Hou Tianze

Revert previous commit - Not following Baidu PCS's fuck ups

上级 2a5771a3
### Version History:
- 1.6.11: Revert the previous change - Baidu PCS's behavior is wrong and makes no sense
- 1.6.10: Fix MD5 comparision (thanks to @shenchucheng)
- 1.6.9: Make auth server list dynamic
- 1.6.8: Fix 1000 items limit for downloading
......
Version History:
~~~~~~~~~~~~~~~~
- 1.6.11: Revert the previous change - Baidu PCS’s behavior is wrong
and makes no sense
- 1.6.10: Fix MD5 comparision (thanks to @shenchucheng)
- 1.6.9: Make auth server list dynamic
......
......@@ -128,7 +128,7 @@ bypy compare
- 运行时添加`-d`,会显示一些调试信息。
- 运行时添加`-ddd`,还会会显示HTTP通讯信息(**警告:非常多**
整合测试(15 - 30分钟)
整合测试(15 - 30分钟)
-------------------
- 在主目录下跑:`python -m bypy.test`
......
......@@ -2597,17 +2597,18 @@ restore a file from the recycle bin
self.__remote_dir_contents.get(remotepath[rootlen:]).add(
d['path'][dlen:], PathDictTree('D', size = d['size'], md5 = d['md5'] if 'md5' in d else ''))
# Baidu made another fuck up here:
# f['md5'] doesn't have the correct MD5 value, but f['block_list'][0] has
# This makes no sense, and I'm not going to change the correct code to adapt its wrong behaviors
# --- Code below for reference ---
# fmd5 = f['md5']
# bl = 'block_list'
# if bl in f and f[bl]:
# fmd5 = f[bl][0]
# f['path'][dlen:], PathDictTree('F', size = f['size'], md5 = fmd5))
for f in filejs:
fmd5 = f['md5']
bl = 'block_list'
if bl in f and f[bl]:
fmd5 = f[bl][0]
self.__remote_dir_contents.get(remotepath[rootlen:]).add(
f['path'][dlen:], PathDictTree('F', size = f['size'], md5 = fmd5))
# 网盘和本地文件相同,但本地文件md5与网盘获取到的md5值却不一致
# 与之对应的是在block_list列表中的值
# 此处修改后可实现增量上传,compare函数运行结果才是正确的
# f['path'][dlen:], PathDictTree('F', size = f['size'], md5 = f['md5']))
f['path'][dlen:], PathDictTree('F', size = f['size'], md5 = f['md5']))
return walkresult
......@@ -3608,8 +3609,29 @@ def clean_prog_files(cleanlevel, verbose, configdir = const.ConfigDir):
return result
def printBaiduBanner():
banner ='''
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Baidu PCS currently gives totally WRONG MD5 hash for remote files, and I AM NOT GOING TO ADAPT TO IT!
So it if doesn't work, install version '1.6.10' using the following command:
pip install bypy==1.6.10
Version 1.6.10 has a workaround for this.
### Seeking maintainer fo this `bypy` project, if you are interested, please create an issue at github, thanks. ###
----------------------------------------------------------------
百度云盘返回的MD5全错了,鬼知道他们什么时候会改回来!现在代码是按照MD5值是正确的前提来写的,不会改。
所以你发现比较功能等不能正确工作时,请安装 1.6.10 版本:
pip install bypy==1.6.10
1.6.10版有个临时解决方案。
### 寻求这个`bypy`项目维护者,有意的话请去github上建issue,谢谢。###
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'''
print(banner)
def main(argv=None): # IGNORE:C0111
''' Main Entry '''
printBaiduBanner()
by = None
reqres = check_requirements()
......
......@@ -12,7 +12,7 @@ import os
# https://packaging.python.org/single_source_version/
__title__ = 'bypy'
__version__ = '1.6.10'
__version__ = '1.6.11'
__author__ = 'Hou Tianze'
__license__ = 'MIT'
__desc__ = 'Python client for Baidu Yun (Personal Cloud Storage) 百度云/百度网盘 Python 客户端'
......
......@@ -7,6 +7,10 @@
# brew install pandoc
# pip3 install pandoc pypandoc twine pyflakes
### Usage ###
# - Testing: ./release.sh -buti
# - Actual: ./release.sh -abigtu
#set -o errexit
#set -x
......
{
"comment": "Update info",
"recommendedVersion": "1.6.10",
"recommendedVersion": "1.6.11",
"minimumRequiredVersion": "1.6.0"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册