Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
筑梦之路
bypy
提交
ebe1e3e8
B
bypy
项目概览
筑梦之路
/
bypy
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
bypy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ebe1e3e8
编写于
6月 06, 2020
作者:
H
Hou Tianze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert previous commit - Not following Baidu PCS's fuck ups
上级
2a5771a3
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
42 addition
and
12 deletion
+42
-12
HISTORY.md
HISTORY.md
+1
-0
HISTORY.rst
HISTORY.rst
+3
-0
README.md
README.md
+1
-1
baidudoc/baidu_oauth_rest_api_list.pdf
baidudoc/baidu_oauth_rest_api_list.pdf
+0
-0
baidudoc/baidu_oauth_rest_overview.pdf
baidudoc/baidu_oauth_rest_overview.pdf
+0
-0
bypy/bypy.py
bypy/bypy.py
+31
-9
bypy/const.py
bypy/const.py
+1
-1
release.sh
release.sh
+4
-0
update/update.json
update/update.json
+1
-1
未找到文件。
HISTORY.md
浏览文件 @
ebe1e3e8
### 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
...
...
HISTORY.rst
浏览文件 @
ebe1e3e8
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
...
...
README.md
浏览文件 @
ebe1e3e8
...
...
@@ -128,7 +128,7 @@ bypy compare
-
运行时添加
`-d`
,会显示一些调试信息。
-
运行时添加
`-ddd`
,还会会显示HTTP通讯信息(
**警告:非常多**
)
整合测试(15 - 30分钟)
整合测试(15 - 30分钟)
-------------------
-
在主目录下跑:
`python -m bypy.test`
...
...
baidudoc/baidu_oauth_rest_api_list.pdf
0 → 100644
浏览文件 @
ebe1e3e8
文件已添加
baidudoc/baidu_oauth_rest_overview.pdf
0 → 100644
浏览文件 @
ebe1e3e8
文件已添加
bypy/bypy.py
浏览文件 @
ebe1e3e8
...
...
@@ -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
()
...
...
bypy/const.py
浏览文件 @
ebe1e3e8
...
...
@@ -12,7 +12,7 @@ import os
# https://packaging.python.org/single_source_version/
__title__
=
'bypy'
__version__
=
'1.6.1
0
'
__version__
=
'1.6.1
1
'
__author__
=
'Hou Tianze'
__license__
=
'MIT'
__desc__
=
'Python client for Baidu Yun (Personal Cloud Storage) 百度云/百度网盘 Python 客户端'
...
...
release.sh
浏览文件 @
ebe1e3e8
...
...
@@ -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
...
...
update/update.json
浏览文件 @
ebe1e3e8
{
"comment"
:
"Update info"
,
"recommendedVersion"
:
"1.6.1
0
"
,
"recommendedVersion"
:
"1.6.1
1
"
,
"minimumRequiredVersion"
:
"1.6.0"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录