From 9afe906c6e50d6144a428389c4b9004de012e0d5 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 7 Jun 2026 18:19:54 -0400 Subject: [PATCH] Disable non-functional turnitin API --- src/copyvios/checker.py | 10 +++++----- src/copyvios/templates/index.html.jinja | 2 +- src/copyvios/templates/support/cv_form.html.jinja | 2 ++ src/copyvios/turnitin.py | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/copyvios/checker.py b/src/copyvios/checker.py index d8e406f..fa3a161 100644 --- a/src/copyvios/checker.py +++ b/src/copyvios/checker.py @@ -21,7 +21,6 @@ from .cache import cache from .misc import get_sql_error, sql_dialect from .query import APIQuery, CheckQuery from .sites import get_site -from .turnitin import search_turnitin T_POSSIBLE = 0.4 T_SUSPECT = 0.75 @@ -91,14 +90,15 @@ def _get_results( query.action = "compare" if query.url else "search" if query.action == "search": - if not query.use_engine and not query.use_links and not query.turnitin: + if not query.use_engine and not query.use_links: raise CopyvioCheckError(ErrorCode.NO_SEARCH_METHOD) # Handle the Turnitin check turnitin_result = None - if query.turnitin: - assert query.lang - turnitin_result = search_turnitin(page.title, query.lang) + # 2026-06-07: Disabled, API doesn't work + # if query.turnitin: + # assert query.lang + # turnitin_result = search_turnitin(page.title, query.lang) # Handle the copyvio check conn = cache.engine.raw_connection() diff --git a/src/copyvios/templates/index.html.jinja b/src/copyvios/templates/index.html.jinja index ed444bc..b5b187f 100644 --- a/src/copyvios/templates/index.html.jinja +++ b/src/copyvios/templates/index.html.jinja @@ -13,7 +13,7 @@ {% if error.code == ErrorCode.BAD_ACTION %} Unknown action: {{ query.action | e }}. {% elif error.code == ErrorCode.NO_SEARCH_METHOD %} - No copyvio search methods were selected. A check can only be made using the search engine, links present in the page, Turnitin, or some combination of these. + No copyvio search methods were selected. A check can only be made using the search engine, links present in the page, or some combination of these. {% elif error.code == ErrorCode.BAD_OLDID %} The revision ID {{ query.oldid | e }} is invalid. It should be an integer. {% elif error.code == ErrorCode.NO_URL %} diff --git a/src/copyvios/templates/support/cv_form.html.jinja b/src/copyvios/templates/support/cv_form.html.jinja index 817f6bb..2f2013f 100644 --- a/src/copyvios/templates/support/cv_form.html.jinja +++ b/src/copyvios/templates/support/cv_form.html.jinja @@ -70,6 +70,7 @@ +
diff --git a/src/copyvios/turnitin.py b/src/copyvios/turnitin.py index c12d4cb..27e6bae 100644 --- a/src/copyvios/turnitin.py +++ b/src/copyvios/turnitin.py @@ -33,7 +33,7 @@ def _make_api_request(page_title: str, lang: str) -> list[dict]: "report": 1, } - result = requests.get(TURNITIN_API_ENDPOINT, params=api_parameters, verify=False) + result = requests.get(TURNITIN_API_ENDPOINT, params=api_parameters) # use literal_eval to *safely* parse the resulting dict-containing string try: parsed_api_result = ast.literal_eval(result.text)