@@ -22,7 +22,7 @@ readonly YELLOW="\033[00;33m"
2222readonly BOLD=" \033[01m"
2323readonly FINE=" \033[0m"
2424
25- ver=' v1.7.1 '
25+ ver=' v1.7.2 '
2626regex=' (https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*\.[A-Za-z0-9\+&@%#/=~_|():?]+'
2727is_z0r=' http://z0r.it/[^ \n]'
2828url=(http://$1 )
@@ -31,13 +31,14 @@ dep=(curl awk xclip wget)
3131apikey=4e4b657a91
3232clip=$( xclip -o 2> /dev/null)
3333LOGDIR=/$HOME /.z0r_logs
34+ url_e=$( echo " $1 " | sed ' s/?/%3F/' )
3435# upload function (long -> short)
3536shr (){
36- short=$( curl $mode -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&keyword=$2 &format=simply&url=$1 " | awk -F ' /' ' {print$NF}' )
37+ short=$( curl $mode -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&keyword=$2 &format=simply&url=$url_e " | awk -F ' /' ' {print$NF}' )
3738 uc=" http://z0r.it/$short "
3839 if [ -n " $short " ]; then
39- if curl $mode -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&keyword=$2 &format=simply&url=$1 " | grep -q " Errore 406" ; then
40- echo -e $RED " Error 406 - URL not valid(try to use https instead of http)" $FINE
40+ if curl $mode -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&keyword=$2 &format=simply&url=$url_e " | grep -q " Errore 406" ; then
41+ echo -e $RED " Error 406 - URL not valid(try to use https instead of http or try encoding the URL )" $FINE
4142 else
4243 echo " http://z0r.it/$short " && echo " $( date +" %d-%h-%Y %H.%M.%S" ) - $uc - $1 " >> $LOGDIR
4344 echo " $uc " | xclip -selection clipboard
@@ -84,10 +85,10 @@ stats(){
8485}
8586mss (){
8687 for i in ${@: 2} ; do
87- mass=$( curl -s -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&format=simply&url=$i " | awk -F ' /' ' {print$NF}' )
88+ mass=$( curl -s -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&format=simply&url=$( echo $i | sed ' s/?/%3F/ ' ) " | awk -F ' /' ' {print$NF}' )
8889 if wget --spider " $i " 2> /dev/null; then
8990 if [ -n " $mass " ] ; then
90- if curl $mode -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&format=simply&url=$i " | grep -q " Errore 406" ; then
91+ if curl $mode -L " http://z0r.it/yourls-api.php?signature=$apikey &action=shorturl&title=uploaded_with_z0r_script&format=simply&url=$( echo $i | sed ' s/?/%3F/ ' ) " | grep -q " Errore 406" ; then
9192 echo -e $RED " Error 406 - URL not valid(try to use https instead of http)" $FINE
9293 else
9394
0 commit comments