mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
implemented finding actual APK link (not BUNDLE)
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
26
Build.ps1
26
Build.ps1
@@ -39,8 +39,28 @@ $LatestSupported = $LatestSupported.replace(".", "-")
|
|||||||
|
|
||||||
# Get unique key to generate direct link
|
# Get unique key to generate direct link
|
||||||
# https://www.apkmirror.com/apk/google-inc/youtube/
|
# https://www.apkmirror.com/apk/google-inc/youtube/
|
||||||
# $apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
|
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
|
||||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
|
$Parameters = @{
|
||||||
|
Uri = $apkMirrorLink
|
||||||
|
UseBasicParsing = $false # Disabled
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
$Request = Invoke-Webrequest @Parameters
|
||||||
|
# Trying to find correct APK link (not BUNDLE)
|
||||||
|
$nameProp = $Request.ParsedHtml.getElementsByClassName("table-row headerFont")
|
||||||
|
foreach ($element in $nameProp)
|
||||||
|
{
|
||||||
|
foreach ($child in $element.children)
|
||||||
|
{
|
||||||
|
if ($child.innerText -eq "nodpi")
|
||||||
|
{
|
||||||
|
$apkPackageLink = ($element.getElementsByTagName("a") | Select-Object -First 1).nameProp
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = $apkMirrorLink
|
Uri = $apkMirrorLink
|
||||||
UseBasicParsing = $false # Disabled
|
UseBasicParsing = $false # Disabled
|
||||||
@@ -50,7 +70,7 @@ $Request = Invoke-Webrequest @Parameters
|
|||||||
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
|
$nameProp = $Request.ParsedHtml.getElementsByClassName("accent_bg btn btn-flat downloadButton") | ForEach-Object -Process {$_.nameProp}
|
||||||
|
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = $apkMirrorLink + "download/$($nameProp)"
|
Uri = $apkMirrorLink + "/download/$($nameProp)"
|
||||||
UseBasicParsing = $false # Disabled
|
UseBasicParsing = $false # Disabled
|
||||||
Verbose = $true
|
Verbose = $true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,30 @@ Add-Type -Path $AngleSharpAssemblyPath
|
|||||||
|
|
||||||
# Get unique key to generate direct link
|
# Get unique key to generate direct link
|
||||||
# https://www.apkmirror.com/apk/google-inc/youtube/
|
# https://www.apkmirror.com/apk/google-inc/youtube/
|
||||||
|
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
|
||||||
|
$Parameters = @{
|
||||||
|
Uri = $apkMirrorLink
|
||||||
|
UseBasicParsing = $false # Disabled
|
||||||
|
Verbose = $true
|
||||||
|
}
|
||||||
|
$Request = Invoke-Webrequest @Parameters
|
||||||
|
# Trying to find correct APK link (not BUNDLE)
|
||||||
|
$nameProp = $Request.ParsedHtml.getElementsByClassName("table-row headerFont")
|
||||||
|
foreach ($element in $nameProp)
|
||||||
|
{
|
||||||
|
foreach ($child in $element.children)
|
||||||
|
{
|
||||||
|
if ($child.innerText -eq "nodpi")
|
||||||
|
{
|
||||||
|
$apkPackageLink = ($element.getElementsByTagName("a") | Select-Object -First 1).nameProp
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
|
||||||
|
|
||||||
# $apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
|
# $apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-2-android-apk-download/"
|
||||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
|
# $apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/youtube-$($LatestSupported)-android-apk-download/"
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = $apkMirrorLink
|
Uri = $apkMirrorLink
|
||||||
UseBasicParsing = $false # Disabled
|
UseBasicParsing = $false # Disabled
|
||||||
|
|||||||
Reference in New Issue
Block a user