X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fpandatv.py;h=4219802d520cbd150b10d16d95fd8c3521f67793;hb=a61ce71468cb222338ccd8039dc631f3619dc585;hp=c99a1bb1f75c2c8a7e0e23efbaa6bbd4ef021463;hpb=4222346fb2f42af10ac902cd46469d23923cf114;p=youtube-dl diff --git a/youtube_dl/extractor/pandatv.py b/youtube_dl/extractor/pandatv.py index c99a1bb1f..4219802d5 100644 --- a/youtube_dl/extractor/pandatv.py +++ b/youtube_dl/extractor/pandatv.py @@ -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', '']