Git Product home page Git Product logo

blockify's Introduction

blockify

Important: This application is no longer being maintained. Please note that using ad blockers is prohibited by Spotify. I highly encourage everyone to support Spotify and your favorite artists by buying a subscription.

Blockify is a linux only application that allows you to automatically mute songs and advertisements in Spotify.

Installation

Dependencies

Mandatory:

Optional but highly recommended:

  • Pulseaudio (allows muting Spotify instead of all system sound)
  • Gstreamer1.0 (used to play music of your choice during muted ads. Requires pulseaudio.)

Optional:

  • docopt (provides a command-line interface for blockify and blockify-ui)

On ArchLinux, you can install all dependencies as follows:
pacman -S git python-pip gst-python pulseaudio alsa-utils pygtk python-dbus python-gobject python-docopt wmctrl

Package Manager

Arch Linux

Available via AUR here: https://aur.archlinux.org/packages/?O=0&K=blockify

Example ArchLinux installation routine:

git clone https://aur.archlinux.org/blockify.git
cd blockify
makepkg -sri

Fedora and openSUSE

Available in the openSUSE build service.

Debian

sudo apt-get install gir1.2-gstreamer-0.10 gir1.2-gstreamer-1.0 python-gst-1.0
sudo apt-get install libdbus-1-dev libdbus-glib-1-dev
sudo pip3 install dbus-python
sudo pip3 install git+https://github.com/serialoverflow/blockify

Manual (pip/setup.py)

If there is no blockify package available on your distribution, you'll have to install it directly via one of pythons many installation tools.

Package names are for ArchLinux and will probably differ slightly between distributions.

Preparation (for Ubuntu):

# Install Spotify beta
echo deb http://repository.spotify.com testing non-free | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt-get update
sudo apt-get install spotify-client
# Install blockify dependencies
sudo apt-get install git python3-pip python3-gst-1.0 python3-requests python3-docopt python3-setuptools wmctrl

Install routine:

# Install blockify
sudo pip3 install git+https://github.com/serialoverflow/blockify
echo -e '[Desktop Entry]\nName=Blockify\nComment=Blocks Spotify commercials\nExec=blockify-ui\nIcon='$(python3 -c 'import pkg_resources; print(pkg_resources.resource_filename("blockify", "data/icon-red-512.png"))')'\nType=Application\nCategories=AudioVideo' | sudo tee /usr/share/applications/blockify.desktop

Usage

Requirements

It is important to know that blockify relies on dbus (and, for some features, on pulseaudio) for ad detection.
If any of these statements are true for your configuration, ad detection will not work:

  • DBus is disabled
  • Spotify is minimized to the system tray (task bar is fine)
  • Notifications are disabled in Spotify

Additionally, blockify makes use of pulseaudio sinks, allowing processes to be muted individually.
If you do not have/want pulseaudio, blockify will mute the system sound during commercials instead of just Spotify. The interlude music feature will not work as a consequence.

Detection

Blockify will automatically detect and block ads for you so besides starting it after running spotify, there's not a lot to do.
However, it also comes with the option to complement or replace that autoblock functionality with a blocklist (saved as ~/.config/blockify/blocklist.txt).
Blocklist entries are case-sensitive and greedy, e.g. the entry Blood would match any artist starting with those exact five letters.

Controls/Actions

Blockify accepts several signals:

  • SIGINT(9)/SIGTERM(15): Exit cleanly.
  • SIGUSR1(10): Block current song.
  • SIGUSR2(12): Unblock current song.
  • SIGRTMIN(34): Play previous spotify song.
  • SIGRTMIN+1(35): Play next spotify song.
  • SIGRTMIN+2(36): Toggle play/pause the current spotify song.
  • SIGRTMIN+3(37): Toggle block state of current song.
  • SIGRTMIN+10(44): Play previous interlude song.
  • SIGRTMIN+11(45): Play next interlude song.
  • SIGRTMIN+12(46): Toggle play/pause the current interlude song.
  • SIGRTMIN+13(47): Toggle interlude autoresume.

To easily use these signals add the following function to your .bashrc:

bb() {
    local signal
    case "$1" in
        '')  blockify-dbus get 2>/dev/null && return 0;;
        ex|exit)
            signal='TERM';;       # Exit
        b|block)
            signal='USR1';;       # Block
        u|unblock)
            signal='USR2';;       # Unblock
        p|previous)
            signal='RTMIN';;      # Previous song
        n|next)
            signal='RTMIN+1';;    # Next song
        t|toggle)
            signal='RTMIN+2';;    # Toggle play song
        tb|toggleblock)
            signal='RTMIN+3';;    # Toggle block song
        ip|iprevious)
            signal='RTMIN+10';;   # Previous interlude song
        in|inext)
            signal='RTMIN+11';;   # Next interlude song
        it|itoggle)
            signal='RTMIN+12';;   # Toggle play interlude song
        itr|itoggleresume)
            signal='RTMIN+13';;   # Toggle interlude resume
        *) echo "Usage: bb ( b[lock] | u[nblock] | p[revious] | n[ext] | t[oggle] | t[oggle]b[lock] |...)" && return 0;;
    esac
    pkill --signal "$signal" -f 'python.*blockify'
}

Then use it via e.g. bb to get current song info or bb t to toggle playback.

CLI

Blockify has a CLI/daemon that you can start with blockify.
blockify -h will print out a help text with available options.

GUI

Alternatively, you can use the GUI with blockify-ui which spawns this window.
ScreenShot

  • Play, Previous, Next: These buttons use dbus to send audio control commands to spotify.
  • Block/Unblock: Add/Remove the currently playing song to/from the blocklist.
  • Mute/Unmute: Mute/Unmute the current song. Only works if "Manual" checkbox is activated.
  • Mute (manual): Disables automatic mute of ads and instead allows you to mute manually.
  • Show/Hide Cover: Enable/Disable display of cover art image.
  • Autodetect: Let blockify automatically detect ads or switch to manual blocklist-style.
  • Automute: Let blockify automatically handle mute or switch to manual muting.
  • Autohide: If this option is checked, the cover art will be automatically hidden whenever a commercial is playing.
  • Open/Close List: Opens a small popup text editor with the blocklist opened where you can edit and save it. Keybinds: Control-S (save), Control-W/Q (close), Control-D (delete current line).
  • Exit: Stop blockify cleanly, i.e. unmute sinks, update blocklist and generally clean up.
  • Enable/disable Player: Shows and enables resp. hides and disables the mini audio player (interlude player) below the button which will play music instead of commercials.
  • Prev, Play/Pause, Next (bottom): Media buttons to control the interlude player.
  • Browse: Allows you to open m3u-playlists and/or audio files on the fly. You can select multiple items and combine playlists with audio files. The player will automatically load those and discard the previous playlist.
  • Autoresume: If enabled, the interlude player will switch back to Spotify as soon as the commercials end. If disabled, the current interlude song will be finished before switching back to Spotify.

Configuration

Please see the provided example_blockify.ini on what settings are available and their purpose.
Blockify automatically creates a configuration file at $HOME/.config/blockify/blockify.ini if you don't have one already. It will also tell you via ERROR-logging messages, if you configuration file is faulty or incomplete, in which case the options that could be read will be merged with the default options you see in example_blockify.ini but you'll still want to fix your configuration file.

Interlude Music

From version 1.4 onwards blockify can play music of your choice during commercial breaks.
The default behaviour is for blockify to automatically play the first song in the playlist file (should you have one), when a commercial starts playing.
Alternatively, you can set the autoresume option to False which will cause blockify to always finish the current interlude song before resuming spotify playback.

The interlude feature only works if you use pulseaudio (i.e. spotify needs to run in its own sink so it can be muted separately).
To make use of interlude music you have to configure a playlist file in ~/.config/blockify/playlist.m3u.
The playlist system is (mostly) M3U-compliant.

An example playlist:

# Lines starting with "#" will be ignored.
# Absolute path to a file:
/media/music/foo/bar.mp3
# Relative path to a file (as seen from playlist location):
foo/bar.flac
# Relative path to another playlist. Just make sure the other playlist doesn't link back or else you'll get a very long playlist:
baz.m3u
# A whole directory:
/media/music/foo
# It's also possible to give full URIs:
file:///media/music/foo/bar.mp4
http://www.example.com/foo/bar.wav
# A radio station. Note that radio streams don't usually end so you'll have to switch
# back to spotify manually, enable autoresume or specify the radio_timeout in the config file.
http://skyserver5.skydisc.net:8000

You can use relative and absolute paths as well as basically any audio source/format, as long as you have the respective gstreamer codec installed.

Troubleshooting

Known issues

  • If Spotify is minimized to the system tray, ad detection will not work.
  • If DBus/Notifications are disabled, ad detection will not work.

Common issues

  • ImportError: No module named gst: You need to install gst-python.
  • Interlude music not playing: You might need to install gstreamer codecs (-bad, -ugly, ...).
  • Configuration is not loaded properly: Syntax might have changed between blockify versions. If in doubt, delete your configuration file. It will be rewritten with current defaults.

Debugging

If you can't find or fix the issue you are having by yourself, you are welcome to open an issue on this site. When you do, please provide the following information:

  • A debug log, acquired by starting blockify(-ui) via blockify(-ui) -vvv -l logfile. Then upload it with curl -F "c=logfile" https://ptpbw.pw or paste it to a gist or bpaste.net or directly into the git issue (preferably with code tags -> three backticks before and after the snippet).
  • The blockify version: blockify --version.
  • If you suspect pulseaudio as culprit, the list of sinks: pacmd list-sink-inputs | curl -F c=@- https://ptpb.pw.

Similar open-source projects

On Linux:

On Windows:

On OS X:

blockify's People

Contributors

abrahambotros avatar baongoc124 avatar cossio avatar diogocp avatar ffy00 avatar florianfranzen avatar gmdfalk avatar hstarmans avatar nopeppermint avatar rod-persky avatar ryuzakikk avatar senden9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockify's Issues

No sink input found with this index.

Hi, whenever an ad comes up I get this message in the command line:

Welcome to PulseAudio! Use "help" for usage information.

No sink input found with this index.

So the ad is detected but Blockify can't find the input to mute it. Any ideas?

Segmentation fault when the playlist finishes

I have only one song in the playlist (~2min song) and use the non UI version (so with the autoresume enabled). With that length I hear it few times before the song finishes, but at that point blockify crashes.

This is the log:

$ blockify
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
2014-12-23 12:18:46 INFO     util     Loglevel is 20.
2014-12-23 12:18:46 INFO     list     Loading blockfile from /home/user/.config/blockify/blocklist.
2014-12-23 12:18:46 INFO     main     Blockify initialized.
2014-12-23 12:18:46 INFO     main     Blockify started.
2014-12-23 12:18:46 INFO     main     Muting Spotify – Spotify.
2014-12-23 12:18:57 INFO     main     Unmuting.
2014-12-23 12:39:11 INFO     main     Muting Spotify – Spotify.
2014-12-23 12:40:02 INFO     main     Unmuting.
2014-12-23 12:52:32 INFO     main     Muting Johnny Mathis – When A Child Is Born.
2014-12-23 12:52:33 INFO     main     Unmuting.
2014-12-23 12:59:26 INFO     main     Muting Sony Music – Best 2014.
[1]    8534 segmentation fault (core dumped)  blockify

and the playlist:

file:///home/user�/.config/blockify/piano.mp3

No handlers could be found for logger "util"

Hey mikar, so far I've gotten this error when I start blockify from the terminal on every distribution I've tried it on. Despite that, the app continues to run and works so feel free to dismiss this post if you already know and it's not an issue.

No handlers could be found for logger "util"
2015-07-23 10:41:28 ERROR dbus Spotify not found in DBus session. Is it running?
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
2015-07-23 10:41:28 ERROR player Could not parse playlist source: [Errno 2] No such file or directory: '/home/roman/.config/blockify/playlist.m3u'

Thanks again!

To support native Linux version

Hi, why doesn't blockify support native Linux version? It'll just be only ONE line difference from current version. And about ad blocking functionality, I see that current version only blocking from a list. Why don't integrate automatic methods like EZBlocker?

Thanks.

Blockify will not start properly if an ad is playing in Spotify

If you try to start blockify while an ad is playing, the function to get the current song being played through the dbus returns an uncaught null value. As the following stack trace shows:

Traceback (most recent call last):
File "/usr/bin/blockify", line 9, in
load_entry_point('blockify==1.0', 'console_scripts', 'blockify')()
File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 399, in main
blockify.update()
File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 163, in update
if self.current_song_is_ad():
File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 146, in current_song_is_ad
u" \u2013 " + self.dbus.get_song_title()
TypeError: unsupported operand type(s) for +: 'NoneType' and 'unicode'

does not block "404 Not Found" ads

When Spotify output says there is a 404 Not Found error for an ad, no notification of the ad is made, and so blockify lets the ad play. As of today, every ad gets a 404 Not Found, so that means blockify allows all ads, at least for me.

I'm running Blockify 1.7.1, Arch 3.18.2-1, Enlightenment 0.19.2-1, Pulseaudio 5.99.2, and Spotify 0.9.11.27-1. Enlightenment is configured to show all three levels of notifications and to use the Enlightenment notification and DBus modules. Song info appears in notifications, and they are recognized by blockify, and the DBus controls work. I don't know if my system is causing the "404 Not Found" errors or if it's happening for everyone.

I wrote a shell script in 5 minutes to mute all "404 Not Found" ads. Here is its output (which is mostly just repeating the stderr of spotify):

12:34:09.247 I [head_file_streamer.cpp:106 ] Requesting head file from CDN url: http://heads-ec.spotify.com/head/3ec8731d67ad9b18cb7aec929f24ff8edf2e60ef
12:34:09.247 D [spirc_manager.cpp:578 ] GAIA: SpircManager::stpLoad, track=spotify:track:0ylMnxkHno7tBynYTV5esa, index=0, position=0, paused=0
*** Track!
12:34:09.247 I [ap_chunk_downloader.cpp:75 ] Requesting data (0 -> 524288) from AP for file 3ec8731d67ad9b18cb7aec929f24ff8edf2e60ef
12:34:09.603 I [http_fetch_connection.cpp:362 ] Result 404 Not Found
*** Ad!
12:34:10.881 I [ap_chunk_downloader.cpp:174 ] Request for file 3ec8731d67ad9b18cb7aec929f24ff8edf2e60ef complete (code: 0)

Here is blockify-ui's -vvv output:

2015-01-10 14:11:49 DEBUG util Added logging console handler.
2015-01-10 14:11:49 INFO util Loglevel is 10 (10=DEBUG, 20=INFO, 30=WARN).
2015-01-10 14:11:49 INFO list Blocklist loaded from /home/user/.config/blockify/blocklist.txt.
2015-01-10 14:11:49 INFO util Configuration file loaded from /home/user/.config/blockify/blockify.ini.
2015-01-10 14:11:49 INFO player InterludePlayer initialized.
2015-01-10 14:11:49 DEBUG player Loading playlist.
2015-01-10 14:11:49 DEBUG player Stop: State is (, , ).
2015-01-10 14:11:49 DEBUG player Setting interlude to: file:///media/Passport/Music/Waldeck/Balance Of The Force/01 Defenceless.mp3
2015-01-10 14:11:49 INFO player Playlist loaded (Length: 69).
2015-01-10 14:11:49 INFO player Playlist: ['file:///media/Passport/Music/Waldeck/Balance Of The Force/01 Defenceless.mp3']
2015-01-10 14:11:49 DEBUG main Mute method is pulse sink.
2015-01-10 14:11:49 INFO main Blockify initialized.
2015-01-10 14:11:49 DEBUG main Autodetect: True.
2015-01-10 14:11:49 DEBUG main Automute: True.
2015-01-10 14:11:49 DEBUG gui Enabled automute.
2015-01-10 14:11:49 INFO gui Blockify-UI initialized.
2015-01-10 14:11:49 INFO gui Blockify-UI started.
2015-01-10 14:34:09 INFO main Forcing unmute.

Where it says "Forcing unmute", your program undid my program's muting of an ad. (Note where my program says, "Ad!" at the same timestamp.) I'm not asking your program to play nicely with my program (though I'm not sure why it insists on unmuting.) I'm just saying your program misses every ad at present, at least for me. It is, however, very impressive otherwise. You could fix it by launching spotify from blockify (unless there is an easier way to grab stderr), and then just look for that text. I'm not sure, but you might be able to do away with the need for notifications while you're at it.

Mint 17 KDE4: blockify won't run

below the error I get when launch blockify from terminal with -vvv option:
http://pastebin.com/GmeJCtFq

I have no idea of what could be, but I know that I could not install pygtk gstreamer0.10-python, in addition instead of install pyton2-wnck and pythom2-dbus I installed pyton-wnck and python-dbus

the version is 1.7.2

Thanks

Notes about Ubuntu/Linux Mint dependencies

Linux Mint 17.2 installation : python-configparser package has to be installed to run the pip blockify installation without error!

So I suggest to add:
sudo apt-get install python-configparser

In my Linux Mint 17.2 I didn't find the packages: libwnck3 and gst-python1.0
But I installed libgstreamer0.10-dev

maybe this helps other users ;-)

Ad-blocking does not work

I'm using blockify on arch linux and I've installed it through the AUR package (not the -git version.) blockify-ui shows the current track and I can change the track through it but when an ad plays it doesn't mute it and shows "No song playing?" in the window.

~$ blockify --version
3.0.2
2015-11-11 16:18:16 DEBUG    util     Added logging file handler: /home/julian/blockify.log.
2015-11-11 16:18:16 INFO     util     Loading configuration.
2015-11-11 16:18:16 INFO     util     Configuration file loaded from /home/julian/.config/blockify/blockify.ini.
2015-11-11 16:18:16 INFO     list     Blocklist loaded from /home/julian/.config/blockify/blocklist.txt.
2015-11-11 16:18:16 INFO     player   InterludePlayer initialized.
2015-11-11 16:18:16 DEBUG    player   Loading playlist.
2015-11-11 16:18:16 DEBUG    player   Stop: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_NULL of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-11-11 16:18:16 INFO     player   Playlist loaded (Length: 0).
2015-11-11 16:18:16 INFO     player   Playlist: []
2015-11-11 16:18:17 DEBUG    cli      Mute method is alsa or pulse without sinks.
2015-11-11 16:18:17 INFO     cli      No pulse sinks found, falling back to system mute via alsa/pulse.
2015-11-11 16:18:17 INFO     cli      Blockify initialized.
2015-11-11 16:18:17 INFO     cli      Blockify started.
2015-11-11 16:25:34 WARNING  cli      Spotify was closed!
2015-11-11 16:25:44 DEBUG    cli      2 received. Exiting safely.
2015-11-11 16:25:44 INFO     cli      Exiting safely. Bye.

When I start it in a terminal, something constantly prints

Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)

The log also says that it can't find pulse sinks but I'm using pulseaudio and I can mute spotify individually via pavucontrol. However, when I use the command pacmd list-sink-inputs it prints Daemon not responding..

"Show desktop notifications when the track changes" is enabled but I don't have any programs installed that would show the notification.

I'm using a fork of dwm as my window manager.

error "Cannot connect to DBus"

Hi, when I launch blockify I see this error message:

2014-11-21 08:17:07 ERROR main Cannot connect to DBus. Autodetection and Player Controls will be unavailable (org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.).
Traceback (most recent call last):
File "/usr/bin/blockify", line 9, in
load_entry_point('blockify==1.0', 'console_scripts', 'blockify')()
File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 416, in main
blockify = Blockify(blocklist)
File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 109, in init
self.try_enable_dbus()
File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 151, in try_enable_dbus
if self.dbus.is_running():
AttributeError: 'NoneType' object has no attribute 'is_running'

what's happened?

Thanks in advance

Could not find Spotify PID

When I run blockify as a normal user (with Spotify definitely running, checked with ps -A ) get:

 Could not get Spotify PID: list index out of range

Now, I believe the issue is how blockify looks for the PID of spotify, because when I run blockify as root, I don't get this error. Of course, one should not run a program as root for it to function, so this should probably be fixed

support for 1.0.9 (without dbus)

version 1.0.9 has no dbus support. a workaround is needed, i think the only possibility is xprop/wmctrl/xwininfo and blacklists...

update on AUR

Hi, I saw that the last update in GIT is in september 2014, but in AUR I find may 2014.

when will be done the update on AUR?
(I' m tired to listen ads on Spotify ;) )

Muting does not work if pulseaudio has a combine-sink.

Because combine-sink has no pid the formating does not work.

idxd = {info[3 * n + 2]: (info[3 * n], info[3 * n + 1]) for n in range(len(info) // 3)}

My output of the "info"

info = [u'0', u'no', u'1', u'no', u'4516', u'2', u'no', u'4516']

doesnt work anymore

it seems like the newest spotify version circumvent the adblock somehow :/

Add autoresume as a config (non UI)

I use the non UI version of blockify and it'd be useful to have the autoresume setting somewhere in the configs in order to turn it off

That would help also the UI to save it, currently when you close and open it again it resets to true

Wish: Play "Mute Music" whan Ad is muted

Hi,

I dont know if this is the wright section.... This is the first time i want to be an active user... :D So ist there a chance to add a custom "Mute Music" for Ads? So there is no Silence in Spotify?

Best wishes from Hamburg, Germany

Permanent mute

After an ad is muted successfully, if a song comes up, muting still continues till I manually unmute my system. I'm using GUI (mute tracks and auto add tracks are checked), but problem persist on the normal blockify as well. Is there anyway to fix this?

Great piece of software by the way. Thanks.

System: Ubuntu 14.04

Remove wmctrl dependency

Blockify currently uses wmctrl to find the Spotify window and extract its title.

This isn't necessary as DBus provides enough metadata to detect if the current track is an ad:

a) Commercials have title information but blank artist info
b) Commercials have a different track url (https://open.spotify.com/ad/id instead of https://open.spotify.com/track/id)

Metadata can be checked via dbusclient.py, e.g. python dbusclient.py get all

To implement this, the current_song_is_ad() method could look like this return self.dbus.get_song_title() and not self.dbus.get_song_artist() and the wmctrl resp. get_windows logic could be removed entirely.

correct way of installing spotify

Blockify requires Spotify > 1.0.12. If you install Spotify via https://www.spotify.com/nl/download/linux/, you end up with an old version and blockify does not work (tested on Ubuntu 14.04).
As a fix, use the official instructions for the beta spotify version; https://community.spotify.com/t5/Spotify-Community-Blog/Spotify-Client-1-x-beta-for-Linux-has-been-released/ba-p/1147084.
It would be nice if the blockify manual was updated and outlines how to install spotify or links to the correct instructions.

[suggestion] integrate interlude player with spotify controls

First of all, thanks for amazing piece of software, doing really great job unlike most ad muting scripts out there :)
I have one suggestion though, that would make it GODLIKE for me:
If I want the whole song to play through rather than autoresuming I HAVE TO listen to whole track. If I click next on spotify track changes, but it is still paused, and interlude player track goes on.
If interlude player would stop and let spotify play the track that would be perfect :)
I hope that's not something impossible,
Keep up the good work :)

Start automatically with Spotify?

I'm struggling to get blockify to start automatically at the same time as Spotify. I'm using the default .desktop file which is provided by Spotify:

[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Listen to music using Spotify
Icon=spotify-client
Exec=spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Qt;Audio;Music;Player;AudioVideo
MimeType=x-scheme-handler/spotify

Any suggestions on how to achieve this? I tried changing the Exec line to spotify %U & blockify (which works ok from bash), but this doesn't start blockify when launched from Gnome.

Doc update required

Blockify v3.0.1 needs the setuptools module in python, which must be listed as a required dependency on the readme file.
On a similar note, the PKGBUILD config file for Arch must be updated to use python3 (on line line 26).

Being able to (mostly) catch ads automatically

Though the current system works, I'm sure I'm not the only one to find it jarring to suddenly hear offending ads and then having to silence them manually. Would it not be possible to parse the "song" name and, using a regular expression, match any occurrences of common companies? Here is my (slightly edited to protect my location) .blockify_list:

ProFlowers – ProFlowers
O'Reilly Auto Parts – O'Reilly Auto Parts
O'Reilly Auto Parts – O'Reilly Auto Parts
Universal Music – Digster Country
Universal Music – Digster Country
Universal Music – 5 Seconds of Summer
Universal Music – 5 Seconds of Summer
Audible – Audible
McDonald's – Dollar Menu & More
McDonald's – Dollar Menu at Breakfast
Buffalo Wild Wings – Buffalo Wild Wings
Interdynamics R134a Refrigerant – O'Reilly Auto Parts
Verizon Wireless – Verizon Wireless
Warby Parker – Warby Parker
Win Gas for Life – O'Reilly Auto Parts
Graze.com – Graze.com
Autotrader.com – Autotrader.com
Sony Music – Jack White
Universal Pictures – A Million Ways to Die in the West
Big Smo – A&E
Sony Music – Jake Owen
DoubleDown Casino – Where The World Plays.
GRAZE.COM – GRAZE.COM
Web – O'Reilly Auto Parts
Car Wash – O'Reilly Auto Parts
Coca-Cola Ahh – Coca-Cola Ahh
Chick-fil-A – 2014
Verizon – Verizon
Dr Pepper – Dr Pepper
2014 FIFA World Cup – 2014 FIFA World Cup
DASANI Drops – DASANI Drops
Red Bull – Red Bull
Kelley Blue Book – Price Advisor
SyFy Defiance – SyFy Defiance
Syfy Defiance – Syfy Defiance
Chick-fil-A – Pop
Wilfred FXX – Wilfred FXX

If you gaze through the list, you'll see many company names pop out at you--Verizon, Coca-Cola, O'Reilley, etc. These names are very prominent and very obvious, thus very easy to block by simply searching for famous company names. Even certain ones have the telling .com in the name, something not usually found in song titles. Now, some things can't be caught, such as the very specific FIFA World Cup ad, but by automating a large portion of the ad blocking, blocking spotify ads no longer has to be a tedious chore that crops up each time Spotify updates its ad list.

There are a few issues with this set-up, mainly the possibility of false positives with vague names such as "Verizon". A cursory search for "Verizon" came up with a few songs/albums with name in it. Now, there are three ways that (when effectively combined) can make this a non-issue (should it even become one):

  1. Notifications alerting the user when something has been automatically blocked. Assuming that they are consciously trying to play a song that triggers the false positive, it will be immediately evident that blockify was be overzealous
  2. Have an organized list of keywords to search for that can be freely edited by the user if they run into problems with a particular brand-name (such as "Verizon")
    • However, if there is only a few edge cases being brought up, perhaps a whitelist for those particular songs could be checked against? However, this might make the application unwieldy when the user has to pay attention to three lists
  3. Certain names can only be blocked if they are found descriptions that point toward a product (i.e: Verizon Wireless – Verizon Wireless)
    • However, this would not catch certain vague ads (such as Verizon – Verizon), so the worth of additional keyword identifiers is questionable
    • Additional keywords should not be required, but if a more strict muting is necessary then it is an option

And finally, this feature would obviously be very experimental, so a certain flag should be set by the user in the initial stages so he/she is not suddenly without music.

"pacmd_muted_value" option cannot be set because of typo in util.py

There is a typo near the end of line 121 in util.py:
-"pamcd_muted_value"
+"pacmd_muted_value"

Without this option blockify can mute, but not unmute, if language is non-english.
I need this option to get blockify to work, i have changed this typo and built blockify, and it works for me.

This issue is related to #38

I guess one ugly solution to not require this option could be to just unmute and read the pacmd "muted" value at the start of blockify
Out of curiosity, why is there a need to check if spotify is muted or not, if there is an ad running, mute, if not, unmute, right? No?

BTW, thanks for this awesome application :)

Permanent Mute

Hello mikar,

Blockify has been working without any problems on Ubuntu 15.04 but today I had to completely reinstall it and now Blockify does not work. It launches fine but if in GUI I select autodetect and automute - it mutes everything, including spotify songs and never unmute it.

If I run blockify in the terminal - nothing comes up and it is working in the same manner as above.

Any solution to this?

blockify cant start (TypeError: option values must be strings)

Hi,
blockify cant start on my setup. To exclude a config mistake i removed the blockify and spotify config. I start first spotify and after that blockify. For the installation i used the AUR package
Please see the log below for the stacktrace.

.-(/tmp)----------------------------------------------------------------------------------------------------------------------------------(stefano@STEFANO-PC)-
`--> rm -r ~/.config/blockify
.-(/tmp)----------------------------------------------------------------------------------------------------------------------------------(stefano@STEFANO-PC)-
`--> blockify --version      
3.0.1
.-(/tmp)----------------------------------------------------------------------------------------------------------------------------------(stefano@STEFANO-PC)-
`--> blockify -vvv     
2015-11-08 09:24:01 DEBUG    util     Added logging console handler.
2015-11-08 09:24:01 INFO     util     Loglevel is 10 (10=DEBUG, 20=INFO, 30=WARN).
2015-11-08 09:24:01 INFO     util     Loading configuration.
2015-11-08 09:24:01 ERROR    util     Could not parse option autodetect for section general. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option automute for section general. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option autoplay for section general. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option start_spotify for section general. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option substring_search for section general. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option update_interval for section cli. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option unmute_delay for section cli. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option use_cover_art for section gui. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option autohide_cover for section gui. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option update_interval for section gui. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option unmute_delay for section gui. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option use_interlude_music for section interlude. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option start_shuffled for section interlude. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option autoresume for section interlude. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option radio_timeout for section interlude. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option playback_delay for section interlude. Using default value.
2015-11-08 09:24:01 ERROR    util     Could not parse option playlist for section interlude. Using default value.
2015-11-08 09:24:01 INFO     util     Configuration file loaded from /home/stefano/.config/blockify/blockify.ini.
2015-11-08 09:24:01 INFO     util     Creating config directory.
2015-11-08 09:24:01 INFO     util     Creating thumbnail directory.
Traceback (most recent call last):
  File "/usr/bin/blockify", line 9, in <module>
    load_entry_point('blockify==3.0.1', 'console_scripts', 'blockify')()
  File "/usr/lib/python3.5/site-packages/blockify/cli.py", line 590, in main
    cli = initialize()
  File "/usr/lib/python3.5/site-packages/blockify/cli.py", line 583, in initialize
    util.initialize(doc)
  File "/usr/lib/python3.5/site-packages/blockify/util.py", line 169, in initialize
    init_config_dir()
  File "/usr/lib/python3.5/site-packages/blockify/util.py", line 66, in init_config_dir
    save_options(CONFIG_DIR, get_default_options())
  File "/usr/lib/python3.5/site-packages/blockify/util.py", line 150, in save_options
    config.set(section, k, v)
  File "/usr/lib/python3.5/configparser.py", line 1190, in set
    self._validate_value_types(option=option, value=value)
  File "/usr/lib/python3.5/configparser.py", line 1175, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings
[1]    16796 exit 1     blockify -vvv
.-(/tmp)----------------------------------------------------------------------------------------------------------------------------------(stefano@STEFANO-PC)-
`--> tree ~/.config/blockify/       
/home/stefano/.config/blockify/
└── thumbnails

1 directory, 0 files
.-(/tmp)----------------------------------------------------------------------------------------------------------------------------------(stefano@STEFANO-PC)-
`--> pacman -Q spotify 
spotify 1.0.17.75-2

Please say if you need additional infos.

Edit 1:
I add the following to line 150 in blockify/util.py:

    for section in sections:
        config.add_section(section)
        for k, v in options[section].items():
            print(type(section), type(k), type(v))  # <-- here
            print(section, k, v) # <-- and here
            config.set(section, k, v)

And now i get this additional info:

[…]
2015-11-08 09:47:50 INFO     util     Configuration file loaded from /home/stefano/.config/blockify/blockify.ini.
<class 'str'> <class 'str'> <class 'bool'>
general substring_search False
Traceback (most recent call last):
  File "/usr/bin/blockify", line 9, in <module>
[…]

Edit 2:
I fix it by replacing "config.set(section, k, v)" with "config.set(section, k, str(v))". I check side-effects before creating a pullrequest.

blockify doesn't work on arch linux

I have used blockify since early versions and works great, but when I updated to version 1.4.2 it doesn't work anymore.I checked the dependencies and reinstalled it but didn't solve the problem. I'm posting the command line exit of blockify-ui to clarify the possible problem.

2014-12-20 11:22:01 INFO util Loglevel is 20.
2014-12-20 11:22:01 INFO main Loading blockfile from /home/aram/.config/blockify/blocklist.
2014-12-20 11:22:01 INFO main Setting autodetect to: True.
2014-12-20 11:22:01 INFO main Interlude playlist is: []
2014-12-20 11:22:01 INFO main Blockify initialized.
2014-12-20 11:22:01 INFO main Setting autodetect to: True.
2014-12-20 11:22:01 INFO gui Blockify-UI started.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/blockify-1.4-py2.7.egg/blockify/blockifyui.py", line 356, in update
self.update_cover()
File "/usr/lib/python2.7/site-packages/blockify-1.4-py2.7.egg/blockify/blockifyui.py", line 369, in update_cover
cover_file = self.get_cover_art()
File "/usr/lib/python2.7/site-packages/blockify-1.4-py2.7.egg/blockify/blockifyui.py", line 448, in get_cover_art
cover_hash = os.path.basename(self.b.dbus.get_art_url())
File "/usr/lib/python2.7/posixpath.py", line 121, in basename
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

I like your program but I hope you help me to fix this to keep using it.
Sincerely,
Aram

I can hear ads during interlude

Hi,
The interlude works and starts playing when ad begins, but I can hear both the interlude song and the ad together.
(Blockify 1.8.8 on Archlinux, pulseaudio, Spotify 0.9.17.8)
Thanks for this great piece of software!

Autoblocking not working

3.17.4-1-ARCH
Installed from AUR. Spotify Linux Version.

blockify -vvv
2014-11-27 13:36:43 DEBUG main Added logging console handler.
2014-11-27 13:36:43 INFO main Loglevel is 10.
2014-11-27 13:36:43 INFO main Loading blockfile from /home/monkee/.blockify_list.
2014-11-27 13:36:43 WARNING main No blockfile found. Created one.
2014-11-27 13:36:44 INFO main Blockify initialized.

~/.blockify_list is empty too.

If this matters: If I try to mute sound (with my keyboad shortcut) while spotify is playing, blockify unmutes it:
2014-11-27 13:36:43 DEBUG main Added logging console handler.
2014-11-27 13:36:43 INFO main Loglevel is 10.
2014-11-27 13:36:43 INFO main Loading blockfile from /home/monkee/.blockify_list.
2014-11-27 13:36:43 WARNING main No blockfile found. Created one.
2014-11-27 13:36:44 INFO main Blockify initialized.
2014-11-27 13:52:02 INFO main Unmuting.
2014-11-27 13:52:26 INFO main Unmuting.
2014-11-27 13:52:27 INFO main Unmuting.

edit
blockify-ui: next/prev buttons are not working. Toggle play is not working...

Attempt to unlock mutex that was not locked

When running blockify installed from AUR on Arch Linux I encounter the following error before the process ends:
Attempt to unlock mutex that was not locked

Apparently the problem is triggered by the upgrade from glib2 and can be resolved by removing the line gtk.gdk.threads_init() from some packages but I have been unable to find it in any of the files from this package.

Two issues with translations and condition construction

I found two issues:

  1. Translations: I'm using Manjaro with Polish locale and command pacmd list-sink-inputs actually returns on my system muted: tak or muted: nie ("tak" for "yes" and "nie" for "no") and as far as I can see you have hardcoded "yes" and "no" in pulsesink_mute method :) Currently I have no universal solution yet but I believe that we should read values for "yes" and "no" from system properties.
  2. For me condition construction is_ad = self.current_song != self.dbus.get_song_artist() + u" \u2013 " + self.dbus.get_song_title() doesn't work. I had to change it to
dbus_info = self.dbus.get_song_artist() + u" \u2013 " + self.dbus.get_song_title()
is_ad = self.current_song != dbus_info

in order to get it to work. I don't have experience in coding in Python so I cannot explain it but this is what I found under Python debugger.

Shuffle the interlude playlist

I've noticed that the playlist (I have a single directory with various mp3 in it) is always loaded in the same way. It'd be nice to have an option in the config to enable it to be shuffled. I always ear the same songs (the first ones in the playlist) even if I have hundreds in the directory

How to install on Fedora:

Hey mikar, love the app, can't use Spotify without it!

I got it to install on Fedora 22 with this method and thought I'd post here in case you want to post the install method on your page:

Instead of "sudo pip install http://github.com/mikar/blockify/archive/v1.8.3.zip," (I put the zip in my home folder for compiling because I didn't realize I could use a url yet.) I ran:

 sudo pip install blockify-master.zip

Then the dependencies under Fedora are:

 sudo dnf install python-dbus
 sudo dnf install gstreamer-python
 sudo dnf install gnome-python2-libwnck

After this I was able to run blockify. Thanks for developing this.

Fix playback status

According to dbus info for Spotify, it should support the [PROPERTY] org.mpris.MediaPlayer2.Player.PlaybackStatus(PlaybackStatus:s) (mdbus2 org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2)
but since Spotify v1.0.0 this feature is broken and/or NYI.

Consequently, blockify currently cannot detect whether a song is playing which impairs interlude music and gui functionality.
However, playback status can also be queried via pulseaudio e.g. pacmd list-sink-inputs.
Example output:

    index: 69
        driver: <protocol-native.c>
        flags: START_CORKED
        state: RUNNING
        sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
        volume: front-left: 65535 / 100% / -0.00 dB,   front-right: 65535 / 100% / -0.00 dB
                balance 0.00
        muted: no
        current latency: 1064.83 ms
        requested latency: 980.00 ms
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        resample method: (null)
        module: 8
        client: 11208 <Spotify>
        properties:
                media.role = "music"
                media.name = "Spotify"
                application.name = "Spotify"

where state: RUNNING indicates that the sink is actively streaming.

Until that DBus property is reimplemented, playback information could be queried this way.

Random segmentation faults

From 1.8.0 I'm getting some random seg faults, I initially tought it was because of corrupted files, but I've noticed that a file has been played correctly while few minutes before it resulted in a seg fault. With 1.7.2 and before it worked well

$ blockify -vvvv
2015-03-17 19:59:10 DEBUG    util     Added logging console handler.
2015-03-17 19:59:10 INFO     util     Loglevel is 10 (10=DEBUG, 20=INFO, 30=WARN).
2015-03-17 19:59:10 INFO     list     Blocklist loaded from /home/user/.config/blockify/blocklist.txt.
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
2015-03-17 19:59:10 INFO     player   InterludePlayer initialized.
2015-03-17 19:59:10 DEBUG    player   Loading playlist.
2015-03-17 19:59:10 INFO     player   Shuffled playlist.
2015-03-17 19:59:10 INFO     player   Playlist: ['4.mp3', '3.mp3', '7.mp3', '1.mp3', '2.mp3', '6.mp3', '14.mp3', '12.mp3', '8.mp3', '5.mp3', '11.mp3', '10.mp3', '9.mp3', '13.mp3']
2015-03-17 19:59:10 DEBUG    player   Stop: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_NULL of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-03-17 19:59:10 DEBUG    player   Setting interlude to: file:///home/user/.config/blockify/music/4.mp3
2015-03-17 19:59:10 INFO     player   Playlist loaded (Length: 14).
2015-03-17 19:59:10 INFO     player   Playlist: ['4.mp3', '3.mp3', '7.mp3', '1.mp3', '2.mp3', '6.mp3', '14.mp3', '12.mp3', '8.mp3', '5.mp3', '11.mp3', '10.mp3', '9.mp3', '13.mp3']
2015-03-17 19:59:10 DEBUG    main     Mute method is pulse sink.
2015-03-17 19:59:10 INFO     main     Blockify initialized.
2015-03-17 19:59:10 INFO     main     Blockify started.
2015-03-17 20:09:27 INFO     main     Muting Spotify – Spotify.
2015-03-17 20:09:28 INFO     player   Playing interlude: file:///home/user/.config/blockify/music/4.mp3
2015-03-17 20:09:28 DEBUG    player   Play: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_PLAYING of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-03-17 20:10:30 INFO     main     Forcing unmute.
2015-03-17 20:13:05 DEBUG    player   Setting index to: 1.
2015-03-17 20:13:05 DEBUG    player   Setting interlude to: file:///home/user/.config/blockify/music/3.mp3
2015-03-17 20:13:05 DEBUG    player   Interlude song finished. Queued: file:///home/user/.config/blockify/music/3.mp3.
2015-03-17 20:13:05 DEBUG    player   Pause: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_PAUSED of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
[1]    32657 segmentation fault (core dumped)  blockify -vvvv
user@neo ~/.config/blockify $ blockify -vvvv
2015-03-17 20:45:06 DEBUG    util     Added logging console handler.
2015-03-17 20:45:06 INFO     util     Loglevel is 10 (10=DEBUG, 20=INFO, 30=WARN).
2015-03-17 20:45:06 INFO     list     Blocklist loaded from /home/user/.config/blockify/blocklist.txt.
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
2015-03-17 20:45:06 INFO     player   InterludePlayer initialized.
2015-03-17 20:45:06 DEBUG    player   Loading playlist.
2015-03-17 20:45:06 INFO     player   Shuffled playlist.
2015-03-17 20:45:06 INFO     player   Playlist: ['3.mp3', '12.mp3', '11.mp3', '6.mp3', '1.mp3', '5.mp3', '7.mp3', '14.mp3', '10.mp3', '4.mp3', '9.mp3', '2.mp3', '13.mp3', '8.mp3']
2015-03-17 20:45:06 DEBUG    player   Stop: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_NULL of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-03-17 20:45:06 DEBUG    player   Setting interlude to: file:///home/user/.config/blockify/music/3.mp3
2015-03-17 20:45:06 INFO     player   Playlist loaded (Length: 14).
2015-03-17 20:45:06 INFO     player   Playlist: ['3.mp3', '12.mp3', '11.mp3', '6.mp3', '1.mp3', '5.mp3', '7.mp3', '14.mp3', '10.mp3', '4.mp3', '9.mp3', '2.mp3', '13.mp3', '8.mp3']
2015-03-17 20:45:06 DEBUG    main     Mute method is pulse sink.
2015-03-17 20:45:06 INFO     main     Blockify initialized.
2015-03-17 20:45:06 INFO     main     Blockify started.
2015-03-17 20:45:06 INFO     main     Muting Believe Music – Playlist Advisor.
2015-03-17 20:45:07 INFO     player   Playing interlude: file:///home/user/.config/blockify/music/3.mp3
2015-03-17 20:45:07 DEBUG    player   Play: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_PLAYING of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-03-17 20:46:01 INFO     main     Forcing unmute.
2015-03-17 20:47:18 DEBUG    player   Setting index to: 1.
2015-03-17 20:47:18 DEBUG    player   Setting interlude to: file:///home/user/.config/blockify/music/12.mp3
2015-03-17 20:47:18 DEBUG    player   Interlude song finished. Queued: file:///home/user/.config/blockify/music/12.mp3.
2015-03-17 20:47:18 DEBUG    player   Pause: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_PAUSED of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-03-17 20:56:14 INFO     main     Forcing unmute.
[1]    27563 segmentation fault (core dumped)  blockify -vvvv

Unmute after add not working

Blockify detects and blocks adds (mutes program mixer) but does not unmute it after add finishes.
I have to manually enter sound controls and unmute the spotify mixer after each add.

When using a playlist it furthermore does not resume playing on spotify after the playlist song finishes. I have to restart spotify to make it posible to play the next song. Seems like signals only go one way:
spotify->blockify
not
blockify->spotify
Here is the version number and logfile of the last try.
blockify --version 1.8.7

2015-07-08 15:09:04 DEBUG    util     Added logging file handler: /home/niceri/logfile.
2015-07-08 15:09:04 INFO     util     Loading configuration.
2015-07-08 15:09:04 INFO     util     Configuration file loaded from /home/niceri/.config/blockify/blockify.ini.
2015-07-08 15:09:04 INFO     list     Blocklist loaded from /home/niceri/.config/blockify/blocklist.txt.
2015-07-08 15:09:04 INFO     player   InterludePlayer initialized.
2015-07-08 15:09:04 DEBUG    player   Loading playlist.
2015-07-08 15:09:04 DEBUG    player   Stop: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_NU$
2015-07-08 15:09:04 DEBUG    player   Setting interlude to: /home/niceri/Music/Ricardo Arjona - Vida (Video Oficial)-Jzn3yVu1XsE.m4a
2015-07-08 15:09:04 INFO     player   Playlist loaded (Length: 1263).
2015-07-08 15:09:04 INFO     player   Playlist: ['Ricardo Arjona - Vida (Video Oficial)-Jzn3yVu1XsE.m4a', 'rebuild.pdf', 'tuning.pdf',$
2015-07-08 15:09:04 DEBUG    main     Mute method is pulse sink.
2015-07-08 15:09:04 INFO     main     Blockify initialized.
2015-07-08 15:09:04 INFO     main     Blockify started.
2015-07-08 15:15:27 INFO     main     Muting Amason – Ålen.

And here is some output copied from the console when using a personal playlist and blockify -vvv (unecessary info removed)

2015-07-08 14:54:10 INFO     main     Blockify started.
2015-07-08 15:05:34 INFO     main     Muting Absolute Dance – Absolute Dance.
2015-07-08 15:05:35 INFO     player   Playing interlude: /home/niceri/Music/Ricardo Arjona - Vida (Video Oficial)-Jzn3yVu1XsE.m4a
2015-07-08 15:05:35 DEBUG    player   Play: State is (<enum GST_STATE_CHANGE_FAILURE of type GstStateChangeReturn>, <enum GST_STATE_READY of type GstState>, <enum GST_STATE_PLAYING of type GstState>).
2015-07-08 15:05:38 DEBUG    player   Setting index to: 1.
2015-07-08 15:05:38 DEBUG    player   Setting interlude to: file:///home/niceri/Music/Fields of Africa.flac
2015-07-08 15:05:38 DEBUG    player   Setting index to: 0.
2015-07-08 15:05:38 INFO     player   Playing interlude: file:///home/niceri/Music/Fields of Africa.flac
2015-07-08 15:05:38 DEBUG    player   Play: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_PLAYING of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
2015-07-08 15:05:38 INFO     main     Muting Absolute Dance – Absolute Dance.

2015-07-08 15:06:35 INFO     main     Muting Topsify – FRESH.
2015-07-08 15:06:35 DEBUG    player   Setting index to: 1.
2015-07-08 15:06:35 DEBUG    player   Setting interlude to: file:///home/niceri/Music/Fields of Africa.mp3
2015-07-08 15:06:35 DEBUG    player   Interlude song finished. Queued: file:///home/niceri/Music/Fields of Africa.mp3.
2015-07-08 15:06:35 INFO     main     Muting Topsify – FRESH.
^C2015-07-08 15:08:26 DEBUG    main     2 received. Exiting safely.
2015-07-08 15:08:26 INFO     main     Exiting safely. Bye.

(blockify:30236): GStreamer-CRITICAL **: Failed to deactivate pad mpegaudioparse0:sink, very bad
2015-07-08 15:08:26 DEBUG    player   Stop: State is (<enum GST_STATE_CHANGE_SUCCESS of type GstStateChangeReturn>, <enum GST_STATE_NULL of type GstState>, <enum GST_STATE_VOID_PENDING of type GstState>).
Traceback (most recent call last):
  File "/usr/bin/blockify", line 9, in <module>
    load_entry_point('blockify==1.8.7', 'console_scripts', 'blockify')()
  File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 453, in main
    blockify.start()
  File "/usr/lib/python2.7/site-packages/blockify/blockify.py", line 122, in start
    gtk.main()
KeyboardInterrupt

I am furthermore using spotify on Arch linux, installed from the AUR.

Any idea on how to debug this would be appreciated.

Songs are blocked when they shouldn't be

I open a new issue to keep it separate from the solved one

So, I have tried with the default settings and it happens as well, these are the steps i did:

  • temporally renamed the config, playlist and blocklist in order to use the default settings
  • open the spotify window
  • start a song
  • quickly click on the next song button

You'll see in the blockify (CLI) log that sometimes it blocks some songs, even if the blocklist is empty

This is a quick way I've found to replicate it, the same problem happens also without skipping songs, but just when you listen to spotify normally. Sometimes I see that it blocked a song, and started the interlude when it shouldn't have, I don't know how to replicate this, it appears to be quite random

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.