reformatting
formatting_check / formatting_check (push) Failing after 3s
Python Test / test (.ps1, windows-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, macos-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, ubuntu-latest, 3.9) (push) Has been cancelled
formatting_check / formatting_check (push) Failing after 3s
Python Test / test (.ps1, windows-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, macos-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, ubuntu-latest, 3.9) (push) Has been cancelled
This commit is contained in:
+11
-3
@@ -414,9 +414,13 @@ class RedditConnector(metaclass=ABCMeta):
|
||||
if TooManyRequests is not None and isinstance(e, TooManyRequests):
|
||||
is_rate_limited = True
|
||||
logger.info(f"Rate limited detected: Exception is TooManyRequests for user {user}")
|
||||
elif (hasattr(e, "response") and getattr(e.response, "status_code", None) == 429) or "429" in str(e):
|
||||
elif (hasattr(e, "response") and getattr(e.response, "status_code", None) == 429) or "429" in str(
|
||||
e
|
||||
):
|
||||
is_rate_limited = True
|
||||
logger.info(f"Rate limited detected: Status code 429 or '429' in error message for user {user}. Error: {e}")
|
||||
logger.info(
|
||||
f"Rate limited detected: Status code 429 or '429' in error message for user {user}. Error: {e}"
|
||||
)
|
||||
|
||||
if is_rate_limited:
|
||||
logger.error("Received HTTP 429 (rate limited). Propagating error to fail the download.")
|
||||
@@ -441,7 +445,11 @@ class RedditConnector(metaclass=ABCMeta):
|
||||
|
||||
def create_file_name_formatter(self) -> FileNameFormatter:
|
||||
return FileNameFormatter(
|
||||
self.args.file_scheme, self.args.folder_scheme, self.args.time_format, self.args.filename_restriction_scheme, self.args.strip_unicode
|
||||
self.args.file_scheme,
|
||||
self.args.folder_scheme,
|
||||
self.args.time_format,
|
||||
self.args.filename_restriction_scheme,
|
||||
self.args.strip_unicode,
|
||||
)
|
||||
|
||||
def create_time_filter(self) -> RedditTypes.TimeType:
|
||||
|
||||
Reference in New Issue
Block a user