def get_xml(self, nature, name):
username = self.credentials["Username"]
password = self.credentials["Password"]
name = name.replace(" ", "_")
auth = aiohttp.BasicAuth(login=username, password=password)
url = 'https://myanimelist.net/api/{}/search.xml?q={}'.format(nature, name)
with aiohttp.ClientSession(auth=auth) as session:
async with session.get(url) as response:
data = await response.text()
return data
评论列表
文章目录