From cc561d666f39b509f67faa10db86d508f55c2deb Mon Sep 17 00:00:00 2001 From: Mihail-Cosmin Munteanu Date: Thu, 10 Nov 2022 20:29:24 +0100 Subject: [PATCH] added paste url validator --- src/widgets/left.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/widgets/left.py b/src/widgets/left.py index 6ec5905..669c379 100644 --- a/src/widgets/left.py +++ b/src/widgets/left.py @@ -110,11 +110,10 @@ def _queue_right_click_menu(self, pos): paste = clipboard_paste().replace("\n", " ") single_url_regex = r"https[-:/a-zA-Z0-9\.\-\?\&\=\_]*" if paste.count("https") > 1: - print("multi") for url in findall(single_url_regex, paste, V1): - self._add_current_url_to_queue(url) - else: - print("single") + if "http" in url and "youtube" in url: + self._add_current_url_to_queue(url) + elif "http" in url and "youtube" in url: self._add_current_url_to_queue(paste) def _add_current_url_to_queue(self, url: str = None):