This commit is contained in:
blank X 2020-09-03 12:03:15 +07:00
parent a1207d1c11
commit 6eb2aec15a
1 changed files with 3 additions and 2 deletions

View File

@ -234,8 +234,9 @@ async def main():
mimetype = await _get_file_mimetype(filename) mimetype = await _get_file_mimetype(filename)
if mimetype.startswith('image') and preview and preview['enabled']: if mimetype.startswith('image') and preview and preview['enabled']:
preview = preview['images'][0] preview = preview['images'][0]
urls = [preview['source']['url']] urls = [i['url'] for i in preview['resolutions']]
urls.extend(reversed(i['url'] for i in preview['resolutions'])) urls.append(preview['source']['url'])
urls.reverse()
for url in urls: for url in urls:
if os.path.getsize(filename) < 10000000: if os.path.getsize(filename) < 10000000:
break break