aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-07 11:54:40 +0200
committerDanilo M. <danix@danix.xyz>2026-10-07 11:54:40 +0200
commitb19ab4fe32aa30e68235e7b66b419bf222af66a3 (patch)
tree54a587ab9d69717bc6416fb60b01eb07e95d6430
parent880d458e31baf1eceb3ae62bb69fdc56332d1558 (diff)
downloadbunkr_dl-b19ab4fe32aa30e68235e7b66b419bf222af66a3.tar.gz
bunkr_dl-b19ab4fe32aa30e68235e7b66b419bf222af66a3.zip
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 <noreply@anthropic.com>
-rwxr-xr-xbunkr_dl8
1 files changed, 7 insertions, 1 deletions
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)