wxy1343 / aliyunpan Goto Github PK
View Code? Open in Web Editor NEW阿里云盘cli
License: GNU General Public License v3.0
阿里云盘cli
License: GNU General Public License v3.0
这个上传大文件速度快么,我这边一直1M/s在上传
日志:
Traceback (most recent call last):
File "main.py", line 179, in <module>
File "click\core.py", line 829, in __call__
File "click\core.py", line 782, in main
File "click\core.py", line 1259, in invoke
File "click\core.py", line 1066, in invoke
File "click\core.py", line 610, in invoke
File "main.py", line 87, in upload
File "aliyunpan\cli\cli.py", line 250, in upload
File "aliyunpan\api\core.py", line 373, in upload_file
File "aliyunpan\common.py", line 236, in upload_info
File "aliyunpan\common.py", line 202, in <lambda>
File "aliyunpan\common.py", line 149, in <lambda>
File "aliyunpan\common.py", line 166, in _output_gen
UnicodeEncodeError: 'gbk' codec can't encode character '\u266a' in position 93: illegal multibyte sequence
[10708] Failed to execute script 'main' due to unhandled exception!
文件名是[web Girlfriend (♪)][01][怡萱动漫][www.yxdm.tv].mp4
大神能不能做个同步功能选项?谢谢
您好,今天(20211004)我使用pip命令安装好后,使用命令行登录(手机号是用来说明的,不是真的):
aliyunpan-cli -u 15601445229
结果提示:
Usage: aliyunpan-cli [OPTIONS] COMMAND [ARGS]...
Error: Missing command.
但COMMAND里我没有找到和登录相关的,请问该如何登录?
操作系统:win10
python版本:3.7.1
我测试了一下,本地文件验证HASH后不能秒传(阿里云盘是有这个文件的!)
请问使用什么办法更新access token,使用login方法没用。
RT
怎么查看别人分享的内容
这两个异常都出现了好几次了
第一个:
Traceback (most recent call last):
File "D:\Python\b站直播姬webhook\FileUpload.py", line 144, in upload
if not commander.upload(path=file, upload_path=upload_path,
File "D:\Python\b站直播姬webhook\aliyunpan\cli\cli.py", line 211, in upload
result = self._disk.upload_file(
File "D:\Python\b站直播姬webhook\aliyunpan\api\core.py", line 416, in upload_file
upload_bar.update(ratio=k, refresh_line=True)
File "D:\Python\b站直播姬webhook\aliyunpan\common.py", line 314, in update
self.output = Info(upload_info, refresh_line=refresh_line, color=Fore.LIGHTMAGENTA_EX)
File "D:\Python\b站直播姬webhook\aliyunpan\common.py", line 193, in <lambda>
lambda self, value: self._print.output.send(value) if self._output else None)
ValueError: generator already executing
FileUpload.py的upload函数是通过线程来启动的,我查过似乎是多线程的问题
第二个:
Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\response.py", line 436, in _error_catcher
yield
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\response.py", line 766, in read_chunked
chunk = self._handle_chunk(amt)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\response.py", line 710, in _handle_chunk
value = self._fp._safe_read(amt)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 612, in _safe_read
data = self.fp.read(amt)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line 753, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\response.py", line 571, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\response.py", line 792, in read_chunked
self._original_response.close()
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\response.py", line 441, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.aliyundrive.com', port=443): Read timed out.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python\b站直播姬webhook\FileUpload.py", line 144, in upload
if not commander.upload(path=file, upload_path=upload_path,
File "D:\Python\b站直播姬webhook\aliyunpan\cli\cli.py", line 211, in upload
result = self._disk.upload_file(
File "D:\Python\b站直播姬webhook\aliyunpan\api\core.py", line 309, in upload_file
r = self.create_file(file_name=file_name, parent_file_id=parent_file_id, file_type=True, json=json,
File "D:\Python\b站直播姬webhook\aliyunpan\api\core.py", line 214, in create_file
r = self._req.post(url, json=j)
File "D:\Python\b站直播姬webhook\aliyunpan\api\req.py", line 76, in post
return self._req('post', *args, **kwargs)
File "D:\Python\b站直播姬webhook\aliyunpan\api\req.py", line 47, in _req
r = getattr(self._session, method.lower())(*args, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 697, in send
r.content
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line 831, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "C:\Users\DELL\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line 760, in generate
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.aliyundrive.com', port=443): Read timed out.
这个希望能够给函数create_file的request加重试
log参考:
2021-06-25 13:10:43 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 164 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=164&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=VZ9T3InGx4p%2BjTsuutNcjPD8Lm%2FmPRqSrzZHOCzUS7g%3D&x-oss-signature-version=OSS2.
2021-06-25 13:11:00 [req.py:49] _req DEBUG - 200
2021-06-25 13:11:00 [req.py:63] _req DEBUG -
2021-06-25 13:11:00 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 165 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=165&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=20oVarNjzcU60p0PqWpDcm%2FJ48khSz0uht2XaDWtsOY%3D&x-oss-signature-version=OSS2.
2021-06-25 13:11:20 [req.py:49] _req DEBUG - 200
2021-06-25 13:11:20 [req.py:63] _req DEBUG -
2021-06-25 13:11:20 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 166 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=166&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=fK8z%2Fw4hkjKSUMp3ZUQYu61V1UKi%2B%2BAqODJhsFnkiyE%3D&x-oss-signature-version=OSS2.
2021-06-25 13:11:41 [req.py:49] _req DEBUG - 200
2021-06-25 13:11:41 [req.py:63] _req DEBUG -
2021-06-25 13:11:41 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 167 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=167&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=EVMULDEbrsCZzISOKTqKz3EGsZm9DSAhievSS7pZm%2Bw%3D&x-oss-signature-version=OSS2.
2021-06-25 13:11:58 [req.py:49] _req DEBUG - 200
2021-06-25 13:11:58 [req.py:63] _req DEBUG -
2021-06-25 13:11:58 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 168 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=168&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=UF6nwfVxF%2BTdRLInvKhHqrB58Lckb6rgsUvMGoC5ars%3D&x-oss-signature-version=OSS2.
2021-06-25 13:12:20 [req.py:49] _req DEBUG - 200
2021-06-25 13:12:20 [req.py:63] _req DEBUG -
2021-06-25 13:12:20 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 169 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=169&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=FUm76ENmZddwbS32ImtInvlL4p7Gc4lBw%2Bixzr2tB6E%3D&x-oss-signature-version=OSS2.
2021-06-25 13:12:37 [req.py:49] _req DEBUG - 200
2021-06-25 13:12:37 [req.py:63] _req DEBUG -
2021-06-25 13:12:38 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 170 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=170&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=%2FyaJy3jB0XuSw%2BwyEzX9D7JDacUlg%2BcdzCQ%2F0aIomUg%3D&x-oss-signature-version=OSS2.
2021-06-25 13:13:00 [req.py:49] _req DEBUG - 200
2021-06-25 13:13:00 [req.py:63] _req DEBUG -
2021-06-25 13:13:00 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 171 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=171&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=1%2BCzU2LazryKfhdwTDNTdXs4IrwNa42UUd6VE4UK6PU%3D&x-oss-signature-version=OSS2.
2021-06-25 13:13:17 [req.py:49] _req DEBUG - 200
2021-06-25 13:13:17 [req.py:63] _req DEBUG -
2021-06-25 13:13:17 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 172 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=172&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=8NXZCWQPULsAbrl%2FQ7Q2pwf0bo63%2BMSAdNNSC71QoO8%3D&x-oss-signature-version=OSS2.
2021-06-25 13:13:33 [req.py:49] _req DEBUG - 200
2021-06-25 13:13:33 [req.py:63] _req DEBUG -
2021-06-25 13:13:34 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 173 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=173&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=qOIgeU6GD2%2BO1ffUp9RccYDi1RGEHVDvo6pYgPKqW5c%3D&x-oss-signature-version=OSS2.
2021-06-25 13:13:59 [req.py:49] _req DEBUG - 200
2021-06-25 13:13:59 [req.py:63] _req DEBUG -
2021-06-25 13:13:59 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:13:59 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:03 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:03 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:07 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:08 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:12 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:13 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:17 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:17 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:21 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:21 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:25 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:26 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:30 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:30 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:34 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:34 [core.py:516] upload_file WARNING - Upload timeout.
2021-06-25 13:14:38 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624598029&x-oss-signature=JSkWs%2BnesMGJdtKhALNwQatradyUPz02PYA4AGJIuL4%3D&x-oss-signature-version=OSS2.
2021-06-25 13:14:38 [req.py:49] _req DEBUG - 403
2021-06-25 13:14:38 [req.py:63] _req DEBUG - <?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>Request has expired.</Message>
<RequestId>60D5663EB4E98C373013937B</RequestId>
<HostId>bj29.cn-beijing.data.alicloudccp.com</HostId>
<Expires>2021-06-25T05:13:49.000Z</Expires>
<ServerTime>2021-06-25T05:14:38.000Z</ServerTime>
</Error>
2021-06-25 13:14:38 [core.py:538] upload_file WARNING - Part 174 upload request has expired.
2021-06-25 13:14:40 [req.py:49] _req DEBUG - 401
2021-06-25 13:14:40 [core.py:667] get_access_token INFO - Get ACCESS_TOKEN.
2021-06-25 13:14:40 [req.py:49] _req DEBUG - 200
2021-06-25 13:14:40 [core.py:675] get_access_token DEBUG - eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJhZjBhNWMyNWYxNDc0ZDlhODhlY2JjZTZiMWM3MmIxNyIsImN1c3RvbUpzb24iOiJ7XCJjbGllbnRJZFwiOlwiMjVkelgzdmJZcWt0Vnh5WFwiLFwiZG9tYWluSWRcIjpcImJqMjlcIixcInNjb3BlXCI6W1wiRFJJVkUuQUxMXCIsXCJTSEFSRS5BTExcIixcIkZJTEUuQUxMXCIsXCJVU0VSLkFMTFwiLFwiU1RPUkFHRS5BTExcIixcIlNUT1JBR0VGSUxFLkxJU1RcIixcIkJBVENIXCIsXCJPQVVUSC5BTExcIixcIklNQUdFLkFMTFwiLFwiSU5WSVRFLkFMTFwiLFwiQUNDT1VOVC5BTExcIl0sXCJyb2xlXCI6XCJ1c2VyXCIsXCJyZWZcIjpcImh0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9cIn0iLCJleHAiOjE2MjQ2MDUyODAsImlhdCI6MTYyNDU5ODAyMH0.UhxVk4OJWYbvPiW-3gLewpjXAZLrv1CLceXxR6GdGI_e-eeqJjh92LfXo5z43s_XL-LXRkAU_LdbDEs2xKQ7By3Ore8Np8L01pffVLLDz-rmEtNROckHS44nusqJOJqIrsGyxHRoJMB_kJeohXCLMeb0hEtHu-pzfgcsY7GbnzA
2021-06-25 13:14:40 [req.py:49] _req DEBUG - 200
2021-06-25 13:14:40 [core.py:553] upload_file INFO - The upload_url of Part 174 has been refreshed.
2021-06-25 13:14:40 [core.py:556] upload_file DEBUG - https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=wFhhLa3BPgHVGomaebybSt2XI70IEw%2FDgt6oiyKh1S8%3D&x-oss-signature-version=OSS2
2021-06-25 13:14:43 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 174 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=174&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=wFhhLa3BPgHVGomaebybSt2XI70IEw%2FDgt6oiyKh1S8%3D&x-oss-signature-version=OSS2.
2021-06-25 13:15:01 [req.py:49] _req DEBUG - 200
2021-06-25 13:15:01 [req.py:63] _req DEBUG -
2021-06-25 13:15:02 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 175 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=175&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=qrxbxoodbO81jZfEvsVAStAgf2Tldh5FDMInOinwb%2FA%3D&x-oss-signature-version=OSS2.
2021-06-25 13:15:21 [req.py:49] _req DEBUG - 200
2021-06-25 13:15:21 [req.py:63] _req DEBUG -
2021-06-25 13:15:21 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 176 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=176&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=46mL4sgalPIPnIZuQlWFabJT9U53v4MaQL%2Fz7Md0vTI%3D&x-oss-signature-version=OSS2.
2021-06-25 13:15:43 [req.py:49] _req DEBUG - 200
2021-06-25 13:15:43 [req.py:63] _req DEBUG -
2021-06-25 13:15:44 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 177 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=177&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=M%2BQlfq%2BWesJXwLqVFwxD%2FFDH82LqwhZj3FPA%2BUfH0iM%3D&x-oss-signature-version=OSS2.
2021-06-25 13:16:05 [req.py:49] _req DEBUG - 200
2021-06-25 13:16:05 [req.py:63] _req DEBUG -
2021-06-25 13:16:05 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 178 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=178&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=aw9EO7oFLBqPqNJ6dsLQ1F1GXSff8QcSqg179MDAsjg%3D&x-oss-signature-version=OSS2.
2021-06-25 13:16:24 [req.py:49] _req DEBUG - 200
2021-06-25 13:16:24 [req.py:63] _req DEBUG -
2021-06-25 13:16:24 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 179 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=179&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=1vVfE8Wi8v%2B24vUecTtknKk1iH0suOHW46GcckoFSLE%3D&x-oss-signature-version=OSS2.
2021-06-25 13:16:48 [req.py:49] _req DEBUG - 200
2021-06-25 13:16:48 [req.py:63] _req DEBUG -
2021-06-25 13:16:48 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 180 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=180&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=Lu6Qbu83qxLJA%2BMMt8zNXoqJBQVIFS5DQN7yPH5CdEM%3D&x-oss-signature-version=OSS2.
2021-06-25 13:17:10 [req.py:49] _req DEBUG - 200
2021-06-25 13:17:10 [req.py:63] _req DEBUG -
2021-06-25 13:17:10 [core.py:490] upload_file DEBUG - (upload_id=7852A6F3C4A0451680D16AE0A7833951, file_id=60d557fd36d5e75429994822b88db02c2ad04eff, size=10485760): Upload part of 181 to https://bj29.cn-beijing.data.alicloudccp.com/xSKG4bTk%2F1164371%2F60d557fd36d5e75429994822b88db02c2ad04eff%2F60d557fdbc72e3dac7bf4eaf880b5f7866888ac4?partNumber=181&uploadId=7852A6F3C4A0451680D16AE0A7833951&x-oss-access-key-id=LTAIsE5mAn2F493Q&x-oss-expires=1624601680&x-oss-signature=AZv00x7DhBwn%2F4qLKWddKwasDnYDOdfC98fsATfBTSk%3D&x-oss-signature-version=OSS2.
建议修改上传过期触发刷新的逻辑,改成主动触发,例如改成按时间,大约50分钟刷新一次。
因为超时次数过多会导致重传,我昨天就一直在重传。。。导致一个文件都没传上去
另外顺便给所有的api函数请求都加一下重试吧,最近ls也出现了上个issue的超时问题
这个下面的hash是怎么得来的呢?
api为:https://api.aliyundrive.com/v2/file/create
文件大小:7G
我在完成文件上传的post那里print了一下r.json()
输出内容:{'code': 'InvalidParameter.ContentHash', 'message': 'The input parameter content_hash is not valid. file content hash is not matched with content_hash in complete file request'}
debug模式日志文件:aliyunpan.zip
1、安装
能否把程序提交到python的官方程序库,使用
pip install aliyunpan
这样的命令安装,同时安装的时候处理好依赖库,让安装更加简单。
2、登录
使用命令tokenlogin 用token登录;
示例:
python main.py tokenlogin 'tokenidxxxxxxxxxxxxxxxxxxxxxxxxxxx'
使用命令login 用户名和密码登录;
python main.py login username password
感谢大神,支持大神。。。。。。期待大神。。
增加了下载单个文件的功能,同时加了一点逻辑,可以在命令行中直接用,类似于:
上传:
python3 main.py u /file/to/upload.pdf /path/in/aliyundrive
下载:
python3 main.py d /file/in/aliyundrive.pdf /path/to/sava
代码:
import hashlib
import math
import os
import sys
import time
import urllib
from multiprocessing.dummy import Pool, Queue
import requests
'''
用法:
上传:
python3 main.py u /file/to/upload.pdf /path/in/aliyundrive
下载:
python3 main.py d /file/in/aliyundrive.pdf /path/to/sava
'''
pool = Pool(5)
q = Queue(maxsize=5)
def get_list(access_token, drive_id, parent_file_id='root'):
"""
获取文件列表
"""
url = 'https://api.aliyundrive.com/v2/file/list'
headers = {'User-Agent': None, 'Authorization': access_token}
json = {"drive_id": drive_id, "parent_file_id": parent_file_id}
r = requests.post(url, headers=headers, json=json)
return r.json()
def get_list_clean(access_token, drive_id, parent_file_id='root'):
raw_info = get_list(access_token, drive_id, parent_file_id)
list_info = {'folders':[],'files':[]}
for i in raw_info['items']:
if i['type'] == 'folder':
i_name = i['name']
i_file_id = i['file_id']
list_info['folders'].append({'name':i_name,'file_id':i_file_id})
if i['type'] == 'file':
i_name = i['name']
i_file_id = i['file_id']
list_info['files'].append({'name':i_name,'file_id':i_file_id})
return list_info
def get_download_url(access_token, drive_id, file_id):
"""
获取单个文件的下载链接
"""
url = 'https://api.aliyundrive.com/v2/file/get_download_url'
headers = {'User-Agent': None, 'Authorization': access_token}
json = {"drive_id": drive_id, "file_id": file_id}
r = requests.post(url, headers=headers, json=json)
return r.json()['url']
def litter_seacher(name,f_list):
for f in f_list:
if f['name'] == name:
return f['file_id']
raise 'PATH ERROR!'
def get_folder_id_by_path(access_token, drive_id, folder_path):
raw_names = folder_path.rstrip('/').split('/')
names = list(filter(lambda x:x!='',raw_names))
if names == []:
return 'root'
list_info = get_list_clean(access_token, drive_id)
file_id = litter_seacher(names[0],list_info['folders'])
if len(names) == 1:
return file_id
else:
for folder_name in names[1:]:
list_info = get_list_clean(access_token, drive_id,file_id)
file_id = litter_seacher(folder_name,list_info['folders'])
return file_id
def get_download_url_by_path(access_token, drive_id, file_path):
raw_names = file_path.rstrip('/').split('/')
names = list(filter(lambda x:x!='',raw_names))
if len(names) == 1:
list_info = get_list_clean(access_token, drive_id)
file_id = litter_seacher(names[0],list_info['files'])
return get_download_url(access_token, drive_id, file_id)
else:
list_info = get_list_clean(access_token, drive_id)
parent_file_id = litter_seacher(names[0],list_info['folders'])
for folder_name in names[1:-1]:
list_info = get_list_clean(access_token, drive_id,parent_file_id)
parent_file_id = litter_seacher(folder_name,list_info['folders'])
list_info = get_list_clean(access_token, drive_id,parent_file_id)
file_id = litter_seacher(names[-1],list_info['files'])
return get_download_url(access_token, drive_id, file_id)
def get_user(access_token):
"""
获取用户信息
"""
url = 'https://api.aliyundrive.com/v2/user/get'
headers = {'User-Agent': None, 'Authorization': access_token}
r = requests.post(url, headers=headers, json={})
return r.json()
def refresh(refresh_token):
"""
获取access_token
:param refresh_token:
:return: access_token
"""
url = 'https://websv.aliyundrive.com/token/refresh'
json = {"refresh_token": refresh_token}
headers = {'User-Agent': None}
r = requests.post(url, json=json, headers=headers)
return r.json()['access_token']
def upload_file(access_token, drive_id, parent_file_id='root', path=None):
"""
上传文件
"""
def upload(kwargs):
part_number, upload_url, chunk = kwargs['part_number'], kwargs[
'upload_url'], kwargs['chunk']
size = len(chunk)
if not chunk:
return
# 等待上一个线程上传完毕(本来想搞多线程上传的,但是网盘不支持,也懒得改了)
while True:
if part_number == 1:
break
data = q_pool.get()
if data == part_number - 1:
break
else:
q_pool.put(data)
start_time = time.time()
r = requests.put(upload_url, headers=headers, data=chunk)
end_time = time.time()
etag = r.headers['ETag']
# 通知下一个线程上传
q_pool.put(part_number)
# 通知主线程
q.put({
'part_info_list': {
'part_number': part_number,
'etag': etag
},
'size': size,
'time': end_time - start_time
})
split_size = 5242880 # 默认5MB分片大小(不要改)
file_size = os.path.getsize(path)
_, file_name = os.path.split(path)
# 获取sha1
with open(path, 'rb') as f:
sha1 = hashlib.sha1()
count = 0
while True:
chunk = f.read(split_size)
if not chunk:
break
count += 1
sha1.update(chunk)
content_hash = sha1.hexdigest()
# 分片列表
part_info_list = []
for i in range(count):
part_info_list.append({"part_number": i + 1})
json = {
"name": file_name,
"type": "file",
"size": file_size,
"drive_id": drive_id,
"parent_file_id": parent_file_id,
"part_info_list": part_info_list,
"content_hash_name": "sha1",
"content_hash": content_hash,
# 如果文件存在则自动重命名(删了上传会出现名字一模一样的文件)
"check_name_mode": "auto_rename"
}
# 申请创建文件
url = 'https://api.aliyundrive.com/v2/file/create'
headers = {'User-Agent': None, 'Authorization': access_token}
r = requests.post(url, headers=headers, json=json)
# 如果存在匹配的hash值的文件则不会重复上传
rapid_upload = r.json()['rapid_upload']
if rapid_upload:
print('快速上传成功')
else:
# 多线程队列
q_pool = Queue(maxsize=5)
upload_id = r.json()['upload_id']
file_id = r.json()['file_id']
part_info_list = r.json()['part_info_list']
part_info_list_new = []
total_time = 0
count_size = 0
k = 0
sys.stdout.write(f'\r上传中... [{"*" * 10}] %0')
with open(path, 'rb') as f:
# 开启多线程上传
result = pool.map_async(upload, [{
'part_number': i['part_number'],
'upload_url': i['upload_url'],
'chunk': f.read(split_size)
} for i in part_info_list])
# 等待线程通知
while True:
data = q.get()
part_info_list_new.append(data['part_info_list'])
size = data['size']
total_time += data['time']
k += size / file_size
count_size += size
sys.stdout.write(
f'\r上传中... [{"=" * int(k * 10)}{"*" * int((1 - k) * 10)}] %{math.ceil(k * 1000) / 10}'
)
if count_size == file_size:
break
# 上传完成保存文件
url = 'https://api.aliyundrive.com/v2/file/complete'
json = {
"ignoreError": True,
"drive_id": drive_id,
"file_id": file_id,
"upload_id": upload_id,
"part_info_list": part_info_list_new
}
r = requests.post(url, headers=headers, json=json)
if r.status_code == 200:
total_time = int(total_time * 100) / 100
print(
f'\n上传成功,耗时{int(total_time * 100) / 100}秒,平均速度{int(file_size / 1024 / 1024 / total_time * 100) / 100}MB/s'
)
else:
print('\n上传失败')
def down_file(url, path):
start_time = time.time()
down_resp = requests.get(url, stream=True)
if down_resp.status_code != 200:
raise '启动下载任务失败。'
raw_file_name = down_resp.headers.get('Content-Disposition').split("'")[-1]
file_name = urllib.parse.unquote(raw_file_name, encoding='utf-8')
downloaded = 0
total = int(down_resp.headers.get('content-length', 0))
block_size = 1024 # 1 Kibibyte
totalsize = round(total / 1024 / 1024, 1)
with open(os.path.join(path, file_name), 'wb') as down_file:
print(file_name+':')
for data in down_resp.iter_content(block_size):
downloaded += len(data)
down_file.write(data)
done = int(50 * downloaded / total)
downsize = round(downloaded / 1024 / 1024, 1)
speed = '%6s' % str(
round(downloaded / 1024 / (time.time() - start_time), 1))
sys.stdout.write('\r[{}{}] {}MB/{}MB {}KB/s'.format('#' * done, '_' * (50 - done), downsize, totalsize, speed))
sys.stdout.flush()
sys.stdout.write('\n')
return os.path.join(path, file_name)
def main():
refresh_token = ''
access_token = refresh(refresh_token)
user_info = get_user(access_token)
drive_id = user_info['default_drive_id']
if sys.argv[1] == 'u':
parent_file_id = get_folder_id_by_path(access_token,drive_id,sys.argv[3])
upload_file(access_token, drive_id,parent_file_id=parent_file_id,path=sys.argv[2])
elif sys.argv[1] == 'd':
url = get_download_url_by_path(access_token, drive_id, sys.argv[2])
down_file(url,sys.argv[3])
else:
raise 'WRONG CMD!'
if __name__ == '__main__':
main()
上传一半老是卡着不动
大佬,刚才更新后使用你的最新版2.7.11还是无法妙传本地文件,已经在网盘上存在了的文件,以前可以的,阿里修改接口后,听说只是不能空传验证上传,问题是我用实实在在的本地文件还是得重新开始传,不能秒传。提示如下
root@debian:/data/Downloads# aliyunpan upload Unfaithful.2002.1080p.BrRip.x264.BOKUTOX.YIFY.mp4 /
[][hash]Unfaithful.2002.1080p.BrRip.x264.BOKUTOX.YIFY.mp4
[+][hash]Unfaithful.2002.1080p.BrRip.x264.BOKUTOX.YIFY.mp4
[][upload]Unfaithful.2002.1080p.BrRip.x264.BOKUTOX.YIFY.mp4
upload... [**********] 0.64% 139.39KB/s^C
Aborted!
本地文件上传验证完成hash后,还是会重新传,不会秒传。。大佬,求解决。
Exception ignored in: <bound method Commander.del of <aliyunpan.cli.cli.Commander object at 0x107074c18>>
Traceback (most recent call last):
File "/Users/lujango/Downloads/aliyunpan-main/aliyunpan/cli/cli.py", line 29, in del
File "/Users/lujango/Downloads/aliyunpan-main/aliyunpan/cli/config.py", line 25, in write
TypeError: unlink() got an unexpected keyword argument 'missing_ok'
直接分享出可以让用户在浏览器能直接打开的链接
比如:https://www.aliyundrive.com/s/jDaRVPZ5C6d
你好开发者,aliyunpan.log和task.yaml能不能在~固定的目录生成?我把此cli工具是我主要生产力工具,问题是,我在那里运行命令,在哪一个目录都会生成aliyunpan.log文件。
(base) ➜ aliyunpan git:(main) ✗ python main.py -h
Traceback (most recent call last):
File "main.py", line 5, in <module>
from aliyunpan.cli.cli import Commander
File "/Users/tongjun/workspace/aliyunpan/aliyunpan/cli/__init__.py", line 1, in <module>
from aliyunpan.cli.cli import Commander
File "/Users/tongjun/workspace/aliyunpan/aliyunpan/cli/cli.py", line 7, in <module>
from aliyunpan.cli.config import Config
File "/Users/tongjun/workspace/aliyunpan/aliyunpan/cli/config.py", line 2, in <module>
from ruamel.yaml import YAML
ModuleNotFoundError: No module named 'ruamel.yaml'
(base) ➜ aliyunpan git:(main) ✗ pip install ruamel_yaml
Requirement already satisfied: ruamel_yaml in /Users/tongjun/anaconda3/lib/python3.7/site-packages (0.15.46)
WARNING: You are using pip version 21.0.1; however, version 21.1.2 is available.
You should consider upgrading via the '/Users/tongjun/anaconda3/bin/python -m pip install --upgrade pip' command.
(base) ➜ aliyunpan git:(main) ✗ python --version
Python 3.7.4
Traceback (most recent call last):
File "main.py", line 8, in
from aliyunpan.cli.cli import Commander
File "/aliyunpan/aliyunpan/cli/init.py", line 1, in
from aliyunpan.cli.cli import Commander
File "/aliyunpan/aliyunpan/cli/cli.py", line 20, in
class Commander:
File "/aliyunpan/aliyunpan/cli/cli.py", line 111, in Commander
def get_path_list(self, path='root') -> list[FileInfo]:
TypeError: 'type' object is not subscriptable
https://media.cooluc.com/source/aliyunDrive-cli
你边是否允许使用我们这种途径分享 aliyunpan-cli 的成果?如不允许这种途径分享我会将它删除
python main.py upload -p /xxx
Traceback (most recent call last):
File "/project/liuye/aliyunpan/main.py", line 114, in <module>
cli()
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/project/liuye/aliyunpan/main.py", line 69, in upload
commander.upload(path_list, upload_path, time_out, retry, force)
File "/project/liuye/aliyunpan/aliyunpan/cli/cli.py", line 97, in upload
self._disk.upload_file(self._path_list.get_path_fid(file[0]), *file[1])
File "/project/liuye/aliyunpan/aliyunpan/api/utils.py", line 49, in decorated
return loop.run_until_complete(f(*args, **kwargs))
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/nest_asyncio.py", line 70, in run_until_complete
return f.result()
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/asyncio/tasks.py", line 256, in __step
result = coro.send(None)
File "/project/liuye/aliyunpan/aliyunpan/api/core.py", line 165, in upload_file
chunk = await f.read(split_size)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/aiofile/utils.py", line 211, in read
return await self.__read(length)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/aiofile/utils.py", line 205, in __read
data = await self.file.read_bytes(length, self._offset)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/aiofile/aio.py", line 202, in read_bytes
return await self.__context.read(size, self.fileno(), offset)
File "/home/liuye/project/miniconda3/envs/drive/lib/python3.9/site-packages/caio/asyncio_base.py", line 88, in submit
return op.get_value()
SystemError: Invalid argument
我下载并解压了aliyunpan-cli-Windows-x86_64-v2.6.0-96229c9.tar.gz
后,将aliyunpan.yaml放在%UserProfiles%\.config\aliyunpan.yaml
,运行aliyunpan-cli ls
,会报错
错误日志:
Traceback (most recent call last):
File "main.py", line 179, in <module>
File "click\core.py", line 829, in __call__
File "click\core.py", line 782, in main
File "click\core.py", line 1259, in invoke
File "click\core.py", line 1066, in invoke
File "click\core.py", line 610, in invoke
File "main.py", line 87, in upload
File "aliyunpan\cli\cli.py", line 250, in upload
File "aliyunpan\api\core.py", line 339, in upload_file
File "aliyunpan\api\core.py", line 216, in create_file
File "aliyunpan\api\core.py", line 44, in <lambda>
File "aliyunpan\api\core.py", line 575, in _drive_id_gen
File "aliyunpan\api\core.py", line 558, in get_drive_id
File "aliyunpan\api\core.py", line 180, in get_user_info
File "aliyunpan\api\req.py", line 92, in post
File "aliyunpan\api\req.py", line 62, in _req
File "aliyunpan\api\core.py", line 42, in <lambda>
File "aliyunpan\api\core.py", line 548, in _access_token_gen
File "aliyunpan\api\core.py", line 526, in get_access_token
File "aliyunpan\api\req.py", line 92, in post
File "aliyunpan\api\req.py", line 63, in _req
File "requests\sessions.py", line 590, in post
File "requests\sessions.py", line 542, in request
File "requests\sessions.py", line 655, in send
File "requests\adapters.py", line 439, in send
File "urllib3\connectionpool.py", line 696, in urlopen
File "urllib3\connectionpool.py", line 964, in _prepare_proxy
File "urllib3\connection.py", line 359, in connect
File "urllib3\connection.py", line 500, in _connect_tls_proxy
File "urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
File "urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 997, in _create
ValueError: check_hostname requires server_hostname
[9788] Failed to execute script 'main' due to unhandled exception!
奇怪的是,我在另一台电脑上正常运行
aliyunpan-cli-Linux-x86_64-v2.7.10-04864c0.tar.gz
[root@VM-0-3-centos ~]# ./aliyunpan-cli ls
[13088] Error loading Python lib /tmp/_MEIn8257r/libpython3.9.so.1.0
我是通过from aliyunpan.cli.cli import Commander来初始化并调用文件操作函数
我刚开始的几次ls的调用时没问题的,但是几次之后就开始一直报错,我尝试调试了下也不知道问题在哪(其实是看不懂)
报错如图
日志里面混进去了一些我打的log:日志.zip
我写的上传相关的代码FileUpload.py,其中upload方法是通过启动线程调用的
FileUpload.zip
部分改过的地方
没有去重有点不方便
备份相册到阿里云,很快,可是由于会断线就写了一个监控脚本,一下子把相册传输了4遍,希望作者能增加这个选项,非常感谢这么优秀的代码
alpine:/home/aliyun# pip install -r requirements.txt
Ignoring windows-curses: markers 'platform_system == "Windows"' don't match your environment
Requirement already satisfied: treelib==1.6.1 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (1.6.1)
Requirement already satisfied: requests~=2.25.1 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (2.25.1)
Requirement already satisfied: click_aliases==1.0.1 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 3)) (1.0.1)
Requirement already satisfied: rsa==4.0 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 4)) (4.0)
Requirement already satisfied: click==7.1.1 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (7.1.1)
Requirement already satisfied: ruamel.base==1.0.0 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 6)) (1.0.0)
Requirement already satisfied: ruamel.yaml in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 7)) (0.17.7)
Requirement already satisfied: colorama~=0.4.3 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 8)) (0.4.4)
Requirement already satisfied: npyscreen==4.10.5 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 9)) (4.10.5)
Requirement already satisfied: pyperclip~=1.8.1 in /usr/lib/python3.9/site-packages (from -r requirements.txt (line 11)) (1.8.2)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/lib/python3.9/site-packages (from rsa==4.0->-r requirements.txt (line 4)) (0.4.8)
Requirement already satisfied: future in /usr/lib/python3.9/site-packages (from treelib==1.6.1->-r requirements.txt (line 1)) (0.18.2)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3.9/site-packages (from requests~=2.25.1->-r requirements.txt (line 2)) (4.0.0)
Requirement already satisfied: idna<3.3,>=2.5 in /usr/lib/python3.9/site-packages (from requests~=2.25.1->-r requirements.txt (line 2)) (3.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.9/site-packages (from requests~=2.25.1->-r requirements.txt (line 2)) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.9/site-packages (from requests~=2.25.1->-r requirements.txt (line 2)) (2020.12.5)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2 in /usr/lib/python3.9/site-packages (from ruamel.yaml->-r requirements.txt (line 7)) (0.2.2)
alpine:/home/aliyun# python3 main.py u /unraid/xxx /backup/xxx
Traceback (most recent call last):
File "/home/aliyun/main.py", line 168, in
cli()
File "/usr/lib/python3.9/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/aliyun/main.py", line 91, in upload
commander.upload(path_list, upload_path, time_out, retry, force, share, chunk_size, c)
File "/home/aliyun/aliyunpan/cli/cli.py", line 248, in upload
raise FileNotFoundError
FileNotFoundError
alpine:/home/aliyun#
我用WSL来sync我的OneDrive到阿里云盘,但是OneDrive文件夹里有几个文件是系统的文件,同步到这几个系统文件时就会抛出异常提示"Permission denied"。
是否有选项忽略sync文件夹时读取出错的文件?
异常如下:
Traceback (most recent call last):
File "/home/liqiang/.local/bin/aliyunpan", line 8, in
sys.exit(main())
File "/home/liqiang/.local/lib/python3.9/site-packages/main.py", line 202, in main
cli()
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/liqiang/.local/lib/python3.9/site-packages/main.py", line 171, in sync
commander.sync(path, upload_path, sync_time, time_out, chunk_size, retry)
File "/home/liqiang/.local/lib/python3.9/site-packages/aliyunpan/cli/cli.py", line 556, in sync
return self.sync(path.absolute(), upload_path, sync_time, time_out, chunk_size, retry, first=first)
File "/home/liqiang/.local/lib/python3.9/site-packages/aliyunpan/cli/cli.py", line 562, in sync
self.upload(path, upload_path, timeout=time_out, chunk_size=chunk_size, retry=retry)
File "/home/liqiang/.local/lib/python3.9/site-packages/aliyunpan/cli/cli.py", line 288, in upload
result = self._disk.upload_file(
File "/home/liqiang/.local/lib/python3.9/site-packages/aliyunpan/api/core.py", line 316, in upload_file
content_hash = get_sha1(path, self._chunk_size)
File "/home/liqiang/.local/lib/python3.9/site-packages/aliyunpan/api/utils.py", line 40, in get_sha1
with open(path, 'rb') as f:
PermissionError: [Errno 13] Permission denied: '/mnt/d/OneDrive/.849C9593-D756-4E56-8D6E-42412F2A707B'
Traceback (most recent call last):
File "main.py", line 183, in <module>
cli()
File "/Users/weiqi/Library/Python/3.7/lib/python/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/weiqi/Library/Python/3.7/lib/python/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/weiqi/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1256, in invoke
Command.invoke(self, ctx)
File "/Users/weiqi/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/weiqi/Library/Python/3.7/lib/python/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "main.py", line 31, in cli
commander.init(config_file=config_file, depth=depth)
File "/Users/weiqi/Documents/cli/aliyunpan/aliyunpan/cli/cli.py", line 69, in init
self._disk.login(username, password)
File "/Users/weiqi/Documents/cli/aliyunpan/aliyunpan/api/core.py", line 92, in login
raise LoginFailed
aliyunpan.exceptions.LoginFailed
Expecting value: line 1 column 1 (char 0)
下载的最新版本 aliyunpan-cli-v2.7.10-04864c0 上传到宝塔面板
终端执行上传文件命令提示这个错误:(~/.config/aliyunpan.yaml 文件token是对的)
./aliyunpan-cli u local.tar.gz /
[27046] Error loading Python lib '/tmp/_MEI7aRoE7/libpython3.9.so.1.0': dlopen: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/_MEI7aRoE7/libpython3.9.so.1.0)
另外一个国外服务器可以正常上传,这个程序是要使用国外服务器网络才可以用的吗
为什么不直接使用access_token,因为有效期只有两小时。
获取refresh_token其实没这么麻烦,我们只需要登陆阿里云盘之后,打开开发者工具,切换到Application选项卡,点开Local storage,会有一个token项,点开就可以看到refresh_token了
错误日志
Traceback (most recent call last):
File "main.py", line 125, in <module>
cli()
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1256, in invoke
Command.invoke(self, ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "main.py", line 24, in cli
commander.init(config_file=config_file, depth=depth)
File "/root/backup/aliyunpan/aliyunpan/cli/cli.py", line 57, in init
raise LoginFailed
aliyunpan.exceptions.LoginFailed
已经用过一段时间了没问题,从昨天开始token失效,可能是阿里云盘调整了策略?
Traceback (most recent call last):
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 422, in get_access_token
access_token = r.json()['access_token']
KeyError: 'access_token'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/code/aliyunpan/main.py", line 152, in
cli()
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(args, **kwargs)
File "/opt/code/aliyunpan/main.py", line 87, in upload
commander.upload(path_list, upload_path, time_out, retry, force, share, chunk_size, c)
File "/opt/code/aliyunpan/aliyunpan/cli/cli.py", line 181, in upload
return self.upload_share(share_list, upload_path, force)
File "/opt/code/aliyunpan/aliyunpan/cli/cli.py", line 263, in upload_share
file_id_list = self.mkdir(upload_path / path)
File "/opt/code/aliyunpan/aliyunpan/cli/cli.py", line 128, in mkdir
file_id = self._path_list.get_path_fid(path, update=False)
File "/opt/code/aliyunpan/aliyunpan/api/models.py", line 96, in get_path_fid
self.auto_update_path_list(update, file_id)
File "/opt/code/aliyunpan/aliyunpan/api/models.py", line 125, in auto_update_path_list
return self.update_path_list(file_id, depth=0)
File "/opt/code/aliyunpan/aliyunpan/api/models.py", line 23, in update_path_list
file_list = self._disk.get_file_list(file_id)
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 81, in get_file_list
json = {"drive_id": self.drive_id, "parent_file_id": parent_file_id, 'fields': '', 'marker': next_marker}
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 34, in
drive_id = property(lambda self: next(self.drive_id_gen),
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 466, in _drive_id_gen
drive_id = self.get_drive_id()
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 449, in get_drive_id
drive_id = self.get_user_info().drive_id
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 157, in get_user_info
r = self._req.post(url, json={})
File "/opt/code/aliyunpan/aliyunpan/api/req.py", line 47, in post
return self._req('post', *args, **kwargs)
File "/opt/code/aliyunpan/aliyunpan/api/req.py", line 37, in _req
kwargs['headers']['Authorization'] = self.disk.access_token if self.disk else GLOBAL_VAR.access_token
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 32, in
access_token = property(lambda self: next(self.access_token_gen),
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 442, in _access_token_gen
access_token = self.get_access_token()
File "/opt/code/aliyunpan/aliyunpan/api/core.py", line 424, in get_access_token
raise InvalidRefreshToken
aliyunpan.exceptions.InvalidRefreshToken: Is not a valid refresh_token.
你好!
本项目之前在开发期间为了方便使用,我也将其编译成单文件二进制程序。今天原本想更新源码重新编译二进制文件,发现 releases 目前已经提供三大平台的可执行文件。
但是我发现一个问题,Releases 上的 linux 86_64 平台的是基于glibc较高版本的Python编译出来的,它无法在比构建平台低版本的glibc环境下运行(如 CentOS 7 x86_64),这无疑大范围降低了程序的兼容性,CentOS 7 目前在云计算平台依然具备不可替代的位置,使用频率还是很高的。
请问作者可否在构建 Linux x86_64 平台的程序时,使用glibc 版本更低的系统来构建呢?因为glibc 具备向下兼容的特性,高版本也同样允许运行低版本构建的程序。
这里是我自己编译的二进制程序,经测试,Ubuntu 20、CentOS 7 & 8、Debian 10 等系统均可正常工作。
请增加转存别人的分享文件的功能
refresh_token 怎么获取
最近上传文件,一直出错,大家有一样的情况吗?前几天还好的。
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
cnx.do_handshake()
File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 1828, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 1558, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (104, 'ECONNRESET')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 366, in connect
self.sock = ssl_wrap_socket(
File "/usr/lib/python3/dist-packages/urllib3/util/ssl.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: SysCallError(104, 'ECONNRESET')",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='auth.aliyundrive.com', port=443): Max retries exceeded with url: /v2/account/token (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')")))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/aliyunpan/main.py", line 183, in
cli()
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/root/aliyunpan/main.py", line 91, in upload
commander.upload(path_list, upload_path, time_out, retry, force, share, chunk_size, c)
File "/root/aliyunpan/aliyunpan/cli/cli.py", line 241, in upload
result = self._disk.upload_file(
File "/root/aliyunpan/aliyunpan/api/core.py", line 326, in upload_file
r = self.create_file(file_name=file_name, parent_file_id=parent_file_id, file_type=True, json=json,
File "/root/aliyunpan/aliyunpan/api/core.py", line 203, in create_file
"drive_id": self.drive_id,
File "/root/aliyunpan/aliyunpan/api/core.py", line 42, in
drive_id = property(lambda self: (self._lock.acquire(), next(self.drive_id_gen), self._lock.release())[1],
File "/root/aliyunpan/aliyunpan/api/core.py", line 559, in _drive_id_gen
drive_id = self.get_drive_id()
File "/root/aliyunpan/aliyunpan/api/core.py", line 542, in get_drive_id
drive_id = self.get_user_info().drive_id
File "/root/aliyunpan/aliyunpan/api/core.py", line 177, in get_user_info
r = self._req.post(url, json={})
File "/root/aliyunpan/aliyunpan/api/req.py", line 76, in post
return self._req('post', *args, **kwargs)
File "/root/aliyunpan/aliyunpan/api/req.py", line 46, in _req
kwargs['headers']['Authorization'] = self._disk.access_token if self._disk else GLOBAL_VAR.access_token
File "/root/aliyunpan/aliyunpan/api/core.py", line 40, in
access_token = property(lambda self: (self._lock.acquire(), next(self.access_token_gen), self._lock.release())[1],
File "/root/aliyunpan/aliyunpan/api/core.py", line 535, in _access_token_gen
access_token = self.get_access_token()
File "/root/aliyunpan/aliyunpan/api/core.py", line 513, in get_access_token
r = self._req.post(url, json=json, access_token=False)
File "/root/aliyunpan/aliyunpan/api/req.py", line 76, in post
return self._req('post', *args, **kwargs)
File "/root/aliyunpan/aliyunpan/api/req.py", line 47, in _req
r = getattr(self._session, method.lower())(*args, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 581, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='auth.aliyundrive.com', port=443): Max retries exceeded with url: /v2/account/token (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')")))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.