mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-11 17:37:21 +10:00
BIN
res/login.spa
Normal file
BIN
res/login.spa
Normal file
Binary file not shown.
35
run.ps1
35
run.ps1
@@ -388,31 +388,42 @@ $online = ($onlineFull -split ".g")[0]
|
||||
|
||||
function Get {
|
||||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Url,
|
||||
[int]$MaxRetries = 3,
|
||||
[int]$RetrySeconds = 3
|
||||
[int]$RetrySeconds = 3,
|
||||
[string]$OutputPath
|
||||
)
|
||||
|
||||
$retries = 0
|
||||
$params = @{
|
||||
Uri = $Url
|
||||
TimeoutSec = 15
|
||||
}
|
||||
|
||||
while ($retries -lt $MaxRetries) {
|
||||
if ($OutputPath) {
|
||||
$params['OutFile'] = $OutputPath
|
||||
}
|
||||
|
||||
for ($i = 0; $i -lt $MaxRetries; $i++) {
|
||||
try {
|
||||
return Invoke-RestMethod -Uri $Url
|
||||
$response = Invoke-RestMethod @params
|
||||
return $response
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Request failed: $_"
|
||||
$retries++
|
||||
Start-Sleep -Seconds $RetrySeconds
|
||||
Write-Warning "Attempt $($i+1) of $MaxRetries failed: $_"
|
||||
if ($i -lt $MaxRetries - 1) {
|
||||
Start-Sleep -Seconds $RetrySeconds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host
|
||||
Write-Host "ERROR: " -ForegroundColor Red -NoNewline; Write-Host "Failed to retrieve data from $Url" -ForegroundColor White
|
||||
Write-Host
|
||||
|
||||
return $null
|
||||
|
||||
}
|
||||
|
||||
|
||||
function incorrectValue {
|
||||
|
||||
Write-Host ($lang).Incorrect"" -ForegroundColor Red -NoNewline
|
||||
@@ -1807,6 +1818,12 @@ if ($rexex1 -and $rexex2 -and $rexex3) {
|
||||
# Binary patch
|
||||
extract -counts 'exe' -helper 'Binary'
|
||||
|
||||
# fix login for old versions
|
||||
if ([version]$offline -ge [version]"1.1.87.612" -and [version]$offline -le [version]"1.2.5.1006") {
|
||||
$login_spa = Join-Path (Join-Path $env:APPDATA 'Spotify\Apps') 'login.spa'
|
||||
Get -Url (Get-Link -e "/res/login.spa") -OutputPath $login_spa
|
||||
}
|
||||
|
||||
# Start Spotify
|
||||
if ($start_spoti) { Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user