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

上传东西报错 #10

Closed
renrenlinux opened this issue Feb 19, 2015 · 1 comment
Closed

上传东西报错 #10

renrenlinux opened this issue Feb 19, 2015 · 1 comment
Labels

Comments

@renrenlinux
Copy link

谢谢你写的这个代码,今天用这个代码上传东西的时候报错,下面是我的代码:
import u115

api = u115.API()

api.login('usename', 'password')

u = api.upload('/root/sh/115/115_cookies.txt')

报下面的错误:
Traceback (most recent call last):
File "../115/115.py", line 10, in
u = api.upload('/root/sh/115/115_cookies.txt')
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 306, in upload
directory = self.downloads_directory
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 214, in downloads_directory
self._load_lixian_space()
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 618, in _load_lixian_space
self._torrents_directory = self._load_directory(torrent_cid)
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 608, in _load_directory
kwargs = self._req_directory(cid)
File "/usr/local/lib/python2.7/dist-packages/u115/api.py", line 511, in _req_directory
raise RequestFailure('No directory found.')
u115.api.RequestFailure: No directory found.

不知道怎么回事?还有请问在用api.upload 函数上传文件的时候,后面的directory 要怎么写,比如我要上传文件到movie文件夹,directory要怎么写?

@shichao-an
Copy link
Owner

你好。

“No directory found” 这应该是个 bug。我会修复关于默认“离线下载”文件夹和“种子文件”的位置确认。

关于上传文件到自建文件夹,目前支持的还不好。通过指定 Directory(比如“离线下载”文件夹,就是 api.downloads_directory)的 parent 或者 children 文件夹。你可以参见这里http://115wangpan.readthedocs.org/en/latest/quickstart.html#upload-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants