From 1a42467a70f4a903645083b7368cd839444e6236 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Thu, 31 Jan 2019 15:06:36 +0800 Subject: [PATCH] fix iqiyi list --- wwqLyParse/common/threadpool.py | 3 +++ wwqLyParse/parsers/iqiyilistparser.py | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/wwqLyParse/common/threadpool.py b/wwqLyParse/common/threadpool.py index 501ce1a..796455f 100644 --- a/wwqLyParse/common/threadpool.py +++ b/wwqLyParse/common/threadpool.py @@ -69,3 +69,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): @staticmethod def wait(wait_list, timeout=None): return wait(wait_list, timeout=timeout) + + +__all__ = ["ThreadPool"] diff --git a/wwqLyParse/parsers/iqiyilistparser.py b/wwqLyParse/parsers/iqiyilistparser.py index ec31a88..13dcf38 100644 --- a/wwqLyParse/parsers/iqiyilistparser.py +++ b/wwqLyParse/parsers/iqiyilistparser.py @@ -156,12 +156,14 @@ async def _check_support(self, input_text): else: logging.debug("%s ignore by cid: %s" % (str(self), cid)) return False - elif self.TAKE_CARE_CID_TYPE == "EXCLUDE": + elif self.TAKE_CARE_CID_TYPE == "EXCLUDE": if cid is None or cid != self.TAKE_CARE_CID: return True else: logging.debug("%s ignore by cid: %s" % (str(self), cid)) return False + else: + return True async def parse(self, input_text, *k, **kk): if not await self._check_support(input_text): @@ -245,8 +247,8 @@ class IQiYiAListParser3(IQiYiAListParser): # https://pcw-api.iqiyi.com/albums/album/avlistinfo?aid=202340701&size=50&page=2 URL_JS_API_PORT = "https://pcw-api.iqiyi.com/albums/album/avlistinfo?aid={}&size=50&page={}" - TAKE_CARE_CID = '2' - TAKE_CARE_CID_TYPE = "INCLUDE" + # TAKE_CARE_CID = '2' + TAKE_CARE_CID_TYPE = "ALL" # parse one page json def _parse_one_page_json(self, info): @@ -258,7 +260,7 @@ def _parse_one_page_json(self, info): one['no'] = v['order'] one['title'] = v['name'] - one['subtitle'] = v['subtitle'] + one['subtitle'] = v.get('subtitle', '') one['url'] = v['playUrl'] out.append(one) @@ -267,7 +269,7 @@ def _parse_one_page_json(self, info): class IQiYiAListParser4(IQiYiAListParser): - replace_if_exists = ["IQiYiAListParser2"] + replace_if_exists = ["IQiYiAListParser2", "IQiYiAListParser3"] # https://pcw-api.iqiyi.com/album/source/svlistinfo?cid=6&sourceid=203342201&timelist=2016 URL_JS_API_PORT = "https://pcw-api.iqiyi.com/album/source/svlistinfo?cid={}&sourceid={}&timelist=" + \