Fix some weird URLs

This commit is contained in:
blank X 2020-09-05 02:18:25 +07:00
parent 966e5ec799
commit a1216f1273
1 changed files with 3 additions and 0 deletions

View File

@ -252,6 +252,7 @@ async def main():
url = preview[i]['source']['url']
break
if url:
url = urlunparse(urlparse(url, 'https'))
await _download_file(filename, url)
mimetype = await _get_file_mimetype(filename)
if mimetype.startswith('image') and preview and preview['enabled']:
@ -262,6 +263,7 @@ async def main():
for url in urls:
if os.path.getsize(filename) < 10000000:
break
url = urlunparse(urlparse(url, 'https'))
await _download_file(filename, url)
ext = await _get_file_ext(filename)
if ext.startswith('.htm'):
@ -283,6 +285,7 @@ async def main():
tat += url
files = []
if pimg:
pimg = urlunparse(urlparse(pimg, 'https'))
await _download_file(filename, pimg)
files.append(filename)
else: