def __init__(self, username, password): self.username = username self.password = password self._last_update_all_task = 0 self._last_update_downloading_task = 0 self._last_get_task_list = 0 #fix for _last_get_task_list self.time = time self._last_update_task = 0 self._last_update_task_size = 0 self._last_update_task_lock = Lock() self._xunlei = LiXianAPI() _verifycode = self._xunlei._get_verifycode(self.username) if not _verifycode: with open('verifycode.jpg', 'w') as verifycode_fp: verifycode_fp.write(self._xunlei.verifycode()) _verifycode = raw_input( 'Please open ./verifycode.jpg and enter the verifycode: ') self.islogin = self._xunlei.login(self.username, self.password, _verifycode) self._last_login = time() self._last_check_login = time()
def __init__(self, username, password): self.username = username self.password = password self._last_check_login = 0 self._last_update_task = 0 self._last_update_downloading_task = 0 self._last_get_task_list = 0 #fix for _last_get_task_list self.time = time self._xunlei = LiXianAPI() self.last_task_id = 0 self.islogin = self._xunlei.login(self.username, self.password) self._last_check_login = time()
def __init__(self, username, password): self.username = username self.password = password self._last_check_login = 0 self._tasks = dict() self._task_list = deque() self._task_urls = set() self._last_update_task_list = 0 self._file_list = dict() self._xunlei = LiXianAPI() self.islogin = self._xunlei.login(self.username, self.password) self._last_check_login = time()
from libs.lixian_api import LiXianAPI CID = "9AD622F6EE572E367A37A166D7BD5AA8279A68D4" URL = "magnet:?xt=urn:btih:9ad622f6ee572e367a37a166d7bd5aa8279a68d4" if len(argv) != 2: print "usage: vip_check.py user_list" fp = open(argv[1], "r") for line in fp: try: line = line.strip() if not line: continue username, password = line.split() xunlei = LiXianAPI() if not xunlei.login(username, password): print >> stderr, username, "login error" continue else: 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) tid = 0 lixian_url = "" for task in tasks: if task['cid'] == CID: for file in xunlei.get_bt_list(task['task_id'], task['cid']): tid = file['task_id'] lixian_url = file['lixian_url']