From d308f48a1e9b52b30832702cda0be71cdd111a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 4 May 2019 23:27:28 +0200 Subject: [PATCH] less strict filter for raw url downloads --- delojza.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/delojza.py b/delojza.py index 1be6575..3cc6add 100755 --- a/delojza.py +++ b/delojza.py @@ -296,9 +296,10 @@ class DelojzaBot: if len(ytdl_urls) > 0: self.handle(ytdl_urls, message, hashtag, self.download_ytdl) if len(normal_urls) > 0: - image_urls = [url for url in normal_urls if "image" in requests.head(url).headers.get("Content-Type", "")] - if len(image_urls) > 0: - self.handle(image_urls, message, hashtag, self.download_raw) + file_urls = [url for url in normal_urls if + "text" not in requests.head(url).headers.get("Content-Type", "text")] + if len(file_urls) > 0: + self.handle(file_urls, message, hashtag, self.download_raw) # noinspection PyBroadException def tg_handle_rest(self, bot, update):