Skip to content

Instantly share code, notes, and snippets.

@eddiezato
Last active February 8, 2022 04:21
Show Gist options
  • Save eddiezato/428487e670ff6b360e4c2ab9f150a932 to your computer and use it in GitHub Desktop.
Save eddiezato/428487e670ff6b360e4c2ab9f150a932 to your computer and use it in GitHub Desktop.
Get Google Chrome Offline Installer URLs [Windows x64] [PowerShell]
$request_json = @"
{
"request": {
"protocol": "3.1",
"dedup": "cr",
"ismachine": 1,
"hw": {
"physmemory": "16",
"sse3": "1",
"avx": "1"
},
"os": {
"platform": "win",
"version": "10.0.22000",
"arch": "x86_64"
},
"app": [
{
"appid": "{8A69D345-D564-463C-AFF1-A69D9E530F96}",
"updatecheck": {}
},
{
"appid": "{8237E44A-0054-442C-B6B6-EA0509993955}",
"updatecheck": {}
},
{
"appid": "{401C381F-E0DE-4B85-8BD8-3F3F14FBDA57}",
"updatecheck": {}
},
{
"appid": "{4EA16AC7-FD5A-47C3-875B-DBF4A2008C20}",
"ap": "x64-canary",
"updatecheck": {}
}
]
}
}
"@
$response_json = $null
try { $response_json = (Invoke-RestMethod -Method Post -Uri "https://tools.google.com/service/update2/json" -Body $request_json).Replace(")]}'`n", "") | ConvertFrom-Json }
catch { Write-Host "Something went wrong" -ForegroundColor Red; exit 1 }
class cVersion {
[string] $Channel
[string] $Version
[string] $URL
}
$urls = @()
if ($response_json -ne $null) {
foreach($app in $response_json.response.app) {
$urls += [cVersion]@{
Channel = $app.cohortname
Version = $app.updatecheck.manifest.version
URL = -join @(($app.updatecheck.urls.url | where { $_.codebase -match "https://dl.google.com" }).codebase,
$app.updatecheck.manifest.packages.package[0].name
)
}
}
Write-Output $urls | Format-Table
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment