From 88eeec36936cbb58fb573108b2092e7af2c6c091 Mon Sep 17 00:00:00 2001 From: Thomas Christlieb Date: Fri, 3 Feb 2017 12:14:50 +0100 Subject: [PATCH] Fixed key error when trying to get next page of playlist and qiyi only gives code A00004 --- youtube_dl/extractor/iqiyi.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/iqiyi.py b/youtube_dl/extractor/iqiyi.py index 28277fa3d..69fec6451 100644 --- a/youtube_dl/extractor/iqiyi.py +++ b/youtube_dl/extractor/iqiyi.py @@ -323,10 +323,13 @@ class IqiyiIE(InfoExtractor): errnote='Failed to download playlist page %d' % page_num) pagelist = self._parse_json( remove_start(pagelist_page, 'var tvInfoJs='), album_id) - vlist = pagelist['data']['vlist'] - for item in vlist: - entries.append(self.url_result(item['vurl'])) - if len(vlist) < PAGE_SIZE: + if 'data' in pagelist: + vlist = pagelist['data']['vlist'] + for item in vlist: + entries.append(self.url_result(item['vurl'])) + if len(vlist) < PAGE_SIZE: + break + else: break return self.playlist_result(entries, album_id, album_title)