corrected false positive in abnormal patreon sources.

This commit is contained in:
Bryan Van Deusen
2026-01-25 19:03:56 -05:00
parent 997f31ae27
commit afba2c0f85
+23 -4
View File
@@ -305,7 +305,29 @@ class GalleryDLService:
"""Categorize the error based on output and return code."""
combined = f"{stdout} {stderr}".lower()
if "401" in combined or "unauthorized" in combined or "login" in combined:
# Check for "no new content" first - skipped files with return code 1 is normal
if return_code == 1:
# Check if output indicates content was processed (skipped = already downloaded)
if "skipping" in combined or "skip" in combined:
return ErrorType.NO_NEW_CONTENT, "No new content to download"
# Empty output with return code 1 often means nothing to download
if not stdout.strip() or "no results" in combined:
return ErrorType.NO_NEW_CONTENT, "No new content to download"
# Auth errors - be more specific to avoid false positives from debug URLs
# Look for actual error messages, not just keywords that appear in URLs
auth_patterns = [
"401",
"unauthorized",
"login required",
"please login",
"must be logged in",
"authentication required",
"session expired",
"invalid cookie",
"cookies are expired",
]
if any(pattern in combined for pattern in auth_patterns):
return ErrorType.AUTH_ERROR, "Authentication failed - cookies may be expired or invalid"
if "429" in combined or "rate limit" in combined or "too many requests" in combined:
@@ -320,9 +342,6 @@ class GalleryDLService:
if "403" in combined or "forbidden" in combined or "access denied" in combined:
return ErrorType.ACCESS_DENIED, "Access denied - may need higher subscription tier"
if return_code == 1 and ("no" in combined or "skip" in combined or not stdout.strip()):
return ErrorType.NO_NEW_CONTENT, "No new content to download"
if "http error" in combined:
return ErrorType.HTTP_ERROR, "HTTP error occurred"