mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Update Build.ps1
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
12
Build.ps1
12
Build.ps1
@@ -37,8 +37,8 @@ $versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq
|
|||||||
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
|
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
|
||||||
$LatestSupported = $LatestSupported.replace(".", "-")
|
$LatestSupported = $LatestSupported.replace(".", "-")
|
||||||
|
|
||||||
# Get unique key to generate direct link
|
|
||||||
# https://www.apkmirror.com/apk/google-inc/youtube/
|
# https://www.apkmirror.com/apk/google-inc/youtube/
|
||||||
|
# Trying to find correct APK link (not BUNDLE)
|
||||||
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
|
$apkMirrorLink = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupported)-release/"
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = $apkMirrorLink
|
Uri = $apkMirrorLink
|
||||||
@@ -46,21 +46,19 @@ $Parameters = @{
|
|||||||
Verbose = $true
|
Verbose = $true
|
||||||
}
|
}
|
||||||
$Request = Invoke-Webrequest @Parameters
|
$Request = Invoke-Webrequest @Parameters
|
||||||
# Trying to find correct APK link (not BUNDLE)
|
$Request.ParsedHtml.getElementsByClassName("table-row headerFont") | ForEach-Object -Process {
|
||||||
$nameProp = $Request.ParsedHtml.getElementsByClassName("table-row headerFont")
|
foreach ($child in $_.children)
|
||||||
foreach ($element in $nameProp)
|
|
||||||
{
|
|
||||||
foreach ($child in $element.children)
|
|
||||||
{
|
{
|
||||||
if ($child.innerText -eq "nodpi")
|
if ($child.innerText -eq "nodpi")
|
||||||
{
|
{
|
||||||
$apkPackageLink = ($element.getElementsByTagName("a") | Select-Object -First 1).nameProp
|
$apkPackageLink = ($_.getElementsByTagName("a") | Select-Object -First 1).nameProp
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
|
$apkMirrorLink += $apkPackageLink # actual APK link (not BUNDLE)
|
||||||
|
|
||||||
|
# Get unique key to generate direct link
|
||||||
$Parameters = @{
|
$Parameters = @{
|
||||||
Uri = $apkMirrorLink
|
Uri = $apkMirrorLink
|
||||||
UseBasicParsing = $false # Disabled
|
UseBasicParsing = $false # Disabled
|
||||||
|
|||||||
Reference in New Issue
Block a user