[iqiyi] Fix playlist detection (#12504)

This commit is contained in:
Yen Chi Hsuan 2017-04-22 22:11:37 +08:00
parent 54f54fcca7
commit fbf56be213
No known key found for this signature in database
GPG key ID: 7F902A182457CA23
2 changed files with 10 additions and 6 deletions

View file

@ -337,13 +337,16 @@ class IqiyiIE(InfoExtractor):
url, 'temp_id', note='download video page')
# There's no simple way to determine whether an URL is a playlist or not
# So detect it
playlist_result = self._extract_playlist(webpage)
if playlist_result:
return playlist_result
# Sometimes there are playlist links in individual videos, so treat it
# as a single video first
tvid = self._search_regex(
r'data-player-tvid\s*=\s*[\'"](\d+)', webpage, 'tvid')
r'data-player-tvid\s*=\s*[\'"](\d+)', webpage, 'tvid', default=None)
if tvid is None:
playlist_result = self._extract_playlist(webpage)
if playlist_result:
return playlist_result
raise ExtractorError('Can\'t find any video')
video_id = self._search_regex(
r'data-player-videoid\s*=\s*[\'"]([a-f\d]+)', webpage, 'video_id')