Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adieu committed Dec 4, 2011
1 parent 61c3a6f commit 00291ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
API Usage
=========

Create a Xunlei object
Create a Xunlei object::

import xunlei
xunlei_obj = xunlei.Xunlei(USERNAME, PASSWORD, COOKIE_FILE_PATH)

List Xunlei lixian tasks
List Xunlei lixian tasks::

items = xunlei_obj.dashboard()

List a bittorrent task
List a bittorrent task::

items = xunlei_obj.list_bt(url, task_id) # url and task_id are from dashboard() function

Download a task
Download a task::

xunlei_obj.dowload(url, filename)

Download a task with file size checking and resume
Download a task with file size checking and resume::

xunlei_obj.smart_download(url, filename, size)


CLI Usage
=========

Edit config file at `~/xunleirc`, add settings for `username` and `password`
Edit config file at ``~/xunleirc``, add settings for ``username`` and ``password``

List xunlei tasks
List xunlei tasks::

xunlei_cli dashboard

Download a task
Download a task::

xunlei_cli download TASK_ID

0 comments on commit 00291ce

Please sign in to comment.