[pandatv] Modernize (closes #14693)
authorSergey M․ <dstftw@gmail.com>
Thu, 9 Nov 2017 16:25:43 +0000 (23:25 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 9 Nov 2017 16:30:25 +0000 (23:30 +0700)
youtube_dl/extractor/pandatv.py

index c99a1bb1f75c2c8a7e0e23efbaa6bbd4ef021463..13a2e7efc76e4f0fbd9e778644781c5218770f61 100644 (file)
@@ -6,7 +6,6 @@ from ..utils import (
     ExtractorError,
     qualities,
 )
-import json
 
 
 class PandaTVIE(InfoExtractor):
@@ -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', '']