diff --git a/copyvios/checker.py b/copyvios/checker.py index 93c4a61..e9108b9 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -51,9 +51,10 @@ def _get_results(query, follow=True): if urlparse(query.url).scheme not in ["http", "https"]: query.error = "bad URI" return - result = page.copyvio_compare(query.url) + max_time = 30 + result = page.copyvio_compare(query.url, max_time=max_time) if result.source_chain is page.EMPTY: - query.error = "no data" + query.error = "timeout" if result.time > max_time else "no data" return query.result = result query.result.cached = False diff --git a/templates/index.mako b/templates/index.mako index 543c70f..d4e8e39 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -11,6 +11,10 @@

Couldn't find any text in ${query.url | h}. Note: only HTML and plain text pages are supported, and content generated by JavaScript or found inside iframes is ignored.

+ % elif query.error == "timeout": +
+

The URL ${query.url | h} timed out before any data could be retrieved.

+
% elif not query.site:

The given site (project=${query.project | h}, language=${query.lang | h}) doesn't seem to exist. It may also be closed or private. Confirm its URL.