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

文件夹上传问题 #46

Open
littlecattle opened this issue Dec 30, 2020 · 5 comments
Open

文件夹上传问题 #46

littlecattle opened this issue Dec 30, 2020 · 5 comments

Comments

@littlecattle
Copy link

上传文件夹, 蓝奏盘中确实生成了文件夹, 但是只上传了一个文件后报错. (文件夹中文件全部<100M)

Traceback (most recent call last):
lzy.upload_dir(dirname)
File "/home/ubuntu/.local/lib/python3.8/site-packages/lanzou/api/core.py", line 915, in upload_dir
code = self.upload_file(file_path, dir_id, callback=callback, uploaded_handler=uploaded_handler)
File "/home/ubuntu/.local/lib/python3.8/site-packages/lanzou/api/core.py", line 870, in upload_file
return self._upload_small_file(file_path, folder_id, callback=callback, uploaded_handler=uploaded_handler)
File "/home/ubuntu/.local/lib/python3.8/site-packages/lanzou/api/core.py", line 766, in _upload_small_file
result = self._post('https://pc.woozooo.com/fileup.php', data=monitor, headers=tmp_header, timeout=3600)
File "/home/ubuntu/.local/lib/python3.8/site-packages/lanzou/api/core.py", line 72, in _post
return self._session.post(url, data, verify=False, **kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/requests/sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/requests_cache/core.py", line 141, in request
main_key = self.cache.create_key(response.request)
File "/home/ubuntu/.local/lib/python3.8/site-packages/requests_cache/backends/base.py", line 227, in create_key
key.update(_to_bytes(body))
File "/home/ubuntu/.local/lib/python3.8/site-packages/requests_cache/backends/base.py", line 259, in _to_bytes
return bytes(s, encoding)
TypeError: encoding without a string argument

@zaxtyson
Copy link
Owner

zaxtyson commented Jan 2, 2021

有文件名吗, 可能是某些文件名带了奇怪的字符, 我这边上传文件夹暂时没发现问题

@littlecattle
Copy link
Author

画师10831084
├画师10831084.pa去掉rt3.rar 89.6 M
├画师10831084.pa|rt4.rar 17.8 M
├画师10831084.pa去除rt2.rar 88.0 M
└画师10831084.pa部分rt1.rar 86.9 M

现在本机上传好像没多大问题, 服务器[香港,带宽30M]上传就出现上述问题, 现在是我是循环上传单个文件直到成功, 但是传这几个得花40多分钟.

问下这是文件名问题, 还是ip方面的问题呢?

@zaxtyson
Copy link
Owner

zaxtyson commented Jan 2, 2021

image

画师10831084.pa|rt4.rar| 是非法字符, 上传会自动去掉, 然后变成 画师10831084.part4.rar, 这种二级后缀会被蓝奏云拦截, 因为曾经我们使用这种策略对抗官方的限制, 然后导致这种后缀形式的文件都会被干掉

请参见:
zaxtyson/LanZouCloud-CMD#11 (comment)
zaxtyson/LanZouCloud-CMD#12 (comment)
zaxtyson/LanZouCloud-CMD#16 (comment)

@littlecattle
Copy link
Author

好的了解了, 现在准备上传时混淆文件名, 附带一个文件名恢复小程序
感谢

@zaxtyson
Copy link
Owner

zaxtyson commented Jan 2, 2021

这个事情可以交给api处理, 如果需要上传大文件的话, 可以选择绕过官方限制
https://github.com/zaxtyson/LanZouCloud-API/wiki/0x02-%E7%99%BB%E5%BD%95%E5%92%8C%E6%B3%A8%E9%94%80#ignore_limits
因为处理的机制比较复杂, 普通用户也得用基于本项目的程序才能下载.

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

No branches or pull requests

2 participants