From ed0aa1323a7acae363c670cc1dd6611c09e0c3fb Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Thu, 8 Aug 2024 21:39:17 +0200 Subject: extended image handles foreign images --- utils.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 utils.py (limited to 'utils.py') 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 -- cgit v1.2.3-70-g09d2