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

Format a bit

上级 47466d39
......@@ -3614,7 +3614,7 @@ def printBaiduBanner():
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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:
So if it 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 for this `bypy` project, if you are interested, please create an issue at github, thanks. ###
......
......@@ -299,19 +299,18 @@ def md5(filename, slice = const.OneM):
return encrypt_md5(m.hexdigest())
@cached
def encrypt_md5(md5str):
if len(md5str)!=32:
return md5str
for i in range(0,32):
v = int(md5str[i],16)
if v<0 or v>16:
if len(md5str) != 32:
return md5str
for i in range(32):
v = int(md5str[i], 16)
if v < 0 or v > 16:
return md5str
md5str = md5str[8:16] + md5str[0:8] + md5str[24:32] + md5str[16:24]
encryptstr = ""
for e in range(0,len(md5str)):
encryptstr += hex(int(md5str[e],16) ^ 15 & e)[2:3]
return encryptstr[0:9] + chr(ord("g")+int(encryptstr[9],16)) + encryptstr[10:]
encryptstr = ''
for e in range(len(md5str)):
encryptstr += hex(int(md5str[e], 16) ^ 15 & e)[2:3]
return encryptstr[0:9] + chr(ord('g')+int(encryptstr[9], 16)) + encryptstr[10:]
# slice md5 for baidu rapidupload
@cached
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册