less strict filter for raw url downloads
This commit is contained in:
parent
9471aad4ba
commit
d308f48a1e
1 changed files with 4 additions and 3 deletions
|
@ -296,9 +296,10 @@ class DelojzaBot:
|
||||||
if len(ytdl_urls) > 0:
|
if len(ytdl_urls) > 0:
|
||||||
self.handle(ytdl_urls, message, hashtag, self.download_ytdl)
|
self.handle(ytdl_urls, message, hashtag, self.download_ytdl)
|
||||||
if len(normal_urls) > 0:
|
if len(normal_urls) > 0:
|
||||||
image_urls = [url for url in normal_urls if "image" in requests.head(url).headers.get("Content-Type", "")]
|
file_urls = [url for url in normal_urls if
|
||||||
if len(image_urls) > 0:
|
"text" not in requests.head(url).headers.get("Content-Type", "text")]
|
||||||
self.handle(image_urls, message, hashtag, self.download_raw)
|
if len(file_urls) > 0:
|
||||||
|
self.handle(file_urls, message, hashtag, self.download_raw)
|
||||||
|
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
def tg_handle_rest(self, bot, update):
|
def tg_handle_rest(self, bot, update):
|
||||||
|
|
Loading…
Reference in a new issue