2 from __future__
import unicode_literals
9 from .common
import InfoExtractor
10 from ..compat
import (
12 compat_urllib_parse_urlencode
,
14 from .openload
import PhantomJSwrapper
21 get_element_by_attribute
,
38 return hashlib
.md5(text
.encode('utf-8')).hexdigest()
41 class IqiyiSDK(object):
42 def __init__(self
, target
, ip
, timestamp
):
45 self
.timestamp
= timestamp
49 return compat_str(sum(map(lambda p
: int(p
, 16), list(data
))))
53 if isinstance(num
, int):
55 return compat_str(sum(map(int, num
)))
58 even
= self
.digit_sum(compat_str(self
.timestamp
)[::2])
59 odd
= self
.digit_sum(compat_str(self
.timestamp
)[1::2])
62 def preprocess(self
, chunksize
):
63 self
.target
= md5_text(self
.target
)
65 for i
in range(32 // chunksize
):
66 chunks
.append(self
.target
[chunksize
* i
:chunksize
* (i
+ 1)])
68 chunks
.append(self
.target
[32 - 32 % chunksize
:])
69 return chunks
, list(map(int, self
.ip
.split('.')))
71 def mod(self
, modulus
):
72 chunks
, ip
= self
.preprocess(32)
73 self
.target
= chunks
[0] + ''.join(map(lambda p
: compat_str(p
% modulus
), ip
))
75 def split(self
, chunksize
):
82 chunks
, ip
= self
.preprocess(chunksize
)
84 for i
in range(len(chunks
)):
85 ip_part
= compat_str(ip
[i
] % modulus_map
[chunksize
]) if i
< 4 else ''
87 ret
+= ip_part
+ chunks
[i
]
89 ret
+= chunks
[i
] + ip_part
92 def handle_input16(self
):
93 self
.target
= md5_text(self
.target
)
94 self
.target
= self
.split_sum(self
.target
[:16]) + self
.target
+ self
.split_sum(self
.target
[16:])
96 def handle_input8(self
):
97 self
.target
= md5_text(self
.target
)
100 part
= self
.target
[8 * i
:8 * (i
+ 1)]
101 ret
+= self
.split_sum(part
) + part
105 self
.target
= md5_text(self
.target
)
106 self
.target
= self
.split_sum(self
.target
) + self
.target
108 def date(self
, scheme
):
109 self
.target
= md5_text(self
.target
)
110 d
= time
.localtime(self
.timestamp
)
112 'y': compat_str(d
.tm_year
),
113 'm': '%02d' % d
.tm_mon
,
114 'd': '%02d' % d
.tm_mday
,
116 self
.target
+= ''.join(map(lambda c
: strings
[c
], list(scheme
)))
118 def split_time_even_odd(self
):
119 even
, odd
= self
.even_odd()
120 self
.target
= odd
+ md5_text(self
.target
) + even
122 def split_time_odd_even(self
):
123 even
, odd
= self
.even_odd()
124 self
.target
= even
+ md5_text(self
.target
) + odd
126 def split_ip_time_sum(self
):
127 chunks
, ip
= self
.preprocess(32)
128 self
.target
= compat_str(sum(ip
)) + chunks
[0] + self
.digit_sum(self
.timestamp
)
130 def split_time_ip_sum(self
):
131 chunks
, ip
= self
.preprocess(32)
132 self
.target
= self
.digit_sum(self
.timestamp
) + chunks
[0] + compat_str(sum(ip
))
135 class IqiyiSDKInterpreter(object):
136 def __init__(self
, sdk_code
):
137 self
.sdk_code
= sdk_code
139 def run(self
, target
, ip
, timestamp
):
140 self
.sdk_code
= decode_packed_codes(self
.sdk_code
)
142 functions
= re
.findall(r
'input=([a-zA-Z0-9]+)\(input', self
.sdk_code
)
144 sdk
= IqiyiSDK(target
, ip
, timestamp
)
147 'handleSum': sdk
.handleSum
,
148 'handleInput8': sdk
.handle_input8
,
149 'handleInput16': sdk
.handle_input16
,
150 'splitTimeEvenOdd': sdk
.split_time_even_odd
,
151 'splitTimeOddEven': sdk
.split_time_odd_even
,
152 'splitIpTimeSum': sdk
.split_ip_time_sum
,
153 'splitTimeIpSum': sdk
.split_time_ip_sum
,
155 for function
in functions
:
156 if re
.match(r
'mod\d+', function
):
157 sdk
.mod(int(function
[3:]))
158 elif re
.match(r
'date[ymd]{3}', function
):
159 sdk
.date(function
[4:])
160 elif re
.match(r
'split\d+', function
):
161 sdk
.split(int(function
[5:]))
162 elif function
in other_functions
:
163 other_functions
[function
]()
165 raise ExtractorError('Unknown function %s' % function
)
170 class IqiyiIE(InfoExtractor
):
174 _VALID_URL
= r
'https?://(?:(?:[^.]+\.)?iqiyi\.com|www\.pps\.tv)/.+\.html'
176 _NETRC_MACHINE
= 'iqiyi'
179 'url': 'http://www.iqiyi.com/v_19rrojlavg.html',
180 # MD5 checksum differs on my machine and Travis CI
182 'id': '9c1fb1b99d192b21c559e5a1a2cb3c73',
184 'title': '美国德州空中惊现奇异云团 酷似UFO',
187 'url': 'http://www.iqiyi.com/v_19rrhnnclk.html',
188 'md5': 'b7dc800a4004b1b57749d9abae0472da',
190 'id': 'e3f585b550a280af23c98b6cb2be19fb',
192 # This can be either Simplified Chinese or Traditional Chinese
193 'title': r
're:^(?:名侦探柯南 国语版:第752集 迫近灰原秘密的黑影 下篇|名偵探柯南 國語版:第752集 迫近灰原秘密的黑影 下篇)$',
195 'skip': 'Geo-restricted to China',
197 'url': 'http://www.iqiyi.com/w_19rt6o8t9p.html',
198 'only_matching': True,
200 'url': 'http://www.iqiyi.com/a_19rrhbc6kt.html',
201 'only_matching': True,
203 'url': 'http://yule.iqiyi.com/pcb.html',
205 'id': '4a0af228fddb55ec96398a364248ed7f',
207 'title': '第2017-04-21期 女艺人频遭极端粉丝骚扰',
210 # VIP-only video. The first 2 parts (6 minutes) are available without login
211 # MD5 sums omitted as values are different on Travis CI and my machine
212 'url': 'http://www.iqiyi.com/v_19rrny4w8w.html',
214 'id': 'f3cf468b39dddb30d676f89a91200dc1',
218 'skip': 'Geo-restricted to China',
220 'url': 'http://www.iqiyi.com/a_19rrhb8ce1.html',
225 'playlist_count': 101,
227 'url': 'http://www.pps.tv/w_19rrbav0ph.html',
228 'only_matching': True,
232 '96': 1, # 216p, 240p
238 '5': 6, # 1072p, 1080p
242 def _real_initialize(self
):
247 # public key extracted from http://static.iqiyi.com/js/qiyiV2/20160129180840/jobs/i18n/i18nIndex.js
248 N
= 0xab86b6371b5318aaa1d3c9e612a9f1264f372323c8c0f19875b5fc3b3fd3afcc1e5bec527aa94bfa85bffc157e4245aebda05389a5357b75115ac94f074aefcd
251 return ohdave_rsa_encrypt(data
, e
, N
)
254 username
, password
= self
._get
_login
_info
()
256 # No authentication to be performed
260 data
= self
._download
_json
(
261 'http://kylin.iqiyi.com/get_token', None,
262 note
='Get token for logging', errnote
='Unable to get token for logging')
264 timestamp
= int(time
.time())
265 target
= '/apis/reglogin/login.action?lang=zh_TW&area_code=null&email=%s&passwd=%s&agenttype=1&from=undefined&keeplogin=0&piccode=&fromurl=&_pos=1' % (
266 username
, self
._rsa
_fun
(password
.encode('utf-8')))
268 interp
= IqiyiSDKInterpreter(sdk
)
269 sign
= interp
.run(target
, data
['ip'], timestamp
)
271 validation_params
= {
273 'server': 'BEA3AA1908656AABCCFF76582C4C6660',
274 'token': data
['token'],
275 'bird_src': 'f8d91d57af224da7893dd397d52d811a',
279 validation_result
= self
._download
_json
(
280 'http://kylin.iqiyi.com/validate?' + compat_urllib_parse_urlencode(validation_params
), None,
281 note
='Validate credentials', errnote
='Unable to validate credentials')
284 'P00107': 'please login via the web interface and enter the CAPTCHA code',
285 'P00117': 'bad username or password',
288 code
= validation_result
['code']
290 msg
= MSG_MAP
.get(code
)
292 msg
= 'error %s' % code
293 if validation_result
.get('msg'):
294 msg
+= ': ' + validation_result
['msg']
295 self
.report_warning('unable to log in: ' + msg
)
300 def get_raw_data(self
, tvid
, video_id
):
301 tm
= int(time
.time() * 1000)
303 key
= 'd5fb4bd9d50c4be6948c97edd7254b0e'
304 sc
= md5_text(compat_str(tm
) + key
+ tvid
)
308 'src': '76f90cbd92f94a2e925d83e8ccd22cb7',
313 return self
._download
_json
(
314 'http://cache.m.iqiyi.com/jp/tmts/%s/%s/' % (tvid
, video_id
),
315 video_id
, transform_source
=lambda s
: remove_start(s
, 'var tvInfoJs='),
316 query
=params
, headers
=self
.geo_verification_headers())
318 def _extract_playlist(self
, webpage
):
322 r
'<a[^>]+class="site-piclist_pic_link"[^>]+href="(http://www\.iqiyi\.com/.+\.html)"',
327 album_id
= self
._search
_regex
(
328 r
'albumId\s*:\s*(\d+),', webpage
, 'album ID')
329 album_title
= self
._search
_regex
(
330 r
'data-share-title="([^"]+)"', webpage
, 'album title', fatal
=False)
332 entries
= list(map(self
.url_result
, links
))
334 # Start from 2 because links in the first page are already on webpage
335 for page_num
in itertools
.count(2):
336 pagelist_page
= self
._download
_webpage
(
337 'http://cache.video.qiyi.com/jp/avlist/%s/%d/%d/' % (album_id
, page_num
, PAGE_SIZE
),
339 note
='Download playlist page %d' % page_num
,
340 errnote
='Failed to download playlist page %d' % page_num
)
341 pagelist
= self
._parse
_json
(
342 remove_start(pagelist_page
, 'var tvInfoJs='), album_id
)
343 vlist
= pagelist
['data']['vlist']
345 entries
.append(self
.url_result(item
['vurl']))
346 if len(vlist
) < PAGE_SIZE
:
349 return self
.playlist_result(entries
, album_id
, album_title
)
351 def _real_extract(self
, url
):
352 webpage
= self
._download
_webpage
(
353 url
, 'temp_id', note
='download video page')
355 # There's no simple way to determine whether an URL is a playlist or not
356 # Sometimes there are playlist links in individual videos, so treat it
357 # as a single video first
358 tvid
= self
._search
_regex
(
359 r
'data-(?:player|shareplattrigger)-tvid\s*=\s*[\'"](\d+)', webpage, 'tvid', default=None)
361 playlist_result = self._extract_playlist(webpage)
363 return playlist_result
364 raise ExtractorError('Can\'t find any video')
366 video_id = self._search_regex(
367 r'data-(?:player|shareplattrigger)-videoid\s*=\s*[\'"]([a
-f\d
]+)', webpage, 'video_id
')
371 raw_data = self.get_raw_data(tvid, video_id)
373 if raw_data['code
'] != 'A00000
':
374 if raw_data['code
'] == 'A00111
':
375 self.raise_geo_restricted()
376 raise ExtractorError('Unable to load data
. Error code
: ' + raw_data['code
'])
378 data = raw_data['data
']
380 for stream in data['vidl
']:
381 if 'm3utx
' not in stream:
383 vd = compat_str(stream['vd
'])
385 'url
': stream['m3utx
'],
388 'quality
': self._FORMATS_MAP.get(vd, -1),
389 'protocol
': 'm3u8_native
',
395 self._sleep(5, video_id)
397 self._sort_formats(formats)
398 title = (get_element_by_id('widget
-videotitle
', webpage)
399 or clean_html(get_element_by_attribute('class', 'mod
-play
-tit
', webpage))
400 or self._html_search_regex(r'<span
[^
>]+data
-videochanged
-title
="word"[^
>]*>([^
<]+)</span
>', webpage, 'title
'))
409 class IqIE(InfoExtractor):
411 IE_DESC = 'International version of iQiyi
'
412 _VALID_URL = r'https?
://(?
:www\
.)?iq\
.com
/play
/(?
:[\w
%-]*-)?
(?P
<id>\w
+)'
414 'url
': 'https
://www
.iq
.com
/play
/one
-piece
-episode
-1000-1ma1i6ferf4
',
415 'md5
': '2d7caf6eeca8a32b407094b33b757d39
',
419 'title
': '航海王 第
1000集
',
420 'description
': 'Subtitle available on Sunday
4PM(GMT
+8)
.',
422 'timestamp
': 1637488203,
423 'upload_date
': '20211121',
424 'episode_number
': 1000,
425 'episode
': 'Episode
1000',
426 'series
': 'One Piece
',
428 'average_rating
': float,
433 'expected_warnings
': ['format
is restricted
']
458 console.log(page.evaluate(function() {
459 var tvid = "%(tvid)s"; var vid = "%(vid)s"; var src = "%(src)s";
460 var dfp = "%(dfp)s"; var mode = "%(mode)s"; var lang = "%(lang)s"; var bid_list = %(bid_list)s;
461 var tm = new Date().getTime();
462 var cmd5x_func = %(cmd5x_func)s; var cmd5x_exporter = {}; cmd5x_func({}, cmd5x_exporter, {}); var cmd5x = cmd5x_exporter.cmd5x;
463 var authKey = cmd5x(cmd5x('') + tm + '' + tvid);
464 var k_uid = Array.apply(null, Array(32)).map(function() {return Math.floor(Math.random() * 15).toString(16)}).join('');
466 bid_list.forEach(function(bid) {
491 'prio
': JSON.stringify({
505 'k_ft1
': 141287244169348,
506 'k_ft4
': 34359746564,
508 'bop
': JSON.stringify({
512 'ut
': 0, // TODO: Set ut param for VIP members
515 for (var prop in query) {
516 enc_params.push(encodeURIComponent(prop) + '=' + encodeURIComponent(query[prop]));
518 var dash_path = '/dash?
' + enc_params.join('&'); dash_path += '&vf
=' + cmd5x(dash_path);
519 dash_paths[bid] = dash_path;
521 return JSON.stringify(dash_paths);
526 def _extract_vms_player_js(self, webpage, video_id):
527 player_js_cache = self._downloader.cache.load('iq
', 'player_js
')
529 return player_js_cache
530 webpack_js_url = self._proto_relative_url(self._search_regex(
531 r'<script src
="((?:https?)?//stc.iqiyipic.com/_next/static/chunks/webpack-\w+\.js)"', webpage, 'webpack URL
'))
532 webpack_js = self._download_webpage(webpack_js_url, video_id, note='Downloading webpack JS
', errnote='Unable to download webpack JS
')
533 webpack_map1, webpack_map2 = [self._parse_json(js_map, video_id, transform_source=js_to_json) for js_map in self._search_regex(
534 r'\
(({[^}
]*})\
[\w
+\
][^\
)]*\
)\s
*\
+\s
*["\']\.["\']\s
*\
+\s
*({[^}
]*})\
[\w
+\
]\
+["\']\.js', webpack_js, 'JS locations', group=(1, 2))]
535 for module_index in reversed(webpack_map2.keys()):
536 module_js = self._download_webpage(
537 f'https://stc.iqiyipic.com/_next/static/chunks/{webpack_map1.get(module_index, module_index)}.{webpack_map2[module_index]}.js',
538 video_id, note=f'Downloading #{module_index} module JS', errnote='Unable to download module JS', fatal=False) or ''
539 if 'vms request' in module_js:
540 self._downloader.cache.store('iq', 'player_js', module_js)
542 raise ExtractorError('Unable to extract player JS')
544 def _extract_cmd5x_function(self, webpage, video_id):
545 return self._search_regex(r',\s*(function\s*\([^\)]*\)\s*{\s*var _qda.+_qdc\(\)\s*})\s*,',
546 self._extract_vms_player_js(webpage, video_id), 'signature function')
548 def _update_bid_tags(self, webpage, video_id):
549 extracted_bid_tags = self._parse_json(
551 r'arguments\[1\][^,]*,\s*function\s*\([^\)]*\)\s*{\s*"use strict";?\s*var \w=({.+}})\s*,\s*\w\s*=\s*{\s*getNewVd',
552 self._extract_vms_player_js(webpage, video_id), 'video tags', default=''),
553 video_id, transform_source=js_to_json, fatal=False)
554 if not extracted_bid_tags:
557 bid: traverse_obj(extracted_bid_tags, (bid, 'value'), expected_type=str, default=self._BID_TAGS.get(bid))
558 for bid in extracted_bid_tags.keys()
561 def _get_cookie(self, name, default=None):
562 cookie = self._get_cookies('https://iq.com/').get(name)
563 return cookie.value if cookie else default
565 def _real_extract(self, url):
566 video_id = self._match_id(url)
567 webpage = self._download_webpage(url, video_id)
568 self._update_bid_tags(webpage, video_id)
570 next_props = self._search_nextjs_data(webpage, video_id)['props']
571 page_data = next_props['initialState']['play']
572 video_info = page_data['curVideoInfo']
574 # bid 0 as an initial format checker
575 dash_paths = self._parse_json(PhantomJSwrapper(self).get(
576 url, html='<!DOCTYPE html>', video_id=video_id, note2='Executing signature code', jscode=self._DASH_JS % {
577 'tvid': video_info['tvId'],
578 'vid': video_info['vid'],
579 'src': traverse_obj(next_props, ('initialProps', 'pageProps', 'ptid'),
580 expected_type=str, default='01010031010018000000'),
581 'dfp': self._get_cookie('dfp', ''),
582 'mode': self._get_cookie('mod', 'intl'),
583 'lang': self._get_cookie('lang', 'en_us'),
584 'bid_list': '[' + ','.join(['0', *self._BID_TAGS.keys()]) + ']',
585 'cmd5x_func': self._extract_cmd5x_function(webpage, video_id),
586 })[1].strip(), video_id)
588 formats, subtitles = [], {}
589 initial_format_data = self._download_json(
590 urljoin('https://cache-video.iq.com', dash_paths['0']), video_id,
591 note='Downloading initial video format info', errnote='Unable to download initial video format info')['data']
593 preview_time = traverse_obj(initial_format_data, ('boss_ts', 'data', 'previewTime'), expected_type=float_or_none)
595 self.report_warning(f'This preview video is limited to {preview_time} seconds')
597 # TODO: Extract audio-only formats
598 for bid in set(traverse_obj(initial_format_data, ('program', 'video', ..., 'bid'), expected_type=str_or_none, default=[])):
599 dash_path = dash_paths.get(bid)
601 self.report_warning(f'Unknown format id: {bid}. It is currently not being extracted')
603 format_data = traverse_obj(self._download_json(
604 urljoin('https://cache-video.iq.com', dash_path), video_id,
605 note=f'Downloading format data for {self._BID_TAGS[bid]}', errnote='Unable to download format data',
606 fatal=False), 'data', expected_type=dict)
608 video_format = next((video_format for video_format in traverse_obj(
609 format_data, ('program', 'video', ...), expected_type=dict, default=[]) if str(video_format['bid']) == bid), {})
610 extracted_formats = []
611 if video_format.get('m3u8Url'):
612 extracted_formats.extend(self._extract_m3u8_formats(
613 urljoin(format_data.get('dm3u8', 'https://cache-m.iq.com/dc/dt/'), video_format['m3u8Url']),
614 'mp4', m3u8_id=bid, fatal=False))
615 if video_format.get('mpdUrl'):
616 # TODO: Properly extract mpd hostname
617 extracted_formats.extend(self._extract_mpd_formats(
618 urljoin(format_data.get('dm3u8', 'https://cache-m.iq.com/dc/dt/'), video_format['mpdUrl']),
619 mpd_id=bid, fatal=False))
620 if video_format.get('m3u8'):
621 ff = video_format.get('ff', 'ts')
623 m3u8_formats, _ = self._parse_m3u8_formats_and_subtitles(
624 video_format['m3u8'], ext='mp4', m3u8_id=bid, fatal=False)
625 extracted_formats.extend(m3u8_formats)
627 mpd_data = traverse_obj(
628 self._parse_json(video_format['m3u8'], video_id, fatal=False), ('payload', ..., 'data'), expected_type=str)
631 mpd_formats, _ = self._parse_mpd_formats_and_subtitles(
632 mpd_data, bid, format_data.get('dm3u8', 'https://cache-m.iq.com/dc/dt/'))
633 extracted_formats.extend(mpd_formats)
635 self.report_warning(f'{ff} formats are currently not supported')
637 if not extracted_formats:
638 if video_format.get('s'):
639 self.report_warning(f'{self._BID_TAGS[bid]} format is restricted')
641 self.report_warning(f'Unable to extract {self._BID_TAGS[bid]} format')
642 for f in extracted_formats:
644 'quality': qualities(list(self._BID_TAGS.keys()))(bid),
645 'format_note': self._BID_TAGS[bid],
646 **parse_resolution(video_format.get('scrsz'))
648 formats.extend(extracted_formats)
650 self._sort_formats(formats)
652 for sub_format in traverse_obj(initial_format_data, ('program', 'stl', ...), expected_type=dict, default=[]):
653 lang = self._LID_TAGS.get(str_or_none(sub_format.get('lid')), sub_format.get('_name'))
654 subtitles.setdefault(lang, []).extend([{
656 'url': urljoin(initial_format_data.get('dstl', 'http://meta.video.iqiyi.com'), sub_format[format_key])
657 } for format_key, format_ext in [('srt', 'srt'), ('webvtt', 'vtt')] if sub_format.get(format_key)])
659 extra_metadata = page_data.get('albumInfo') if video_info.get('albumId') and page_data.get('albumInfo') else video_info
662 'title': video_info['name'],
664 'subtitles': subtitles,
665 'description': video_info.get('mergeDesc'),
666 'duration': parse_duration(video_info.get('len')),
667 'age_limit': parse_age_limit(video_info.get('rating')),
668 'average_rating': traverse_obj(page_data, ('playScoreInfo', 'score'), expected_type=float_or_none),
669 'timestamp': parse_iso8601(video_info.get('isoUploadDate')),
670 'categories': traverse_obj(extra_metadata, ('videoTagMap', ..., ..., 'name'), expected_type=str),
671 'cast': traverse_obj(extra_metadata, ('actorArr', ..., 'name'), expected_type=str),
672 'episode_number': int_or_none(video_info.get('order')) or None,
673 'series': video_info.get('albumName'),
677 class IqAlbumIE(InfoExtractor):
678 IE_NAME = 'iq.com:album'
679 _VALID_URL = r'https?://(?:www\.)?iq\.com/album/(?:[\w%-]*-)?(?P<id>\w+)'
681 'url': 'https://www.iq.com/album/one-piece-1999-1bk9icvr331',
684 'title': 'One Piece',
685 'description': 'Subtitle available on Sunday 4PM(GMT+8).'
687 'playlist_mincount': 238
690 'url': 'https://www.iq.com/album/九龙城寨-2021-22yjnij099k',
695 'description': 'md5:8a09f50b8ba0db4dc69bc7c844228044',
697 'timestamp': 1641911371,
698 'upload_date': '20220111',
700 'cast': ['Shi Yan Neng', 'Yu Lang', 'Peter lv', 'Sun Zi Jun', 'Yang Xiao Bo'],
702 'average_rating': float,
704 'expected_warnings': ['format is restricted']
707 def _entries(self, album_id_num, page_ranges, album_id=None, mode_code='intl', lang_code='en_us'):
708 for page_range in page_ranges:
709 page = self._download_json(
710 f'https://pcw-api.iq.com/api/episodeListSource/{album_id_num}', album_id,
711 note=f'Downloading video list episodes {page_range.get("msg", "")}',
712 errnote='Unable to download video list', query={
714 'modeCode': mode_code,
715 'langCode': lang_code,
716 'endOrder': page_range['to'],
717 'startOrder': page_range['from']
719 for video in page['data']['epg']:
720 yield self.url_result('https://www.iq.com/play/%s' % (video.get('playLocSuffix') or video['qipuIdStr']),
721 IqIE.ie_key(), video.get('qipuIdStr'), video.get('name'))
723 def _real_extract(self, url):
724 album_id = self._match_id(url)
725 webpage = self._download_webpage(url, album_id)
726 next_data = self._search_nextjs_data(webpage, album_id)
727 album_data = next_data['props']['initialState']['album']['videoAlbumInfo']
729 if album_data.get('videoType') == 'singleVideo':
730 return self.url_result('https://www.iq.com/play/%s' % album_id, IqIE.ie_key())
731 return self.playlist_result(
732 self._entries(album_data['albumId'], album_data['totalPageRange'], album_id,
733 traverse_obj(next_data, ('props', 'initialProps', 'pageProps', 'modeCode')),
734 traverse_obj(next_data, ('props', 'initialProps', 'pageProps', 'langCode'))),
735 album_id, album_data.get('name'), album_data.get('desc'))