Commit 303cb135 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play assistant: add URI checking and fix download on Ubuntu

parent 80a958ff
......@@ -18,16 +18,25 @@ fi
arch="$($DISTRVENDOR -a)"
pkg="$($DISTRVENDOR -p)"
# some locale depend troubles (ALT with bash 4 needs LANG=ru_RU.UTF-8, Ubuntu with bash 5 needs LANG=C.UTF-8)
#URL="https://мойассистент.рф/скачать"
URL="https://xn--80akicokc0aablc.xn--p1ai/%D1%81%D0%BA%D0%B0%D1%87%D0%B0%D1%82%D1%8C"
if ! LANG=ru_RU.UTF8 check_url_is_accessible "$URL" ; then
epm tool eget -O- "$URL"
fatal "Please, check why $URL is not accessible"
fi
# parse vendor site
tmpfile=$(mktemp)
LANG=ru_RU.UTF8 epm tool eget -q -O- "https://мойассистент.рф/скачать" | grep -A50 "Ассистент для LINUX" >$tmpfile
epm tool eget -q -O- "$URL" | grep -A50 "Ассистент для LINUX" >$tmpfile
url_by_order()
{
local order="$1"
local pkg="$(cat $tmpfile | grep "/Download/" | $order -n1 | sed -e 's|.*href="||' -e 's|".*||')"
[ -n "$pkg" ] || fatal "Can't get Download href"
echo "https://мойассистент.рф$pkg"
#echo "https://мойассистент.рф$pkg"
echo "https://xn--80akicokc0aablc.xn--p1ai$pkg"
}
case $arch-$pkg in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment