From 10add79574df3283d7034826e50311faaf61f5f8 Mon Sep 17 00:00:00 2001 From: Chlod Alejandro Date: Fri, 4 Oct 2024 13:19:41 +0800 Subject: [PATCH] Require OAuth for search engine checks Begin requiring OAuth for search engine checks. This adds an extra validation step in checker.py. It occurs after a cached result is checked for, which allows unauthenticated viewers to still preview cached results. --- copyvios/checker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/copyvios/checker.py b/copyvios/checker.py index c892db3..35fdbd2 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -144,6 +144,10 @@ def _perform_check(query, page, use_engine, use_links): _LOGGER.exception("Failed to retrieve cached results") if not query.result: + if use_engine and not query.requester_username and not query.api: + query.error = "not logged in" + return + try: query.result = page.copyvio_check( min_confidence=T_SUSPECT, max_queries=8, max_time=30,