summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-08-08 21:39:17 +0200
committerBotond Hende <nettingman@gmail.com>2024-08-08 21:39:17 +0200
commited0aa1323a7acae363c670cc1dd6611c09e0c3fb (patch)
tree6ba7dc3c303e791ad52c02986ac27a5a2cdde798 /utils.py
parentc307de76f9b54d5c65196341ee12ea38ac3d6e6b (diff)
extended image handles foreign images
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils.py b/utils.py
new file mode 100644
index 0000000..ea5e0c1
--- /dev/null
+++ b/utils.py
@@ -0,0 +1,3 @@
+def is_foreign_url(link: str, filters: list[str]):
+ dest_lower = link.lower()
+ return (dest_lower.startswith("http://") or dest_lower.startswith("https://")) and not any((elem in dest_lower for elem in filters)) \ No newline at end of file