From b19ab4fe32aa30e68235e7b66b419bf222af66a3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 7 Oct 2026 11:54:40 +0200 Subject: Exit cleanly on Ctrl+C KeyboardInterrupt escaped main() and dumped a traceback. Catch it at the entry point, tell the user a rerun resumes the partial file, and exit with status 130. Co-Authored-By: Claude Opus 5.5 --- bunkr_dl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bunkr_dl b/bunkr_dl index 3614745..ef2fa49 100755 --- a/bunkr_dl +++ b/bunkr_dl @@ -20,6 +20,7 @@ import requests from bs4 import BeautifulSoup import re import os +import sys import argparse import time from urllib.parse import urljoin, urlparse, quote @@ -273,4 +274,9 @@ def main(): process_album(url, save_directory) if __name__ == "__main__": - main() + try: + main() + except KeyboardInterrupt: + # Partial file stays on disk; rerunning the same command resumes it + print("\nInterrupted. Rerun the same command to resume.") + sys.exit(130) -- cgit v1.2.3