Coder Social home page Coder Social logo

adrao / spotify-ad-blocker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xeroday/spotify-ad-blocker

0.0 1.0 0.0 7.08 MB

EZBlocker - A Spotify Ad Blocker for Windows

Home Page: https://www.ericzhang.me/projects/spotify-ad-blocker-ezblocker/

License: GNU General Public License v3.0

C# 92.23% PowerShell 7.77%

spotify-ad-blocker's Introduction

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í

spotify-ad-blocker's People

Contributors

xeroday avatar danielchalmers avatar ceejaycee avatar georgeto avatar avelure avatar avidort avatar novaki92 avatar richardhabeeb avatar zacbre avatar war59312 avatar andreabresolin avatar zoef avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.