mirror of https://gitlab.com/octospacc/bottocto
Forgot the HTTP error patch
This commit is contained in:
parent
d620cdc4f2
commit
6df053305c
|
@ -9,6 +9,7 @@ from email.mime.base import MIMEBase
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
from urllib.request import urlopen, Request
|
from urllib.request import urlopen, Request
|
||||||
|
from urllib.error import HTTPError
|
||||||
from Config import *
|
from Config import *
|
||||||
|
|
||||||
MediaDescsBlock = '<br><details><summary>Media descriptions</summary><ul>\n{Content}</ul></details>'
|
MediaDescsBlock = '<br><details><summary>Media descriptions</summary><ul>\n{Content}</ul></details>'
|
||||||
|
@ -205,6 +206,16 @@ def HandleURL(IsFirstRun, URL, Usertag, IncludeRetoots, IncludeReplies, LocalSav
|
||||||
|
|
||||||
return LastEntryIsNew, PageOlder
|
return LastEntryIsNew, PageOlder
|
||||||
|
|
||||||
|
except HTTPError as e:
|
||||||
|
if e.code == 404:
|
||||||
|
print(e) # TODO: Should get the cached images from the local instance
|
||||||
|
return True, True
|
||||||
|
else:
|
||||||
|
if TryCount == MaxTryCount:
|
||||||
|
return True, True
|
||||||
|
print(e)
|
||||||
|
SleepPrint(PageSleep * (1.5**TryCount))
|
||||||
|
return False, False
|
||||||
except Exception:
|
except Exception:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue