deluge.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Seedbox-Statistics-For-InfluxDB 作者: barrycarey 项目源码 文件源码
def _process_response(self, res):
        """
        Take the response object and return JSON
        :param res:
        :return:
        """
        # TODO Figure out exceptions here
        if res.headers['Content-Encoding'] == 'gzip':
            self.send_log('Detected gzipped response', 'debug')
            raw_output = gzip.decompress(res.read()).decode('utf-8')
        else:
            self.send_log('Detected other type of response encoding: {}'.format(res.headers['Content-Encoding']), 'debug')
            raw_output = res.read().decode('utf-8')

        json_output = json.loads(raw_output)

        return json_output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号