mirror of
https://github.com/FiorenMas/Revanced-And-Revanced-Extended-Non-Root.git
synced 2025-12-06 16:17:40 +00:00
Fix apkmirror
This commit is contained in:
@@ -12,6 +12,7 @@ checker "kitadai31/revanced-patches-android6-7" "revanced-extended-android-6-7"
|
|||||||
# Download requirement patches
|
# Download requirement patches
|
||||||
dl_gh "revanced-patches-android6-7 revanced-integrations" "kitadai31" "latest"
|
dl_gh "revanced-patches-android6-7 revanced-integrations" "kitadai31" "latest"
|
||||||
dl_gh "revanced-cli" "inotia00" "latest"
|
dl_gh "revanced-cli" "inotia00" "latest"
|
||||||
|
dl_htmlq
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ checker "inotia00/revanced-patches" "revanced-extended"
|
|||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
# Download requirement patches
|
# Download requirements
|
||||||
dl_gh "revanced-patches revanced-cli revanced-integrations" "inotia00" "latest"
|
dl_gh "revanced-patches revanced-cli revanced-integrations" "inotia00" "latest"
|
||||||
|
dl_htmlq
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ checker "revanced/revanced-patches" "revanced"
|
|||||||
|
|
||||||
# Download requirement patches
|
# Download requirement patches
|
||||||
dl_gh "revanced-patches revanced-cli revanced-integrations" "revanced" "latest"
|
dl_gh "revanced-patches revanced-cli revanced-integrations" "revanced" "latest"
|
||||||
|
dl_htmlq
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ fi
|
|||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
|
# Download the htmlq for to get apk from APKMirror
|
||||||
|
dl_htmlq() {
|
||||||
|
req "https://github.com/mgdm/htmlq/releases/latest/download/htmlq-x86_64-linux.tar.gz" "./htmlq.tar.gz"
|
||||||
|
tar -xf "./htmlq.tar.gz" -C "./"
|
||||||
|
rm "./htmlq.tar.gz"
|
||||||
|
HTMLQ="./htmlq"
|
||||||
|
}
|
||||||
|
|
||||||
|
#################################################
|
||||||
|
|
||||||
# Download Github assets requirement:
|
# Download Github assets requirement:
|
||||||
dl_gh() {
|
dl_gh() {
|
||||||
for repo in $1 ; do
|
for repo in $1 ; do
|
||||||
@@ -64,9 +74,21 @@ get_ver() {
|
|||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
# Download apks files from APKMirror:
|
# Download apks files from APKMirror:
|
||||||
req() {
|
|
||||||
wget -nv -O "$2" -U "Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0" "$1"
|
_req() {
|
||||||
|
if [ "$2" = - ]; then
|
||||||
|
wget -nv -O "$2" --header="$3" "$1"
|
||||||
|
else
|
||||||
|
local dlp
|
||||||
|
dlp="$(dirname "$2")/$(basename "$2")"
|
||||||
|
if [ -f "$dlp" ]; then
|
||||||
|
while [ -f "$dlp" ]; do sleep 1; done
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
wget -nv -O "$dlp" --header="$3" "$1" || return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
req() { _req "$1" "$2" "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0"; }
|
||||||
|
|
||||||
get_apk_vers() {
|
get_apk_vers() {
|
||||||
req "$1" - | sed -n 's;.*Version:</span><span class="infoSlide-value">\(.*\) </span>.*;\1;p'
|
req "$1" - | sed -n 's;.*Version:</span><span class="infoSlide-value">\(.*\) </span>.*;\1;p'
|
||||||
@@ -81,11 +103,17 @@ get_largest_ver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dl_apk() {
|
dl_apk() {
|
||||||
local url=$1 regexp=$2 output=$3
|
local url=$1 regexp=$2 output=$3 resp
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")"
|
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n "s/href=\"/@/g; s;.*${regexp}.*;\1;p")"
|
||||||
echo "$url"
|
echo "$url"
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "a.accent_bg.btn")
|
||||||
url="https://www.apkmirror.com$(req "$url" - | tr '\n' ' ' | sed -n 's;.*href="\(.*key=[^"]*\)">.*;\1;p')"
|
resp=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]")
|
||||||
|
if [[ -z $resp ]]; then
|
||||||
|
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "a.accent_bg.btn")
|
||||||
|
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]")
|
||||||
|
else
|
||||||
|
url=$(req "$url" - | $HTMLQ --base https://www.apkmirror.com --attribute href "span > a[rel = nofollow]")
|
||||||
|
fi
|
||||||
req "$url" "$output"
|
req "$url" "$output"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user