base64转换

import base64
import gzip
import json


class Character:
def __init__(self, response):
self.response = response

def character(self):
json_response = self.response.content.decode()
json_response = base64.b64decode(json_response)
result_str = gzip.decompress(json_response).decode("utf-8")
result_json = json.loads(result_str)
return result_json
posted @ 2021-05-18 09:58  书院小先生  阅读(134)  评论(0编辑  收藏  举报