[youtube] Remove info el for get_video_info request
[youtube-dl] / youtube_dl / extractor / pandatv.py
index c99a1bb1f75c2c8a7e0e23efbaa6bbd4ef021463..4219802d520cbd150b10d16d95fd8c3521f67793 100644 (file)
@@ -6,7 +6,6 @@ from ..utils import (
     ExtractorError,
     qualities,
 )
-import json
 
 
 class PandaTVIE(InfoExtractor):
@@ -37,7 +36,7 @@ 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']),
@@ -67,10 +66,10 @@ class PandaTVIE(InfoExtractor):
             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', '']