add check for permission errors

This commit is contained in:
nebula 2025-05-04 05:39:24 +00:00
parent 26eec98680
commit d17d9ccf09

View File

@ -72,10 +72,11 @@ def generate_feed(before=None, count=200):
posts.sort(key=lambda x: x[0], reverse=True)
blogs = []
for time, user, path in posts[:count]:
# try:
with open(path, "r", encoding="UTF-8") as f:
body = f.read()
# except
try:
with open(path, "r", encoding="UTF-8") as f:
body = f.read()
except PermissionError:
continue
obj = {
"user": user,
"time": time,