Skip to content

Commit

Permalink
Reverted Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Iceshadow1404 committed Aug 13, 2024
1 parent 932983e commit 79e881b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# src/main.py
import os
import time
import json
import threading
import argparse
import traceback
from pathlib import Path
from typing import Dict
from src.constants import *
import tempfile
import errno
Expand Down
1 change: 1 addition & 0 deletions src/CoverCleaner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
import zipfile
import os
import re
import shutil
from typing import List, Optional
Expand Down
1 change: 1 addition & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import sys
import shutil
from datetime import datetime

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
CONFIG_DIR = os.path.join(ROOT_DIR, 'backups')
Expand Down
1 change: 1 addition & 0 deletions src/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from pathlib import Path

RAW_COVER_DIR = Path('./RawCover')
Expand Down
2 changes: 2 additions & 0 deletions src/getIDs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# src/get_ids.py
import json
import sys
import requests
import re
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion src/mediux_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ async def download_and_save_image(session: ClientSession, file_url: str, file_na
log(f'Failed to download {file_name}. Status code: {response.status}',success=False)

if __name__ == '__main__':
mediux_downloader()
mediux_downloader()
7 changes: 4 additions & 3 deletions src/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ def webhook(HA_WEBHOOK_URL, HA_WEBHOOK_ID):
webhook_url = f"{HA_WEBHOOK_URL}/api/webhook/{HA_WEBHOOK_ID}"
response = requests.post(webhook_url)
response.raise_for_status()
log("Webhook sent successfully!")
if response.status_code != 200:
if response.status_code == 200:
log("Webhook sent successfully!")
else:
print(f"Statuscode: {response.status_code}")

except requests.exceptions.RequestException as e:
print(f"Error while sending webhook: {e}")
print(f"Error while sending webhook: {e}")

0 comments on commit 79e881b

Please sign in to comment.