mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
add delayed retry for non 404 thumb download error
This commit is contained in:
parent
044b12d5a5
commit
0844f7b91a
@ -4,6 +4,7 @@ functionality:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
import home.src.download as download
|
import home.src.download as download
|
||||||
import requests
|
import requests
|
||||||
@ -110,6 +111,10 @@ class ThumbManager:
|
|||||||
}
|
}
|
||||||
if img_url:
|
if img_url:
|
||||||
response = requests.get(img_url, stream=True)
|
response = requests.get(img_url, stream=True)
|
||||||
|
if not response.ok and not response.status_code == 404:
|
||||||
|
print("retry thumbnail download for " + img_url)
|
||||||
|
sleep(5)
|
||||||
|
response = requests.get(img_url, stream=True)
|
||||||
else:
|
else:
|
||||||
response = False
|
response = False
|
||||||
if not response or response.status_code == 404:
|
if not response or response.status_code == 404:
|
||||||
|
Loading…
Reference in New Issue
Block a user