Browse files

fix encoding bug

  • Loading branch information...
1 parent 2163dde commit 129b4a73b278044c0390134deea02c8d319dfccc Binux committed Jun 17, 2012
Showing with 15 additions and 15 deletions.
  1. +15 −15 libs/lixian_api.py
View
30 libs/lixian_api.py
@@ -175,7 +175,7 @@ def bt_task_check(self, url):
if r.error:
r.raise_for_status()
#queryUrl(flag,infohash,fsize,bt_title,is_full,subtitle,subformatsize,size_list,valid_list,file_icon,findex,random)
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
if len(args) < 12:
return {}
@@ -249,7 +249,7 @@ def task_check(self, url):
if r.error:
r.raise_for_status()
#queryCid(cid,gcid,file_size,avail_space,tname,goldbean_need,silverbean_need,is_full,random)
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
if len(args) < 8:
return {}
@@ -427,7 +427,7 @@ def _get_bt_list(self, tid, cid):
, cookies=dict(pagenum=2000))
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
if not args:
return {}
@@ -463,7 +463,7 @@ def delay_task(self, task_ids):
cachetime = self._now))
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
if args and args[0].get("result") == 1:
@@ -479,7 +479,7 @@ def delete_task(self, task_ids):
"noCacheIE": self._now})
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
if args and args[0].get("result") == 1:
@@ -529,7 +529,7 @@ def get_wait_time(self, task_id, key=None):
r = self.session.get(self.GET_WAIT_TIME_URL, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0] if args else {}
@@ -550,7 +550,7 @@ def get_free_url(self, nm_list=[], bt_list=[]):
r = self.session.get(self.GET_FREE_URL, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0] if args else {}
@@ -568,7 +568,7 @@ def get_task_process(self, nm_list=[], bt_list=[], with_summary=False):
r = self.session.get(self.GET_TASK_PROCESS, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
args = args[0]
@@ -627,7 +627,7 @@ def share(self, emails, tasks, msg="", task_list=None):
if r.error:
r.raise_for_status()
#forward_res(1,"ok",649513164808429);
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
if args and args[0] == 1:
@@ -640,7 +640,7 @@ def check_login(self):
r = self.session.get(self.CHECK_LOGIN_URL)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
if args and args[0].get("result") == 1:
@@ -705,7 +705,7 @@ def vod_get_play_url(self, url, bindex=-1):
r = self.session.get(self.VOD_GET_PLAY_URL, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0]
@@ -730,7 +730,7 @@ def vod_get_list_pic(self, gcids):
r = self.session.get(self.VOD_GET_LIST_PIC, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0]
@@ -750,7 +750,7 @@ def vod_get_bt_pic(self, cid, bindex=[]):
r = self.session.get(self.VOD_GET_BT_PIC % params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0].get("resp", {})
@@ -767,7 +767,7 @@ def vod_get_process(self, url_list):
r = self.session.get(self.VOD_GET_PROCESS, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0]
@@ -815,7 +815,7 @@ def get_vip_info(self):
r = self.session.get(self.VIP_INFO_URL, params=params)
if r.error:
r.raise_for_status()
- function, args = parser_js_function_call(r.text)
+ function, args = parser_js_function_call(r.content)
DEBUG(pformat(args))
assert args
return args[0]

0 comments on commit 129b4a7

Please sign in to comment.