This commit is contained in:
Thomas Christlieb 2020-10-03 17:07:45 -07:00 committed by GitHub
commit a09f07ae79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 8 deletions

View File

@ -19,6 +19,7 @@ from ..utils import (
ExtractorError, ExtractorError,
ohdave_rsa_encrypt, ohdave_rsa_encrypt,
remove_start, remove_start,
extract_attributes,
) )
@ -306,10 +307,14 @@ class IqiyiIE(InfoExtractor):
def _extract_playlist(self, webpage): def _extract_playlist(self, webpage):
PAGE_SIZE = 50 PAGE_SIZE = 50
links = re.findall( links = []
r'<a[^>]+class="site-piclist_pic_link"[^>]+href="(http://www\.iqiyi\.com/.+\.html)"', for link in re.findall(r'<a[^>]+class="[^"]*site-piclist_pic_link[^"]*"[^>]*>', webpage):
webpage) attribs = extract_attributes(link)
if not links: # It must be a valid url, and links on the playlist page have NO title-Attribute in them
# (links to other videos on the video page have, so beware of that!)
if attribs['href'].startswith('http') and 'title' not in attribs:
links.append(attribs['href'])
if len(links) == 0:
return return
album_id = self._search_regex( album_id = self._search_regex(
@ -328,10 +333,13 @@ class IqiyiIE(InfoExtractor):
errnote='Failed to download playlist page %d' % page_num) errnote='Failed to download playlist page %d' % page_num)
pagelist = self._parse_json( pagelist = self._parse_json(
remove_start(pagelist_page, 'var tvInfoJs='), album_id) remove_start(pagelist_page, 'var tvInfoJs='), album_id)
vlist = pagelist['data']['vlist'] if 'data' in pagelist:
for item in vlist: vlist = pagelist['data']['vlist']
entries.append(self.url_result(item['vurl'])) for item in vlist:
if len(vlist) < PAGE_SIZE: entries.append(self.url_result(item['vurl']))
if len(vlist) < PAGE_SIZE:
break
else:
break break
return self.playlist_result(entries, album_id, album_title) return self.playlist_result(entries, album_id, album_title)