Closed chaopeng closed 10 years ago
会不会是 http://bypyoauth.appspot.com/ 被墙了? 试试用浏览器能不能访问:http://bypyoauth.appspot.com/273ed5ce9831b6dd6fd33265edfc1570 如果不能,可能是被墙了。
墙了。。。
翻墙拿了授权 上传报错
/bypy.py syncup /home/**/yun / -d
Token file: '/home/**/.bypy.json'
Hash Cache file: '/home/**/.bypy.pickle'
App root path at Baidu Yun '/apps/bypy'
sys.stdin.encoding = UTF-8
sys.stdout.encoding = UTF-8
----
<D> Token loaded:
<D> {u'access_token': u'21.17**************************92000.1396079324.4111405634-1572671', u'expires_in': 2592000, u'session_secret': u'c7aa*************88f4621f417b4', u'scope': u'basic netdisk', u'session_key': u'9mnRda6C**********************************Tg==', u'refresh_token': u'2*******************************************572671'}
<D> [16:03:02] Cache hit for file '/home/***/yun/1.txt',
md5: dd75ed975639f27bca44b3ad129552bc
size: 13
mtime: 1393487877
<D> F - 1.txt - size: 13 - md5: dd75ed975639f27bca44b3ad129552bc
<D> GET https://pcs.baidu.com/rest/2.0/pcs/file
<D> actargs: ([], [])
<D> Params: {u'path': u'/apps/bypy', u'order': u'asc', u'method': u'list', u'by': u'name'}
<D> HTTP Status Code: 200
<D> Request OK, processing action
<D> Request all goes fine
<D> Remote dirs: []
<D> Remote files: []
<D> ---- Remote Dir Contents ---
<D>
<D> '/home/**/yun/1.txt' is small and being non-slicing uploaded.
<D> POST https://c.pcs.baidu.com/rest/2.0/pcs/file
<D> actargs: /apps/bypy/1.txt
<D> Params: {u'path': u'/apps/bypy/1.txt', u'ondup': u'overwrite', u'method': u'upload'}
<E> [16:03:07] Error accessing 'https://c.pcs.baidu.com/rest/2.0/pcs/file'
<E> [16:03:07] Exception: [Errno 1] _ssl.c:509: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Traceback (most recent call last):
File "./bypy.py", line 804, in __request_work
params = parsnew, timeout = self.__timeout, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post
return request('post', url, data=data, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 335, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 438, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 331, in send
raise SSLError(e)
SSLError: [Errno 1] _ssl.c:509: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
贴下你的uname -a输出?
Linux ***-note 3.11.0-17-generic #31-Ubuntu SMP Mon Feb 3 21:52:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
哦,大概猜到了。 你还在翻墙(GoAgent?)状态跑吧?一旦拿到授权(得到~/.bypy.json),你就不用翻墙跑了。试试退出翻墙状态再跑? 如果是用GoAgent,问题应该出在他那个证书不是被信任的。
如果还不行,按照这个问答: https://stackoverflow.com/questions/17084886/ssl-error-routinesssl3-get-server-certificatecertificate-verify-failed
你搜索request.get和requests.post函数调用,在参数里面加上verify=False应该可以解决这个问题吧。
暂时不想改动是因为百度的证书是没问题的。
goagent是关掉了,改verify=False可以,但是总觉得有点不科学。。。
是啊,我也觉得不科学,这个问题我从来没遇见过。你试下用浏览器直接访问:https://c.pcs.baidu.com/rest/2.0/pcs/file 会有证书警告吗?
没有警告
这个东西可以放在国内吗?
可以考虑,国内哪个好一些?sae, bae? 访问量不大,一个访问就一两个HTTP 请求,免费的账号够用不?谁有经验?
墙有点深井,我在两个地方试过可以的,但貌似很多地方还是不行。。
嗯, sae免费的绝对够用
@heimi 这样啊,好的,我去看看。 谢谢推荐。
开通PCS API权限难审核吗?
当初根本不用审核,直接网页点两下就可以了。现在好像百度暂时不给申请了,说是调整中。
能快点迁个地方吗?不能用啊,翻墙了还是不成功
好吧,我尽量快点迁移了,现在还刚刚开始熟悉bae的环境。好像openshift.com也可以考虑,谁知道在上面搭建的网站墙了没? 翻了墙还不能用?能贴下bypy.py -d -v quota的输出吗?
@houtianze 现在翻墙后可以了,是我的vpn的问题 另外发现下载文件有点问题:
@huangchanghu
我测的是下载一个视频文件,我强制停止的时候内存占用500多兆了
houtianze notifications@github.com编写:
@huangchanghu
是先到内存,但应该不会占用很多,缺省是10M一存,内纯用量超过很多吗?不过我主要上传了,没怎么测试大文件下载。单个文件下载现在是没有进度的,不过下载一个目录,加-v应该会显示下载的文件。
— Reply to this email directly or view it on GitHub.
这样的啊,看来是个大bug,我去看看。
@huangchanghu 下载狂吃内存的bug应该解决了。调试输出代码造成。。
@houtianze 试了,ok了。很赞~~加油哈,希望后续更完善些。比如可以借鉴借鉴迅雷离线的这个项目:iambus / xunlei-lixian
好的,谢谢鼓励:) 准备把授权部分搬移到不被墙的服务器上去。
加了一个现在貌似还未被墙的服务器,暂时墙内应该可以用了。