Skip to content

Commit

Permalink
fix iqiyi list
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Jan 31, 2019
1 parent fc19ea6 commit 1a42467
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions wwqLyParse/common/threadpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
12 changes: 7 additions & 5 deletions wwqLyParse/parsers/iqiyilistparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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)
Expand All @@ -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=" + \
Expand Down

0 comments on commit 1a42467

Please # to comment.