From 50020b0e6b4b8df62b5c4e8196758952bb70f96b Mon Sep 17 00:00:00 2001 From: lzzy12 Date: Thu, 26 Sep 2019 05:53:51 +0530 Subject: [PATCH] Fix logic for is_url This is not perfect Signed-off-by: lzzy12 --- bot/helper/download_tools.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bot/helper/download_tools.py b/bot/helper/download_tools.py index 70b1635..fd75f7b 100644 --- a/bot/helper/download_tools.py +++ b/bot/helper/download_tools.py @@ -11,11 +11,10 @@ class DownloadHelper: self.__is_torrent = False def is_url(self, url: str): - try: - urlparse(url) + # TODO: Find the proper way to validate the url + if url.startswith('https://') or url.startswith('http://'): return True - except ValueError: - return False + return False def is_magnet(self, url: str): if "magnet" in url: