Repos / pytaku / 7db3cb696d
commit 7db3cb696d1db669a29e3df8662bb25cbce33aec
Author: Bùi Thành Nhân <hi@imnhan.com>
Date: Fri Jan 29 16:11:08 2021 +0700
also look for pages_alt when checking img url
diff --git a/src/pytaku/persistence.py b/src/pytaku/persistence.py
index cf145a7..3747a16 100644
--- a/src/pytaku/persistence.py
+++ b/src/pytaku/persistence.py
@@ -402,10 +402,14 @@ def is_manga_page_url(url):
Checks if url exists in db as a page image.
This is currently used to avoid abuse of our /proxy/ endpoint.
"""
- result = run_sql(
- """
- SELECT 1 FROM chapter, json_each(pages) WHERE value = ? LIMIT 1;
- """,
- (url,),
- )
- return len(result) == 1
+ is_page = run_sql(
+ "SELECT 1 FROM chapter, json_each(pages) WHERE value = ? LIMIT 1;", (url,)
+ ) == [1]
+ if is_page:
+ return True
+
+ is_page_alt = run_sql(
+ "SELECT 1 FROM chapter, json_each(pages_alt) WHERE value = ? LIMIT 1;", (url,)
+ ) == [1]
+
+ return is_page_alt