#!/bin/bash

############################################################
############################################################
############################################################
# Project : Web Video Downloader  
# Version : 0.1
# Dependencies : zenity , cclive
# Language : English 
# License : GNU GPL - http://www.gnu.org/licenses/gpl.html
# Author : Hilger Sébastien
# Contact : hilger.sebastien@gmail.com
############################################################
############################################################
############################################################



#\ \      / /__| |_\ \   / (_) __| | ___  ___  
# \ \ /\ / / _ \ '_ \ \ / /| |/ _` |/ _ \/ _ \ 
#  \ V  V /  __/ |_) \ V / | | (_| |  __/ (_) |
#   \_/\_/ \___|_.__/ \_/  |_|\__,_|\___|\___/ 
#                                              
# ____                      _                 _           
#|  _ \  _____      ___ __ | | ___   __ _  __| | ___ _ __ 
#| | | |/ _ \ \ /\ / / '_ \| |/ _ \ / _` |/ _` |/ _ \ '__|
#| |_| | (_) \ V  V /| | | | | (_) | (_| | (_| |  __/ |   
#|____/ \___/ \_/\_/ |_| |_|_|\___/ \__,_|\__,_|\___|_| 




# FUNCTION / FUNCTIONS #####################################

green='\e[1;32m'
yellow='\e[1;33m'
orange='\e[1;33m'
red='\e[1;31m'
nocolor='\[1;m'


f_Link(){
	URL=$(zenity --title="WebVideoDownloader" --entry --text="Url : ") && echo "Url -> $URL" && xterm -e "cclive $URL" && zenity --info --text="Donwload finish !" || zenity --info --text="Error link !" 
	
}

f_Informations(){
	zenity --title="Web Video Downloader" --info --text="This application support : YouTube, Daylimotion ... "
	zenity --title="Web Video Downloader" --info --text="Dependencies : xterm , cclive , zenity "
	zenity --title="Web Video Downloader" --info --text="License : GNU GPL V3 / contact : hilger.sebastien@gmail.com"
}

# BODY #####################################################

cd ~/

CHOICE=$(zenity --title="WebVideoDownloader" --list --text="Choice : " --column="Mode " Link Informations)
if [ "$CHOICE" = "Link" ]
then
	f_Link
elif [ "$CHOICE" = "Informations" ]
then
	f_Informations
fi

