fix apkmirror for apps with no variant

This commit is contained in:
j-hc 2024-04-07 18:30:29 +03:00
parent f4b133523a
commit e28b99d8ca
No known key found for this signature in database
GPG Key ID: CDF97F1DBFE904CD

View File

@ -222,6 +222,8 @@ dl_apkmirror() {
else apparch=("$arch" universal noarch 'arm64-v8a + armeabi-v7a'); fi else apparch=("$arch" universal noarch 'arm64-v8a + armeabi-v7a'); fi
url="${url}/${url##*/}-${version//./-}-release/" url="${url}/${url##*/}-${version//./-}-release/"
resp=$(req "$url" -) || return 1 resp=$(req "$url" -) || return 1
node=$($HTMLQ "div.table-row.headerFont:nth-last-child(1)" -r "span:nth-child(n+3)" <<<"$resp")
if [ "$node" ]; then
for ((n = 1; n < 40; n++)); do for ((n = 1; n < 40; n++)); do
node=$($HTMLQ "div.table-row.headerFont:nth-last-child($n)" -r "span:nth-child(n+3)" <<<"$resp") node=$($HTMLQ "div.table-row.headerFont:nth-last-child($n)" -r "span:nth-child(n+3)" <<<"$resp")
if [ -z "$node" ]; then break; fi if [ -z "$node" ]; then break; fi
@ -234,7 +236,9 @@ dl_apkmirror() {
fi fi
done done
[ -z "$dlurl" ] && return 1 [ -z "$dlurl" ] && return 1
url=$(req "$dlurl" - | $HTMLQ --base https://www.apkmirror.com --attribute href "a.btn") || return 1 resp=$(req "$dlurl" -)
fi
url=$(echo "$resp" | $HTMLQ --base https://www.apkmirror.com --attribute href "a.btn") || return 1
if [ "$apkorbundle" = BUNDLE ] && [[ "$url" != *"&forcebaseapk=true" ]]; then url="${url}&forcebaseapk=true"; fi if [ "$apkorbundle" = BUNDLE ] && [[ "$url" != *"&forcebaseapk=true" ]]; then url="${url}&forcebaseapk=true"; fi
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]") || return 1 url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]") || return 1
req "$url" "$output" req "$url" "$output"