A few minor progress bar beep tweaks.
This commit is contained in:
		| @@ -99,6 +99,13 @@ class command: | |||||||
|             "Progress detector checking: '" + text + "'", debug.DebugLevel.INFO |             "Progress detector checking: '" + text + "'", debug.DebugLevel.INFO | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|  |         # Filter out URLs to prevent false positives | ||||||
|  |         if self.contains_url(text): | ||||||
|  |             self.env["runtime"]["DebugManager"].write_debug_out( | ||||||
|  |                 "Skipping progress detection - text contains URL", debug.DebugLevel.INFO | ||||||
|  |             ) | ||||||
|  |             return | ||||||
|  |  | ||||||
|         # Note: Auto-disable on 100% completion removed to respect user |         # Note: Auto-disable on 100% completion removed to respect user | ||||||
|         # settings |         # settings | ||||||
|  |  | ||||||
| @@ -151,8 +158,12 @@ class command: | |||||||
|         transfer_match = re.search( |         transfer_match = re.search( | ||||||
|             r"\d+\s+\d+[kMGT]?\s+\d+\s+\d+[kMGT]?.*?\d+\.\d+[kMGT].*?\d+:\d+:\d+", text |             r"\d+\s+\d+[kMGT]?\s+\d+\s+\d+[kMGT]?.*?\d+\.\d+[kMGT].*?\d+:\d+:\d+", text | ||||||
|         ) |         ) | ||||||
|  |         # Pattern 1f: Pacman-style transfer progress (flexible size/speed/time) | ||||||
|  |         pacman_match = re.search( | ||||||
|  |             r"\d+(?:\.\d+)?\s+[kKmMgGtT]iB\s+\d+(?:\.\d+)?\s+[kKmMgGtT]iB/s\s+\d+:\d+", text | ||||||
|  |         ) | ||||||
|  |  | ||||||
|         if time_match or token_match or dd_match or curl_match or transfer_match: |         if time_match or token_match or dd_match or curl_match or transfer_match or pacman_match: | ||||||
|             # For non-percentage progress, use a single activity beep every 2 |             # For non-percentage progress, use a single activity beep every 2 | ||||||
|             # seconds |             # seconds | ||||||
|             if ( |             if ( | ||||||
| @@ -354,5 +365,22 @@ class command: | |||||||
|             # If anything fails, assume it's not a prompt to be safe |             # If anything fails, assume it's not a prompt to be safe | ||||||
|             return False |             return False | ||||||
|  |  | ||||||
|  |     def contains_url(self, text): | ||||||
|  |         """Check if text contains URLs that might cause false progress detection""" | ||||||
|  |         import re | ||||||
|  |          | ||||||
|  |         # Common URL patterns that might contain progress-like patterns | ||||||
|  |         url_patterns = [ | ||||||
|  |             r"https?://[^\s]+",           # http:// or https:// URLs | ||||||
|  |             r"ftp://[^\s]+",              # ftp:// URLs | ||||||
|  |             r"www\.[^\s]+",               # www. domains | ||||||
|  |             r"[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}[/\w.-]*",  # domain.com/path patterns | ||||||
|  |         ] | ||||||
|  |          | ||||||
|  |         for pattern in url_patterns: | ||||||
|  |             if re.search(pattern, text, re.IGNORECASE): | ||||||
|  |                 return True | ||||||
|  |         return False | ||||||
|  |  | ||||||
|     def set_callback(self, callback): |     def set_callback(self, callback): | ||||||
|         pass |         pass | ||||||
|   | |||||||
| @@ -4,6 +4,6 @@ | |||||||
| # Fenrir TTY screen reader | # Fenrir TTY screen reader | ||||||
| # By Chrys, Storm Dragon, and contributors. | # By Chrys, Storm Dragon, and contributors. | ||||||
|  |  | ||||||
| version = "2025.07.13" | version = "2025.07.15" | ||||||
| codeName = "testing" | codeName = "testing" | ||||||
| code_name = "testing" | code_name = "testing" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user