ExtractorError,
qualities,
)
-import json
class PandaTVIE(InfoExtractor):
'https://www.panda.tv/api_room_v2?roomid=%s' % video_id, video_id)
error_code = config.get('errno', 0)
- if error_code is not 0:
+ if error_code != 0:
raise ExtractorError(
'%s returned error %s: %s'
% (self.IE_NAME, error_code, config['errmsg']),
plflag1 = '4'
live_panda = 'live_panda' if plflag0 < 1 else ''
- plflag_auth = json.loads(video_info["plflag_list"])
- sign = plflag_auth["auth"]["sign"]
- ts = plflag_auth["auth"]["time"]
- rid = plflag_auth["auth"]["rid"]
+ plflag_auth = self._parse_json(video_info['plflag_list'], video_id)
+ sign = plflag_auth['auth']['sign']
+ ts = plflag_auth['auth']['time']
+ rid = plflag_auth['auth']['rid']
quality_key = qualities(['OD', 'HD', 'SD'])
suffix = ['_small', '_mid', '']