1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2025-07-13 22:06:21 +00:00

Merge 280f00d0557849752a4e9884d351db3a38065f6e into c5098961b04ce83f4615f2a846c84f803b072639

This commit is contained in:
Thomas Christlieb 2024-08-07 09:39:23 -04:00 committed by GitHub
commit b389f39a9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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,11 +333,14 @@ 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)
if 'data' in pagelist:
vlist = pagelist['data']['vlist'] vlist = pagelist['data']['vlist']
for item in vlist: for item in vlist:
entries.append(self.url_result(item['vurl'])) entries.append(self.url_result(item['vurl']))
if len(vlist) < PAGE_SIZE: if len(vlist) < PAGE_SIZE:
break break
else:
break
return self.playlist_result(entries, album_id, album_title) return self.playlist_result(entries, album_id, album_title)