FeedReader: do not update etag on error response
This commit is contained in:
parent
8e7fcc6ed2
commit
800c4c2ee3
1 changed files with 1 additions and 1 deletions
|
|
@ -173,7 +173,7 @@ class FeedReader:
|
|||
etag = file.readline()
|
||||
else: etag = None
|
||||
feed = feedparser.parse(self.url, etag=etag)
|
||||
if feed.etag and feed.etag != etag:
|
||||
if feed.etag and feed.etag != etag and feed.status // 100 in [2, 3]:
|
||||
if not os.path.isdir(CONFIG_DIR):
|
||||
os.mkdir(CONFIG_DIR)
|
||||
with open(self.etag_file, mode='w', encoding="UTF-8") as file:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue