From c2decb8c4f44ce17b49a012427e854300d761e83 Mon Sep 17 00:00:00 2001 From: CaliBrain Date: Tue, 15 Apr 2025 08:14:08 -0400 Subject: [PATCH] Add timezone fallback for tor container (#133) --- docker-compose.tor.dev.yml | 2 +- tor.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker-compose.tor.dev.yml b/docker-compose.tor.dev.yml index c82f6dd..51517ac 100644 --- a/docker-compose.tor.dev.yml +++ b/docker-compose.tor.dev.yml @@ -1,7 +1,7 @@ services: calibre-web-automated-book-downloader-tor-dev: extends: - file: ./docker-compose.yml + file: ./docker-compose.tor.yml service: calibre-web-automated-book-downloader-tor build: context: . diff --git a/tor.sh b/tor.sh index 5b11342..9cc9ba5 100644 --- a/tor.sh +++ b/tor.sh @@ -73,7 +73,10 @@ fi # Then set the timezone # Get timezone from IP -TIMEZONE=$(pyrequests https://ipapi.co/timezone) +TIMEZONE=$(pyrequests https://ipapi.co/timezone) || +TIMEZONE=$(pyrequests http://worldtimeapi.org/api/ip | grep -oP '"timezone":"\K[^"]+') || +true + # If TIMEZONE is not set, use the default timezone echo "[*] Current Timezone : $(date +%Z). IP Timezone: $TIMEZONE"