Skip to content

Commit

Permalink
added paste url validator
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailCosmin committed Nov 10, 2022
1 parent 37b8c49 commit cc561d6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/widgets/left.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit cc561d6

Please sign in to comment.