From 263afa9be1c16d484b1494fd339d2cbc7dd71818 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 24 Nov 2024 09:00:59 -0500 Subject: [PATCH] mute download error if content censored --- catalog/search/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/catalog/search/models.py b/catalog/search/models.py index cf017876..34370c19 100644 --- a/catalog/search/models.py +++ b/catalog/search/models.py @@ -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 @@ -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