diff --git a/daily_sunrise_video.sh b/daily_sunrise_video.sh index e1795d6..0d04d76 100755 --- a/daily_sunrise_video.sh +++ b/daily_sunrise_video.sh @@ -54,9 +54,8 @@ if ! $TEST_MODE; then echo "Error: Failed to retrieve sunrise time." exit 1 fi - echo "Sunrise (UTC): $sunrise_time" + echo "Sunrise (local): $sunrise_time" sunrise_time_local=$(TZ="$TIMEZONE" date -d "$sunrise_time" +"%H-%M-%S") - echo "Sunrise (local): $sunrise_time_local" SR_TIME=$(echo "$sunrise_time_local" | cut -d'-' -f1,2 | tr '-' ':') fi @@ -111,7 +110,9 @@ if [ "${#images[@]}" -lt 1 ]; then echo "No images found." exit 1 fi -echo "Images: ${#images[@]}" +first_t=$(basename "${images[0]}" .jpg | tr '-' ':') +last_t=$(basename "${images[-1]}" .jpg | tr '-' ':') +echo "Images: ${#images[@]} (${first_t} → ${last_t} overlay: ${SR_TIME})" # Concat list with explicit frame duration so each frame represents real elapsed # time. Without this, all frames collapse to timestamp 0 → one-frame video. diff --git a/sunrise2mm.py b/sunrise2mm.py index 5163771..34d50ea 100755 --- a/sunrise2mm.py +++ b/sunrise2mm.py @@ -146,6 +146,9 @@ while True: continue if not post.get('file_ids'): continue + # Only delete posts this script created — message starts with "Sunrise YYYY-MM-DD" + if not re.match(r'^Sunrise \d{4}-\d{2}-\d{2}', post.get('message', '')): + continue if post['create_at'] >= cutoff_ms: continue del_r = requests.delete(