115 Wangpan is an unofficial Python API for 115.com, mainly pertinent to its "lixian" (offline) features. Currently, only limited features have been implemented. Supported Python verisons are 2.6, 2.7 and 3.3.
- Documentation: http://115wangpan.readthedocs.org
- GitHub: https://github.com/shichao-an/115wangpan
- PyPI: https://pypi.python.org/pypi/115wangpan/
- Authentication
- Tasks management (BitTorrent currently supported)
- File management
Install dependencies before installing the python package:
Ubuntu
$ sudo apt-get install libcurl4-openssl-dev python-dev
Fedora
$ sudo yum groupinstall "Development Tools"
$ sudo yum install libcurl libcurl-devel python-devel
Then, you can install with pip:
$ pip install 115wangpan
>>> import u115
>>> api = u115.API()
>>> api.login('username@example.com', 'password')
True
>>> tasks = api.get_tasks()
>>> task = tasks[0]
>>> print task.name
episode of side-A
>>> print task.status_human
TRANSFERRED
>>> print task.size_human
1.6 GiB
>>> files = task.list()
>>> files
[<File: ep8 xxx.mkv>]
>>> f = files[0]
>>> f.get_download_url()
u'http://cdnuni.115.com/some-very-long-url.mkv'
>>> f.directory
<Directory: episode of side-A>
>>> f.directory.parent
<Directory: offline download>
- 115wangpan-dl: file download script
- 115wangpan-up: torrent upload script