concludes logging standardization refactor

This commit is contained in:
msramalho
2025-06-26 17:20:04 +01:00
parent ad29cb4447
commit afd9090a4c
48 changed files with 207 additions and 252 deletions

View File

@@ -6,7 +6,6 @@ import uuid
from datetime import datetime, timezone
from dateutil.parser import parse as parse_dt
import requests
from auto_archiver.utils.custom_logger import logger
@@ -15,18 +14,6 @@ def mkdir_if_not_exists(folder):
os.makedirs(folder)
def expand_url(url):
# expand short URL links
if "https://t.co/" in url:
try:
r = requests.get(url)
logger.debug(f"Expanded url {url} to {r.url}")
return r.url
except Exception:
logger.error(f"Failed to expand url {url}")
return url
def getattr_or(o: object, prop: str, default=None):
try:
res = getattr(o, prop)