Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (35 sloc) 1.26 KB
# -*- encoding: utf-8 -*-
# author: binux<>
from sys import argv, stderr
from libs.lixian_api import LiXianAPI
if len(argv) != 3:
print "usage: user_list test_task"
fp = open(argv[1], "r")
for line in fp:
line = line.strip()
username, password = line.split()
xunlei = LiXianAPI()
if not xunlei.login(username, password):
print >> stderr, username, "login error"
info = xunlei.get_vip_info()
print >> stderr, username, "expiredate:", info.get("expiredate", "unknow"), "level:", info.get("level", "0")
#tasks = xunlei.get_task_list(10, 2)
tasks = None
if not tasks:
tasks = xunlei.get_task_list(10, 0)
if not tasks:
print >> stderr, username, "add task error"
tid = 0
for task in tasks:
if task['task_type'] == 'normal':
if not tid and task['lixian_url']:
#tid = task['task_id']
elif task['task_type'] in ['bt', 'magenet']:
for file in xunlei.get_bt_list(task['task_id'], task['cid']):
if not tid and file['lixian_url']:
tid = file['task_id']
print "%s:%s:%s" % (xunlei.uid, xunlei.gdriveid, tid)
Something went wrong with that request. Please try again.