Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mute download error if content censored #778

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion catalog/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from loguru import logger
from rq.job import Job

from catalog.common.downloaders import RESPONSE_CENSORSHIP, DownloadError
from catalog.common.sites import SiteManager

from ..models import Item, TVSeason
Expand Down Expand Up @@ -156,6 +157,9 @@ def _fetch_task(url, is_refetch, user):
item_url = item.url
else:
logger.error(f"fetch {url} failed")
except DownloadError as e:
if e.response_type != RESPONSE_CENSORSHIP:
logger.error(f"fetch {url} error", extra={"exception": e})
except Exception as e:
logger.error(f"fetch {url} error", extra={"exception": e})
logger.error(f"parse {url} error", extra={"exception": e})
return item_url