corrected false positive in abnormal patreon sources.
This commit is contained in:
@@ -305,7 +305,29 @@ class GalleryDLService:
|
|||||||
"""Categorize the error based on output and return code."""
|
"""Categorize the error based on output and return code."""
|
||||||
combined = f"{stdout} {stderr}".lower()
|
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"
|
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:
|
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:
|
if "403" in combined or "forbidden" in combined or "access denied" in combined:
|
||||||
return ErrorType.ACCESS_DENIED, "Access denied - may need higher subscription tier"
|
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:
|
if "http error" in combined:
|
||||||
return ErrorType.HTTP_ERROR, "HTTP error occurred"
|
return ErrorType.HTTP_ERROR, "HTTP error occurred"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user