Skip to content

Commit

Permalink
Update YouTube.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 authored Mar 29, 2024
1 parent d644ed7 commit f4cc431
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Scripts/YouTube.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Get latest supported YouTube client version via ReVancedTemp JSON
# It will let us to download always latest YouTube apk supported by ReVancedTemp team
# https://github.com/revanced/revanced-patches/blob/main/patches.json
# Get the latest supported YouTube version to patch
# https://api.revanced.app/docs/swagger
$Parameters = @{
Uri = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json"
Uri = "https://api.revanced.app/v2/patches/latest"
UseBasicParsing = $true
Verbose = $true
}
$JSON = Invoke-RestMethod @Parameters
$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
# Temp workaround
$LatestSupported = "19.09.37"
$LatestSupported = ((Invoke-RestMethod @Parameters).patches | Where-Object -FilterScript {$_.name -eq "Video ads"}).compatiblePackages.versions | Sort-Object -Descending -Unique | Select-Object -First 1

# We need a NON-bundle version
# https://apkpure.net/ru/youtube/com.google.android.youtube/versions
Expand Down

0 comments on commit f4cc431

Please sign in to comment.