GitHub Action commited on
Commit ·
b71cb5e
1
Parent(s): 8ac965f
Sync from GitHub with Git LFS
Browse files
scripts/publish_to_blogger.py
CHANGED
|
@@ -10,6 +10,15 @@ BLOG_ID = os.environ['BLOG_ID']
|
|
| 10 |
POSTS_DIR = 'docs'
|
| 11 |
JSON_FILE = 'scripts/published_posts.json'
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# Загружаем OAuth токен
|
| 14 |
with open(TOKEN_FILE, 'rb') as f:
|
| 15 |
creds = pickle.load(f)
|
|
|
|
| 10 |
POSTS_DIR = 'docs'
|
| 11 |
JSON_FILE = 'scripts/published_posts.json'
|
| 12 |
|
| 13 |
+
if os.path.exists(JSON_FILE):
|
| 14 |
+
with open(JSON_FILE, 'r', encoding='utf-8') as f:
|
| 15 |
+
try:
|
| 16 |
+
published = json.load(f)
|
| 17 |
+
except json.JSONDecodeError:
|
| 18 |
+
published = {}
|
| 19 |
+
else:
|
| 20 |
+
published = {}
|
| 21 |
+
|
| 22 |
# Загружаем OAuth токен
|
| 23 |
with open(TOKEN_FILE, 'rb') as f:
|
| 24 |
creds = pickle.load(f)
|