Closed EmWillWei closed 2 years ago
pyenv python 2.7.15 works
Thanks for the feedback. So it confirms that bypy
doesn't work under Python 3.7.11
? Could you help paste the log of bypy -dv info
?
(base) ➜ Audio which python
/home/vimos/anaconda3/bin/python
(base) ➜ Audio python --version
Python 3.8.8
(base) ➜ Audio pip install bypy -U
Requirement already satisfied: bypy in /home/vimos/anaconda3/lib/python3.8/site-packages (1.7.2)
Collecting bypy
Downloading bypy-1.7.12-py2.py3-none-any.whl (241 kB)
|████████████████████████████████| 241 kB 8.6 MB/s
Requirement already satisfied: requests-toolbelt in /home/vimos/anaconda3/lib/python3.8/site-packages (from bypy) (0.9.1)
Requirement already satisfied: multiprocess in /home/vimos/anaconda3/lib/python3.8/site-packages (from bypy) (0.70.12.2)
Requirement already satisfied: requests in /home/vimos/anaconda3/lib/python3.8/site-packages (from bypy) (2.25.1)
Requirement already satisfied: dill>=0.3.4 in /home/vimos/anaconda3/lib/python3.8/site-packages (from multiprocess->bypy) (0.3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/vimos/anaconda3/lib/python3.8/site-packages (from requests->bypy) (1.26.4)
Requirement already satisfied: idna<3,>=2.5 in /home/vimos/anaconda3/lib/python3.8/site-packages (from requests->bypy) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in /home/vimos/anaconda3/lib/python3.8/site-packages (from requests->bypy) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in /home/vimos/anaconda3/lib/python3.8/site-packages (from requests->bypy) (2021.10.8)
Installing collected packages: bypy
Attempting uninstall: bypy
Found existing installation: bypy 1.7.2
Uninstalling bypy-1.7.2:
Successfully uninstalled bypy-1.7.2
Successfully installed bypy-1.7.12
(base) ➜ Audio bypy download zhvoice
<I> [07:44:21] info.zip <- /apps/bypy/zhvoice/info.zip
<E> [07:44:23] Waiting 10 seconds before retrying...
<E> [07:44:33] Request Try #2 / 5
<E> [07:44:35] Waiting 20 seconds before retrying...
<E> [07:44:55] Request Try #3 / 5
<E> [07:44:56] Waiting 30 seconds before retrying...
<E> [07:45:26] Request Try #4 / 5
<E> [07:45:27] Waiting 40 seconds before retrying...
<E> [07:46:07] Request Try #5 / 5
<E> [07:46:08] Maximum number (5) of tries failed.
<I> [07:46:08] metadata.csv <- /apps/bypy/zhvoice/metadata.csv
<E> [07:46:11] Waiting 10 seconds before retrying...
<E> [07:46:21] Request Try #2 / 5
<E> [07:46:22] Waiting 20 seconds before retrying...
<E> [07:46:42] Request Try #3 / 5
<E> [07:46:43] Waiting 30 seconds before retrying...
<E> [07:47:13] Request Try #4 / 5
<E> [07:47:14] Waiting 40 seconds before retrying...
<E> [07:47:54] Request Try #5 / 5
<E> [07:47:55] Maximum number (5) of tries failed.
<I> [07:47:55] readme.md <- /apps/bypy/zhvoice/readme.md
<E> [07:47:57] Waiting 10 seconds before retrying...
<E> [07:48:07] Request Try #2 / 5
<E> [07:48:08] Waiting 20 seconds before retrying...
<E> [07:48:28] Request Try #3 / 5
<E> [07:48:29] Waiting 30 seconds before retrying...
<E> [07:48:59] Request Try #4 / 5
<E> [07:49:00] Waiting 40 seconds before retrying...
<E> [07:49:40] Request Try #5 / 5
<E> [07:49:41] Maximum number (5) of tries failed.
<I> [07:49:41] sample.zip <- /apps/bypy/zhvoice/sample.zip
cd <E> [07:49:43] Waiting 10 seconds before retrying...
<E> [07:49:53] Request Try #2 / 5
<E> [07:49:55] Waiting 20 seconds before retrying...
<E> [07:50:15] Request Try #3 / 5
<E> [07:50:16] Waiting 30 seconds before retrying...
<E> [07:50:46] Request Try #4 / 5
<E> [07:50:47] Waiting 40 seconds before retrying...
<E> [07:51:27] Request Try #5 / 5
<E> [07:51:28] Maximum number (5) of tries failed.
<I> [07:51:28] text.zip <- /apps/bypy/zhvoice/text.zip
<E> [07:51:30] Waiting 10 seconds before retrying...
<E> [07:51:40] Request Try #2 / 5
<E> [07:51:42] Waiting 20 seconds before retrying...
<E> [07:52:02] Request Try #3 / 5
<E> [07:52:03] Waiting 30 seconds before retrying...
<E> [07:52:33] Request Try #4 / 5
<E> [07:52:35] Waiting 40 seconds before retrying...
<E> [07:53:15] Request Try #5 / 5
<E> [07:53:16] Maximum number (5) of tries failed.
<I> [07:53:16] zhaidatatang.zip <- /apps/bypy/zhvoice/zhaidatatang.zip
<E> [07:53:18] Waiting 10 seconds before retrying...
<E> [07:53:28] Request Try #2 / 5
<E> [07:53:29] Waiting 20 seconds before retrying...
<E> [07:53:49] Request Try #3 / 5
<E> [07:53:50] Waiting 30 seconds before retrying...
<E> [07:54:20] Request Try #4 / 5
<E> [07:54:21] Waiting 40 seconds before retrying...
<E> [07:55:01] Request Try #5 / 5
<E> [07:55:02] Maximum number (5) of tries failed.
<I> [07:55:02] zhaishell.zip <- /apps/bypy/zhvoice/zhaishell.zip
<E> [07:55:04] Waiting 10 seconds before retrying...
<E> [07:55:14] Request Try #2 / 5
<E> [07:55:16] Waiting 20 seconds before retrying...
<E> [07:55:36] Request Try #3 / 5
<E> [07:55:37] Waiting 30 seconds before retrying...
<E> [07:56:07] Request Try #4 / 5
<E> [07:56:08] Waiting 40 seconds before retrying...
<E> [07:56:48] Request Try #5 / 5
<E> [07:56:49] Maximum number (5) of tries failed.
<I> [07:56:49] zhbznsyp.zip <- /apps/bypy/zhvoice/zhbznsyp.zip
<E> [07:56:51] Waiting 10 seconds before retrying...
<E> [07:57:01] Request Try #2 / 5
<E> [07:57:02] Waiting 20 seconds before retrying...
<E> [07:57:22] Request Try #3 / 5
<E> [07:57:24] Waiting 30 seconds before retrying...
<E> [07:57:54] Request Try #4 / 5
<E> [07:57:55] Waiting 40 seconds before retrying...
<E> [07:58:35] Request Try #5 / 5
<E> [07:58:36] Maximum number (5) of tries failed.
<I> [07:58:36] zhmagicdata.z01 <- /apps/bypy/zhvoice/zhmagicdata.z01
<E> [07:58:38] Waiting 10 seconds before retrying...
<E> [07:58:48] Request Try #2 / 5
<E> [07:58:49] Waiting 20 seconds before retrying...
<E> [07:59:09] Request Try #3 / 5
<E> [07:59:11] Waiting 30 seconds before retrying...
<E> [07:59:41] Request Try #4 / 5
<E> [07:59:42] Waiting 40 seconds before retrying...
<E> [08:00:22] Request Try #5 / 5
<E> [08:00:23] Maximum number (5) of tries failed.
<I> [08:00:23] zhmagicdata.z02 <- /apps/bypy/zhvoice/zhmagicdata.z02
<E> [08:00:25] Waiting 10 seconds before retrying...
<E> [08:00:35] Request Try #2 / 5
<E> [08:00:36] Waiting 20 seconds before retrying...
<E> [08:00:56] Request Try #3 / 5
<E> [08:00:57] Waiting 30 seconds before retrying...
<E> [08:01:27] Request Try #4 / 5
<E> [08:01:28] Waiting 40 seconds before retrying...
<E> [08:02:08] Request Try #5 / 5
<E> [08:02:09] Maximum number (5) of tries failed.
<I> [08:02:09] zhmagicdata.zip <- /apps/bypy/zhvoice/zhmagicdata.zip
<E> [08:02:11] Waiting 10 seconds before retrying...
<E> [08:02:21] Request Try #2 / 5
<E> [08:02:24] Waiting 20 seconds before retrying...
<E> [08:02:44] Request Try #3 / 5
<E> [08:02:45] Waiting 30 seconds before retrying...
<E> [08:03:15] Request Try #4 / 5
<E> [08:03:16] Waiting 40 seconds before retrying...
<E> [08:03:56] Request Try #5 / 5
<E> [08:03:58] Maximum number (5) of tries failed.
<I> [08:03:58] zhprimewords.zip <- /apps/bypy/zhvoice/zhprimewords.zip
<E> [08:04:00] Waiting 10 seconds before retrying...
<E> [08:04:10] Request Try #2 / 5
<E> [08:04:11] Waiting 20 seconds before retrying...
<E> [08:04:31] Request Try #3 / 5
<E> [08:04:32] Waiting 30 seconds before retrying...
<E> [08:05:02] Request Try #4 / 5
<E> [08:05:04] Waiting 40 seconds before retrying...
<E> [08:05:44] Request Try #5 / 5
<E> [08:05:45] Maximum number (5) of tries failed.
<I> [08:05:45] zhspeechocean.zip <- /apps/bypy/zhvoice/zhspeechocean.zip
<E> [08:05:47] Waiting 10 seconds before retrying...
<E> [08:05:57] Request Try #2 / 5
<E> [08:05:58] Waiting 20 seconds before retrying...
<E> [08:06:18] Request Try #3 / 5
<E> [08:06:20] Waiting 30 seconds before retrying...
<E> [08:06:50] Request Try #4 / 5
<E> [08:06:51] Waiting 40 seconds before retrying...
<E> [08:07:31] Request Try #5 / 5
<E> [08:07:32] Maximum number (5) of tries failed.
<I> [08:07:32] zhstcmds.zip <- /apps/bypy/zhvoice/zhstcmds.zip
<E> [08:07:34] Waiting 10 seconds before retrying...
<E> [08:07:44] Request Try #2 / 5
<E> [08:07:45] Waiting 20 seconds before retrying...
<E> [08:08:05] Request Try #3 / 5
<E> [08:08:07] Waiting 30 seconds before retrying...
<E> [08:08:37] Request Try #4 / 5
<E> [08:08:38] Waiting 40 seconds before retrying...
<E> [08:09:18] Request Try #5 / 5
<E> [08:09:19] Maximum number (5) of tries failed.
<I> [08:09:19] zhthchs30.zip <- /apps/bypy/zhvoice/zhthchs30.zip
<E> [08:09:21] Waiting 10 seconds before retrying...
<E> [08:09:31] Request Try #2 / 5
<E> [08:09:32] Waiting 20 seconds before retrying...
<E> [08:09:52] Request Try #3 / 5
<E> [08:09:54] Waiting 30 seconds before retrying...
<E> [08:10:24] Request Try #4 / 5
<E> [08:10:25] Waiting 40 seconds before retrying...
<E> [08:11:05] Request Try #5 / 5
<E> [08:11:06] Maximum number (5) of tries failed.
<E> [08:11:06] ----------------------------------------------------------------
Error 140: Maximum retries reached
After this process, it seems there are unfinished downloads.
(base) ➜ zhvoice ll
total 7.4G
-rw-rw-r-- 1 vimos vimos 1.5M Sep 4 2020 info.zip
-rw-rw-r-- 1 vimos vimos 88M Sep 4 2020 metadata.csv
-rw-rw-r-- 1 vimos vimos 6.5K Sep 4 2020 readme.md
-rw-rw-r-- 1 vimos vimos 28M Sep 4 2020 sample.zip
-rw-rw-r-- 1 vimos vimos 115M Sep 4 2020 text.zip
-rw-rw-r-- 1 vimos vimos 1.5G Sep 4 2020 zhaidatatang.zip
-rw-rw-r-- 1 vimos vimos 1.4G Sep 4 2020 zhaishell.zip
-rw-rw-r-- 1 vimos vimos 105M Sep 4 2020 zhbznsyp.zip
-rw-rw-r-- 1 vimos vimos 1.5G Sep 4 2020 zhmagicdata.z01
-rw-rw-r-- 1 vimos vimos 1.5G Sep 4 2020 zhmagicdata.z02
-rw-rw-r-- 1 vimos vimos 811M Sep 4 2020 zhprimewords.zip
-rw-rw-r-- 1 vimos vimos 19M Sep 4 2020 zhspeechocean.zip
-rw-rw-r-- 1 vimos vimos 146M Sep 8 2020 zhstcmds.zip.baiduyun.p.downloading
-rw-rw-r-- 1 vimos vimos 276M Sep 4 2020 zhthchs30.zip
Thanks for the feedback. So it confirms that
bypy
doesn't work under Python3.7.11
? Could you help paste the log ofbypy -dv info
?
[root@iZ0xibcz15pg2jwm5lbhboZ ~]# pyenv global 2.7.15
[root@iZ0xibcz15pg2jwm5lbhboZ ~]# bypy info
Quota: 2.007TB
Used: 309.406GB
[root@iZ0xibcz15pg2jwm5lbhboZ ~]# bypy -dv info
<D> Auth servers loaded: {u'AuthServerList': [[u'https://bypyoa.vercel.app/api/auth', False, u'Authorizing with the Vercel server ...'], [u'https://qcfpba.api.cloudendpoint.cn/auth', False, u'Vercel server failed, Authorizing with the cloudendpoint server ...'], [u'https://8.142.131.12/auth', False, u'Vercel server failed. Last resort: authorizing with the Aliyun server ...']], u'RefreshServerList': [[u'https://bypyoa.vercel.app/api/refresh', False, u'Refreshing with the Vercel server ...'], [u'https://qcfpba.api.cloudendpoint.cn/refresh', False, u'Vercel server failed, Refreshing with the cloudendpoint server ...'], [u'https://8.142.131.12/refresh', False, u'Vercel server failed. Last resort: refreshing with the Aliyun server ...']]}
<D> [17:07:55] Using requests.packages.urllib3 to disable warnings
<D> [17:07:55] Using urllib3 to disable warnings
Loading Hash Cache File '/root/.bypy/bypy.hashcache.json'...
Hash Cache File loaded.
----
Verbose level = 1
Debug level = 1
Config directory: '/root/.bypy'
Token file: '/root/.bypy/bypy.json'
Hash Cache file: '/root/.bypy/bypy.hashcache.json'
App root path at Baidu Yun '/apps/bypy'
sys.stdin.encoding = UTF-8
sys.stdout.encoding = UTF-8
sys.stderr.encoding = UTF-8
----
<D> Token loaded:
<D> {u'access_token': u'121.e9551dad1d287fe512bf74eab10235f3.YnnivCPWhlOEy9SEn1EnsAJEGiWozYv2zAGxLoS.wOpYsg', u'expires_in': 2592000, u'session_secret': u'', u'scope': u'basic netdisk', u'session_key': u'', u'refresh_token': u'122.29dc52d751987a55d59f293ab1debe39.YnEod6CeJ-HMKTnDRSiyQ7DADhLZoYQXMDU1bTp.wW5XXw'}
<D> GET https://pcs.baidu.com/rest/2.0/pcs/quota
<D> actargs: None
<D> Params: {u'method': u'info'}
<D> Full URL: https://pcs.baidu.com/rest/2.0/pcs/quota?access_token=121.e9551dad1d287fe512bf74eab10235f3.YnnivCPWhlOEy9SEn1EnsAJEGiWozYv2zAGxLoS.wOpYsg&method=info
<D> HTTP Status Code: 200
<D> 200 OK, processing action
Quota: 2.007TB
Used: 309.406GB
<D> Request OK
Skip saving Hash Cache since it has not been updated.
[root@iZ0xibcz15pg2jwm5lbhboZ ~]# pyenv global 3.7.11
[root@iZ0xibcz15pg2jwm5lbhboZ ~]# bypy -dv info
<D> Auth servers loaded: {'AuthServerList': [['https://bypyoa.vercel.app/api/auth', False, 'Authorizing with the Vercel server ...'], ['https://qcfpba.api.cloudendpoint.cn/auth', False, 'Vercel server failed, Authorizing with the cloudendpoint server ...'], ['https://8.142.131.12/auth', False, 'Vercel server failed. Last resort: authorizing with the Aliyun server ...']], 'RefreshServerList': [['https://bypyoa.vercel.app/api/refresh', False, 'Refreshing with the Vercel server ...'], ['https://qcfpba.api.cloudendpoint.cn/refresh', False, 'Vercel server failed, Refreshing with the cloudendpoint server ...'], ['https://8.142.131.12/refresh', False, 'Vercel server failed. Last resort: refreshing with the Aliyun server ...']]}
<D> [17:08:24] Using requests.packages.urllib3 to disable warnings
<D> [17:08:24] Using urllib3 to disable warnings
Loading Hash Cache File '/root/.bypy/bypy.hashcache.json'...
Hash Cache File loaded.
----
Verbose level = 1
Debug level = 1
Config directory: '/root/.bypy'
Token file: '/root/.bypy/bypy.json'
Hash Cache file: '/root/.bypy/bypy.hashcache.json'
App root path at Baidu Yun '/apps/bypy'
sys.stdin.encoding = UTF-8
sys.stdout.encoding = UTF-8
sys.stderr.encoding = UTF-8
----
<D> Token loaded:
<D> {'access_token': '121.e9551dad1d287fe512bf74eab10235f3.YnnivCPWhlOEy9SEn1EnsAJEGiWozYv2zAGxLoS.wOpYsg', 'expires_in': 2592000, 'refresh_token': '122.29dc52d751987a55d59f293ab1debe39.YnEod6CeJ-HMKTnDRSiyQ7DADhLZoYQXMDU1bTp.wW5XXw', 'scope': 'basic netdisk', 'session_key': '', 'session_secret': ''}
<D> GET https://pcs.baidu.com/rest/2.0/pcs/quota
<D> actargs: None
<D> Params: {'method': 'info'}
<E> [17:08:24] Error accessing 'https://pcs.baidu.com/rest/2.0/pcs/quota'
<E> [17:08:24] Exception:
<class 'requests.exceptions.InvalidHeader'> - Value for header {User-Agent: None} must be of type str or bytes, not <class 'NoneType'>
Stack:
File "/root/.pyenv/versions/3.7.11/bin/bypy", line 8, in <module>
sys.exit(main())
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 3822, in main
result = getattr(by, args.command[0])(*uargs)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 1206, in info
return self.quota()
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 1212, in quota
return self.__get(pcsurl + 'quota', pars, self.__quota_act)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 882, in __get
return self.__request(url, pars, act, 'GET', actargs, retry, addtoken, dumpex, **kwargs)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 860, in __request
result = self.__request_work(url, pars, act, method, actargs, addtoken, dumpex, **kwnew)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 812, in __request_work
self.__dump_exception(ex, url, pars, r, act)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 615, in __dump_exception
perr(formatex(ex))
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/util.py", line 73, in formatex
type(ex), ex, ''.join(traceback.format_stack()))
<E> [17:08:24] Function: __quota_act
<E> [17:08:24] Website parameters: {'method': 'info'}
<E> [17:08:24] Waiting 10 seconds before retrying...
<E> [17:08:34] Request Try #2 / 5
<D> GET https://pcs.baidu.com/rest/2.0/pcs/quota
<D> actargs: None
<D> Params: {'method': 'info'}
<E> [17:08:34] Error accessing 'https://pcs.baidu.com/rest/2.0/pcs/quota'
<E> [17:08:34] Exception:
<class 'requests.exceptions.InvalidHeader'> - Value for header {User-Agent: None} must be of type str or bytes, not <class 'NoneType'>
Stack:
File "/root/.pyenv/versions/3.7.11/bin/bypy", line 8, in <module>
sys.exit(main())
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 3822, in main
result = getattr(by, args.command[0])(*uargs)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 1206, in info
return self.quota()
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 1212, in quota
return self.__get(pcsurl + 'quota', pars, self.__quota_act)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 882, in __get
return self.__request(url, pars, act, 'GET', actargs, retry, addtoken, dumpex, **kwargs)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 860, in __request
result = self.__request_work(url, pars, act, method, actargs, addtoken, dumpex, **kwnew)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 812, in __request_work
self.__dump_exception(ex, url, pars, r, act)
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/bypy.py", line 615, in __dump_exception
perr(formatex(ex))
File "/root/.pyenv/versions/3.7.11/lib/python3.7/site-packages/bypy/util.py", line 73, in formatex
type(ex), ex, ''.join(traceback.format_stack()))
<E> [17:08:34] Function: __quota_act
<E> [17:08:34] Website parameters: {'method': 'info'}
<E> [17:08:34] Waiting 20 seconds before retrying...
^CSignal 2 received, Abort
Seems it crashed because its user agent is None
It works now after I upgrade the requests :)
It works now after I upgrade the requests :)
Could you possibily tell me how to upgrade the requests IN DETAIL? Cos I‘ve met the same problems, but I have no idea how to fix it. Many thanks!
It works now after I upgrade the requests :)
Could you possibily tell me how to upgrade the requests IN DETAIL? Cos I‘ve met the same problems, but I have no idea how to fix it. Many thanks!
pip install -U requests
or just reinstall pip uninstall requests && pip install requests