Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Disable Spotify Live Tiles breaks playback #415

Open
yodaluca23 opened this issue Aug 21, 2024 · 0 comments
Open

[Bug]: Disable Spotify Live Tiles breaks playback #415

yodaluca23 opened this issue Aug 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yodaluca23
Copy link

Description

When running "Block Spotify Live Tile hosts" Spotify often refuses to play longer than 5-6 seconds of a song, and is unable to fetch Ablum Art properly.

How can the bug be recreated?

  1. Open Privacy.Sexy on Windows
  2. Select switch for "Block Spotify Live Tile hosts"
  3. Run the script.
  4. Open Spotify
  5. Play somthing.
  6. Skip a couple of songs.
  7. Eventually it'll just stop playing...

Operating system

Edition Windows 11 Pro
Version 23H2
Installed on ‎8/‎5/‎2024
OS build 22631.4037
Experience Windows Feature Experience Pack 1000.22700.1027.0

Script file

@echo off
:: https://privacy.sexy — v0.13.6 — Wed, 21 Aug 2024 22:45:39 GMT
:: Ensure admin privileges
fltmc >nul 2>&1 || (
echo Administrator privileges are required.
PowerShell Start -Verb RunAs '%0' 2> nul || (
echo Right-click on the script and select "Run as administrator".
pause & exit 1
)
exit 0
)
:: Initialize environment
setlocal EnableExtensions DisableDelayedExpansion

:: ----------------------------------------------------------
:: ----------Block Spotify Live Tile hosts (revert)----------
:: ----------------------------------------------------------
echo --- Block Spotify Live Tile hosts (revert)
:: Remove hosts entries for spclient.wg.spotify.com
PowerShell -ExecutionPolicy Unrestricted -Command "$domain ='spclient.wg.spotify.com'; $hostsFilePath = "^""$env:WINDIR\System32\drivers\etc\hosts"^""; $comment = "^""managed by privacy.sexy"^""; $hostsFileEncoding = [System.Text.Encoding]::UTF8; $blockingHostsEntries = @(; @{ AddressType = "^""IPv4"^""; IPAddress = '0.0.0.0'; }; @{ AddressType = "^""IPv6"^""; IPAddress = '::1'; }; ); try { $isHostsFilePresent = Test-Path -Path $hostsFilePath -PathType Leaf -ErrorAction Stop; } catch { Write-Error "^""Failed to check hosts file existence. Error: $"^""; exit 1; }; if (-Not $isHostsFilePresent) { Write-Output 'Skipping, the hosts file does not exist.'; exit 0; }; foreach ($blockingEntry in $blockingHostsEntries) { Write-Output "^""Processing removal for $($blockingEntry.AddressType) entry."^""; try { $hostsFileContents = [System.IO.File]::ReadAllText($hostsFilePath, $hostsFileEncoding); } catch { Write-Error "^""Failed to read the hosts file for removal. Error: $"^""; continue; }; $hostsEntryLine = "^""$($blockingEntry.IPAddress)`t$domain $([char]35) $comment"^""; if ([String]::IsNullOrWhiteSpace($hostsFileContents) -Or (-Not $hostsFileContents.Contains($hostsEntryLine))) { Write-Output 'Skipping, entry not found.'; continue; }; $hostsEntryRemovalPattern = [regex]::Escape($hostsEntryLine) + "^""(\r?\n)?"^""; $hostsFileContentAfterRemoval = $hostsFileContents -Replace $hostsEntryRemovalPattern, "^"""^""; try { [System.IO.File]::WriteAllText($hostsFilePath, $hostsFileContentAfterRemoval, $hostsFileEncoding); Write-Output 'Successfully removed the entry.'; } catch { Write-Error "^""Failed to remove the entry. Error: $_"^""; continue; }; }"
:: ----------------------------------------------------------

:: Pause the script to view the final state
pause
:: Restore previous environment settings
endlocal
:: Exit the script successfully
exit /b 0

Screenshots

image

Additional information

No response

@yodaluca23 yodaluca23 added the bug Something isn't working label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant