Loic.Xeroday.Spotify-Ad-Blocker 1.0.0

dotnet add package Loic.Xeroday.Spotify-Ad-Blocker --version 1.0.0
                    
NuGet\Install-Package Loic.Xeroday.Spotify-Ad-Blocker -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Loic.Xeroday.Spotify-Ad-Blocker" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Loic.Xeroday.Spotify-Ad-Blocker" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Loic.Xeroday.Spotify-Ad-Blocker" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Loic.Xeroday.Spotify-Ad-Blocker --version 1.0.0
                    
#r "nuget: Loic.Xeroday.Spotify-Ad-Blocker, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Loic.Xeroday.Spotify-Ad-Blocker@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Loic.Xeroday.Spotify-Ad-Blocker&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Loic.Xeroday.Spotify-Ad-Blocker&version=1.0.0
                    
Install as a Cake Tool

EZBlocker

EZBlocker is a Spotify Ad Blocker written in C# for Windows 7/8/10. The goal for EZBlocker is to be the most reliable ad blocker for Spotify.

When an advertisement is playing, EZBlocker will mute Spotify until it's over.

To download a pre-compiled binary of the latest version, click here. For more info, visit the EZBlocker project page.

Technical overview

The current version of EZBlocker hooks Spotify in three ways: window titles, audio sessions, and a reverse listener.

Window title

The window title is used to grab the name of the currently playing song/artist/advertisement. EZBlocker also uses the window title to grab the Spotify process handle.

Audio session

Using lower level COM interfaces, EZBlocker is able to both find and extract information from Spotify's audio session.

Firstly, if the Spotify window is hidden (in the tray), its window title cannot be used locate the correct Spotify process handle. In this case, EZBlocker falls back to searching through the audio sessions to find the correct process.

Secondly, the audio session is a somewhat reliable way to detect whether or not a song/advertisement is playing regardless of whether or not the Spotify window is hidden. It can be inaccurate at times, eg. when a song has a 3 second gap of no sound, but can automatically recover.

Reverse Listener

I've historically tried to avoid modifying the Spotify application, but since the shutdown of its unofficial local API (in mid July 2018), there was no reliable way to detect if an advertisement was playing.

Spotify is built with the Chromium Embedded Framework, which means many of its components are written in HTML/JS. EZBlocker patches one of them to attach a web worker that sends a signal to a local listener when an advertisement is playing.

More data could probably be extracted through the web worker, but I haven't had time to explore.

Changelog (Major releases only):

  • V 1.7 (July 22, 2018):
    • Almost a complete re-write of the application (lighter, more performant, cleaner code)
    • New Spotify ad detection and muting logic after Spotify's shutdown of its local API
  • V 1.6 (March 10, 2016):
    • Better handling of Spotify updates/restarts
    • Fix bugs caused by newer Spotify local API
    • Update dependencies
    • Now requires .NET Framework 4.5

Translations

To better support non-English speakers, I've started an effort to translate EZBlocker. Please reach out if you are a native speaker of a non-English language.

The following are contributors to this goal:

  • Portuguese: Raí
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 7/31/2021