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