diff --git a/copyvios/checker.py b/copyvios/checker.py index fe27f86..5f8c169 100644 --- a/copyvios/checker.py +++ b/copyvios/checker.py @@ -41,7 +41,11 @@ def _get_results(query): if urlparse(query.url).scheme not in ["http", "https"]: query.error = "bad URI" return - query.result = page.copyvio_compare(query.url) + result = page.copyvio_compare(query.url) + if result.source_chain is page.EMPTY: + query.error = "no data" + return + query.result = result query.result.cached = False else: conn = get_cache_db() diff --git a/templates/index.mako b/templates/index.mako index 150d839..bd7d2fe 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -7,6 +7,10 @@

Unsupported URI scheme: ${query.url | h}.

+ % elif query.error == "no data": +
+

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 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.