From 34ed4ee4c1531cbea27e3fbc3b4a0170b1a6b475 Mon Sep 17 00:00:00 2001 From: Justin Moore Date: Wed, 4 Mar 2015 19:01:03 -0600 Subject: [PATCH] Video URL is now checked for validity --- lib/logic.lib | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/logic.lib b/lib/logic.lib index 7ad8b7d..f61467f 100644 --- a/lib/logic.lib +++ b/lib/logic.lib @@ -41,12 +41,29 @@ gui() { VIDURL=$(${SET_GUI_BIN} --title="Zymp3 0.1-6" --height=${URL_BOX_HEIGHT} --width=${URL_BOX_WIDTH} --entry --text "Paste youtube link here: ") - if [[ $? == 0 ]] ; then - gui2 + + if [[ ${VIDURL} == *"https://www.youtube.com"* ]];then + echo "valid URL" + if [[ $? == 0 ]] ; then + gui2 + + else + exit 0; + fi else - exit 0; + echo "This is not a valid URL, please double check it." + ${SET_GUI_BIN} --error --text "This is not a valid URL, please double check it." + if [[ $? == 0 ]] ; then + gui + + else + exit 0; + fi fi + + +