-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwget-cli
13 lines (12 loc) · 843 Bytes
/
wget-cli
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
#To use this with Kodi, copy this to /usr/bin/wget-cli. Then add the following to your playercorefactory.xml in the player section.
# <player name="wGet" type="ExternalPlayer" video="true">
# <filename>/usr/bin/wget-cli</filename>
# <args>"{1}" &</args>
# <forceontop>true</forceontop>
# </player>
# If you have trouble, uncomment the following line, and send me the output. I might be able to get it working.
#xterm -hold -e echo "wget $URL -P $HOME/Videos/ $2 $3 $4 $5"
URL=$(echo $1 | sed 's/|User-Agent=.*//')
xterm -hold -e wget "$URL" -O "$HOME/Videos/$(zenity --entry --text "File name?" --entry-text "$(echo $URL| sed s'/\./\n/g' | head -n 2 | tail -n 1 | tr -cd '[:alnum:] [:space:]')-$(date "+%j%H%M%S%N")").mp4" #If you don't want/need it to stay open, remove -hold and it will auto close.
notify-send "file downloaded"