enable sending unsupported versions to google forms

This commit is contained in:
amd64fox
2025-10-13 07:51:54 +03:00
parent cb1eab3663
commit 6d9a3ec257
+30 -25
View File
@@ -776,35 +776,40 @@ if ($spotifyInstalled) {
# Unsupported version Spotify # Unsupported version Spotify
if ($testversion) { if ($testversion) {
# Submit unsupported version of Spotify to google form for further processing # Submit unsupported version of Spotify to google form for further processing
try {
# Country check
$country = [System.Globalization.RegionInfo]::CurrentRegion.EnglishName
$txt = [IO.File]::ReadAllText($spotifyExecutable) $binary = if (Test-Path $spotifyDll) {
$regex = "(?<![\w\-])(\d+)\.(\d+)\.(\d+)\.(\d+)(\.g[0-9a-f]{8})(?![\w\-])" $spotifyDll
$matches = [regex]::Matches($txt, $regex) }
$ver = $matches[0].Value else {
$spotifyExecutable
}
$Parameters = @{ Start-Job -ScriptBlock {
Uri = 'https://docs.google.com/forms/d/e/1FAIpQLSegGsAgilgQ8Y36uw-N7zFF6Lh40cXNfyl1ecHPpZcpD8kdHg/formResponse' param($binary, $win_os, $psv, $online, $offline)
Method = 'POST'
Body = @{ try {
'entry.620327948' = $ver $country = [System.Globalization.RegionInfo]::CurrentRegion.EnglishName
'entry.1951747592' = $country $txt = [IO.File]::ReadAllText($binary)
'entry.1402903593' = $win_os $regex = "(?<![\w\-])(\d+)\.(\d+)\.(\d+)\.(\d+)(\.g[0-9a-f]{8})(?![\w\-])"
'entry.860691305' = $psv $matches = [regex]::Matches($txt, $regex)
'entry.2067427976' = $online + " < " + $offline $ver = $matches[0].Value
} $Parameters = @{
Uri = 'https://docs.google.com/forms/d/e/1FAIpQLSegGsAgilgQ8Y36uw-N7zFF6Lh40cXNfyl1ecHPpZcpD8kdHg/formResponse'
Method = 'POST'
Body = @{
'entry.620327948' = $ver
'entry.1951747592' = $country
'entry.1402903593' = $win_os
'entry.860691305' = $psv
'entry.2067427976' = $online + " < " + $offline
}
}
Invoke-WebRequest @Parameters -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null
} }
# $null = Invoke-WebRequest -useb @Parameters catch { }
} } -ArgumentList $binary, $win_os, $psv, $online, $offline | Out-Null
catch {
Write-Host 'Unable to submit new version of Spotify'
Write-Host "error description: "$Error[0]
Write-Host
}
if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_uninstall) { if ($confirm_spoti_recomended_over -or $confirm_spoti_recomended_uninstall) {
Write-Host ($lang).NewV`n Write-Host ($lang).NewV`n