Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpalat committed Mar 29, 2016
1 parent 381c3cf commit aaa29b7
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 77 deletions.
15 changes: 7 additions & 8 deletions addons/Dics/dicts/Baidu.TTS online.Pronunciation.various
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): Chinese, English, Japanese, Portuguese, Spanish
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
if [ "$lgt" = zh-cn ]; then t=zh
elif [ "$lgt" = en ]; then t=en
elif [ "$lgt" = ja ]; then t=jp
elif [ "$lgt" = pt ]; then t=pt
elif [ "$lgt" = es ]; then t=es
fi
export LINK="http://tts.baidu.com/text2audio?lan=$t&ie=UTF-8&text=${word}"
export ex='mp3'
if [ "$lgt" = zh-cn ]; then t=zh
elif [ "$lgt" = en ]; then t=en
elif [ "$lgt" = ja ]; then t=jp
elif [ "$lgt" = pt ]; then t=pt
elif [ "$lgt" = es ]; then t=es; fi
export LINK="http://tts.baidu.com/text2audio?lan=$t&ie=UTF-8&text=${word}"
export ex='mp3'
fi
15 changes: 7 additions & 8 deletions addons/Dics/dicts/Baidu.TTS online.Word pronunciation.various
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): Chinese, English, Japanese, Portuguese, Spanish
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
if [ "$lgt" = zh-cn ]; then t=zh
elif [ "$lgt" = en ]; then t=en
elif [ "$lgt" = ja ]; then t=jp
elif [ "$lgt" = pt ]; then t=pt
elif [ "$lgt" = es ]; then t=es
fi
export LINK="http://tts.baidu.com/text2audio?lan=$t&ie=UTF-8&text=${word}"
export ex='mp3'
if [ "$lgt" = zh-cn ]; then t=zh
elif [ "$lgt" = en ]; then t=en
elif [ "$lgt" = ja ]; then t=jp
elif [ "$lgt" = pt ]; then t=pt
elif [ "$lgt" = es ]; then t=es; fi
export LINK="http://tts.baidu.com/text2audio?lan=$t&ie=UTF-8&text=${word}"
export ex='mp3'
fi
6 changes: 3 additions & 3 deletions addons/Dics/dicts/Cambridge.TTS online.Word pronunciation.en
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
[[ ${#word} -lt 5 ]] && s="${word:0:5}_" || s="${word:0:5}"
export LINK="http://dictionary.cambridge.org/media/british/us_pron/${word:0:1}/${word:0:3}/$s/${word}.mp3"
export ex='mp3'
[[ ${#word} -lt 5 ]] && s="${word:0:5}_" || s="${word:0:5}"
export LINK="http://dictionary.cambridge.org/media/british/us_pron/${word:0:1}/${word:0:3}/$s/${word}.mp3"
export ex='mp3'
fi
4 changes: 2 additions & 2 deletions addons/Dics/dicts/Google TTS.TTS online.Pronunciation.various
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): All
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
export LINK="http://translate.google.com/translate_tts?ie=utf-8&total=1&idx=0&client=t&tl=$lgt&q=${word}"
export ex='mp3'
export LINK="http://translate.google.com/translate_tts?ie=utf-8&total=1&idx=0&client=t&tl=$lgt&q=${word}"
export ex='mp3'
fi
12 changes: 6 additions & 6 deletions addons/Dics/dicts/Google images.Script.Download image.various
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ if [[ "$1" = dlgcnfg ]]; then
source "$DS/ifs/cmns.sh"
msg "$(gettext "Does not need configuration")\n" dialog-information "$4"
else
useragent='Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0'
link="www.google.com/search?q=${1}\&tbm=isch"
imagelink=$(wget -e robots=off --user-agent "$useragent" -qO - "$link" |sed 's/</\n</g' |grep '<a href.*\(png\|jpg\|jpeg\)' |sed 's/.*imgurl=\([^&]*\)\&.*/\1/' |head -n 2 |tail -n1)
imagelink="${imagelink%\%*}"
ext=$(echo $imagelink | sed "s/.*\(\.[^\.]*\)$/\1/")
wget --max-redirect 0 -qO "$DT/$1.jpg" "$urimg" "${imagelink}"
useragent='Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0'
link="www.google.com/search?q=${1}\&tbm=isch"
imagelink=$(wget -e robots=off --user-agent "$useragent" -qO - "$link" |sed 's/</\n</g' |grep '<a href.*\(png\|jpg\|jpeg\)' |sed 's/.*imgurl=\([^&]*\)\&.*/\1/' |head -n 2 |tail -n1)
imagelink="${imagelink%\%*}"
ext=$(echo $imagelink | sed "s/.*\(\.[^\.]*\)$/\1/")
wget --max-redirect 0 -qO "$DT/$1.jpg" "$urimg" "${imagelink}"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): All
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
useragent='Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0'
result=$(curl -s -i --user-agent "$useragent" -d "sl=$2" -d "tl=$3" --data-urlencode text="${1,}" https://translate.google.com)
encoding=$(awk '/Content-Type: .* charset=/ {sub(/^.*charset=["'\'']?/,""); sub(/[ "'\''].*$/,""); print}' <<<"${result}")
iconv -f "${encoding}" <<<"$result" | awk 'BEGIN {RS="</div>"};/<span[^>]* id=["'\'']?result_box["'\'']?/' | html2text -utf8
useragent='Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0'
result=$(curl -s -i --user-agent "$useragent" -d "sl=$2" -d "tl=$3" --data-urlencode text="${1,}" https://translate.google.com)
encoding=$(awk '/Content-Type: .* charset=/ {sub(/^.*charset=["'\'']?/,""); sub(/[ "'\''].*$/,""); print}' <<<"${result}")
iconv -f "${encoding}" <<<"$result" | awk 'BEGIN {RS="</div>"};/<span[^>]* id=["'\'']?result_box["'\'']?/' | html2text -utf8
fi
4 changes: 2 additions & 2 deletions addons/Dics/dicts/Gstaticcom.TTS online.Word pronunciation.en
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
export LINK="http://ssl.gstatic.com/dictionary/static/sounds/de/0/${word}.mp3"
export ex='mp3'
export LINK="http://ssl.gstatic.com/dictionary/static/sounds/de/0/${word}.mp3"
export ex='mp3'
fi

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
[[ ${#word} -lt 5 ]] && s="${word:0:5}_" || s="${word:0:5}"
export LINK="http://www.macmillandictionary.com/media/british/uk_pron/${word:0:1}/${word:0:3}/$s/${word}_British_English_pronunciation.mp3"
export ex='mp3'
[[ ${#word} -lt 5 ]] && s="${word:0:5}_" || s="${word:0:5}"
export LINK="http://www.macmillandictionary.com/media/british/uk_pron/${word:0:1}/${word:0:3}/$s/${word}_British_English_pronunciation.mp3"
export ex='mp3'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ if [[ "$1" = dlgcnfg ]]; then
source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English
\n$(gettext "Does not need configuration")\n" dialog-information "$4"

else
if [ ${#word} -lt 6 ]; then
c=0000000
export LINK="http://media.merriam-webster.com/soundc11/${word:0:1}/${word}${c::-${#word}}1.wav"
export ex='wav'
fi
if [ ${#word} -lt 6 ]; then
c=0000000
export LINK="http://media.merriam-webster.com/soundc11/${word:0:1}/${word}${c::-${#word}}1.wav"
export ex='wav'
fi
fi
10 changes: 5 additions & 5 deletions addons/Dics/dicts/SpanishDict.TTS online.Pronunciation.various
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English, Spanish
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
if [ "$lgt" = en ]; then t=en
elif [ "$lgt" = es ]; then t=es
fi
export LINK="http://audio1.spanishdict.com/audio?lang=$t&text=${word}"
export ex='mp3'
if [ "$lgt" = en ]; then t=en
elif [ "$lgt" = es ]; then t=es
fi
export LINK="http://audio1.spanishdict.com/audio?lang=$t&text=${word}"
export ex='mp3'
fi


Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English, Spanish
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
export LINK="http://audio1.spanishdict.com/audio?lang=es&text=${word}"
export ex='mp3'
export LINK="http://audio1.spanishdict.com/audio?lang=es&text=${word}"
export ex='mp3'
fi


Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ if [[ "$1" = dlgcnfg ]]; then
source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): Italian
\n$(gettext "Does not need configuration")\n" dialog-information "$4"

else
export LINK="http://www.vocabolaudio.com/audio-it/${word}.mp3"
export ex='mp3'
export LINK="http://www.vocabolaudio.com/audio-it/${word}.mp3"
export ex='mp3'
fi

4 changes: 2 additions & 2 deletions addons/Dics/dicts/Vocabulix.TTS online.Word pronunciation.es
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): Spanish
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
export LINK="http://static.vocabulix.com//speech/dict/spanish/${word}.mp3"
export ex='mp3'
export LINK="http://static.vocabulix.com//speech/dict/spanish/${word}.mp3"
export ex='mp3'
fi
6 changes: 3 additions & 3 deletions addons/Dics/dicts/Wiki commons.Script.Download image.various
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [[ "$1" = dlgcnfg ]]; then
source "$DS/ifs/cmns.sh"
msg "$(gettext "Does not need configuration")\n" dialog-information "$4"
else
url="https://commons.wikimedia.org/wiki/$1"
urimg="$(wget -q "$url" -O - |grep -o -P '//upload.*?jpg' |sed -e 's/\(thumb\/\)//g' |sed -e 's/^/http:/g' |head -n1)"
wget -T 51 -q -U Mozilla -O "$DT/$1.jpg" "$urimg"
url="https://commons.wikimedia.org/wiki/$1"
urimg="$(wget -q "$url" -O - |grep -o -P '//upload.*?jpg' |sed -e 's/\(thumb\/\)//g' |sed -e 's/^/http:/g' |head -n1)"
wget -T 51 -q -U Mozilla -O "$DT/$1.jpg" "$urimg"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English, Spanish, Portuguese, Russian, Italian, German, French
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
if [ "$lgt" = en ]; then t=en_GB
elif [ "$lgt" = es ]; then t=es_ES
elif [ "$lgt" = pt ]; then t=pt_PT
elif [ "$lgt" = ru ]; then t=ru_RU
elif [ "$lgt" = it ]; then t=it_IT
elif [ "$lgt" = de ]; then t=de_DE
elif [ "$lgt" = fr ]; then t=fr_FR
fi
export LINK="http://tts.voicetech.yandex.net/tts?format=mp3&quality=hi&platform=web&application=translate&lang=$t&text=${word}"
export ex='mp3'
if [ "$lgt" = en ]; then t=en_GB
elif [ "$lgt" = es ]; then t=es_ES
elif [ "$lgt" = pt ]; then t=pt_PT
elif [ "$lgt" = ru ]; then t=ru_RU
elif [ "$lgt" = it ]; then t=it_IT
elif [ "$lgt" = de ]; then t=de_DE
elif [ "$lgt" = fr ]; then t=fr_FR
fi
export LINK="http://tts.voicetech.yandex.net/tts?format=mp3&quality=hi&platform=web&application=translate&lang=$t&text=${word}"
export ex='mp3'
fi
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ source "$DS/ifs/cmns.sh"
msg "$(gettext "Languages"): English, Spanish, Portuguese, Russian, Italian, German, French
\n$(gettext "Does not need configuration")\n" dialog-information "$4"
else
if [ "$lgt" = en ]; then t=en_GB
elif [ "$lgt" = es ]; then t=es_ES
elif [ "$lgt" = pt ]; then t=pt_PT
elif [ "$lgt" = ru ]; then t=ru_RU
elif [ "$lgt" = it ]; then t=it_IT
elif [ "$lgt" = de ]; then t=de_DE
elif [ "$lgt" = fr ]; then t=fr_FR
fi
export LINK="http://tts.voicetech.yandex.net/tts?format=mp3&quality=hi&platform=web&application=translate&lang=$t&text=${word}"
export ex='mp3'
if [ "$lgt" = en ]; then t=en_GB
elif [ "$lgt" = es ]; then t=es_ES
elif [ "$lgt" = pt ]; then t=pt_PT
elif [ "$lgt" = ru ]; then t=ru_RU
elif [ "$lgt" = it ]; then t=it_IT
elif [ "$lgt" = de ]; then t=de_DE
elif [ "$lgt" = fr ]; then t=fr_FR
fi
export LINK="http://tts.voicetech.yandex.net/tts?format=mp3&quality=hi&platform=web&application=translate&lang=$t&text=${word}"
export ex='mp3'
fi

0 comments on commit aaa29b7

Please sign in to comment.