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

百度网盘上传,本地文件名中含有冒号(:)就会上传失败. #123

Open
lwl5219 opened this issue Sep 17, 2017 · 1 comment
Open

Comments

@lwl5219
Copy link

lwl5219 commented Sep 17, 2017

使用脚本上传文件时, 如果文件名中含有冒号(:),就会报错, 把文件名改了之后就会上传成功.

  ++ uploading: /home/lwl/readfree/dbook/c-革命的年代:1789~1848.mobi
  |-- upload_function: _rapidupload_file
  |-- can't be RapidUploaded, now trying normal uploading.
  |-- upload_function: _upload_one_file
Traceback (most recent call last):
  File "/usr/local/bin/bp", line 3610, in <module>
    main(argv)
  File "/usr/local/bin/bp", line 3606, in main
    handle_command(comd, xxx)
  File "/usr/local/bin/bp", line 3208, in handle_command
    px.upload(xxx[:-1], xxx[-1])
  File "/usr/local/bin/bp", line 1477, in upload
    self._upload_dir(lpath, rpath)
  File "/usr/local/bin/bp", line 1439, in _upload_dir
    self._upload_file(localpath, remotepath)
  File "/usr/local/bin/bp", line 1383, in _upload_file
    result = self._upload_one_file(lpath, rpath)
  File "/usr/local/bin/bp", line 1175, in _upload_one_file
    r = ss.post(url, params=p, data=data, verify=VERIFY, headers=theaders)
  File "/usr/lib/python2.7/site-packages/requests-2.17.3-py2.7.egg/requests/sessions.py", line 560, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests-2.17.3-py2.7.egg/requests/sessions.py", line 513, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/site-packages/requests-2.17.3-py2.7.egg/requests/sessions.py", line 623, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests-2.17.3-py2.7.egg/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error("(104, 'ECONNRESET')",))
@PeterDing
Copy link
Owner

我这里倒是没报 requests.exceptions.ConnectionError,但是服务器报错,file name is invalid 文件名无效,也就是百度不支持文件带 : 吧。

  ++ uploading: /private/tmp/t/c-革命的年代:1789~1848.mobi
  |-- upload_function: _upload_one_file

  !! Error at _upload_one_file: {u'error_code': 31062, u'error_msg': u'file name is invalid', u'request_id': }

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