SyntaxError

This commit is contained in:
blank X 2020-12-24 23:00:38 +07:00
parent f430d42f21
commit c897b3c598
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ async def saucenao(client, message):
parsed = urlparse(url) parsed = urlparse(url)
qs = parse_qs(parsed.query) qs = parse_qs(parsed.query)
if qs.get('illust_id'): if qs.get('illust_id'):
async with session.get(f'https://www.pixiv.net/touch/ajax/illust/details?illust_id={urlencode(qs["illust_id"][0])}', headers={'Accept': 'application/json') as resp: async with session.get(f'https://www.pixiv.net/touch/ajax/illust/details?illust_id={urlencode(qs["illust_id"][0])}', headers={'Accept': 'application/json'}) as resp:
json = await resp.json() json = await resp.json()
for i in ('url_big', 'url', 'url_s', 'url_placeholder', 'url_ss'): for i in ('url_big', 'url', 'url_s', 'url_placeholder', 'url_ss'):
pimg = json['body']['illust_details'].get(i) pimg = json['body']['illust_details'].get(i)