secupwn / spotify-adkiller Goto Github PK
View Code? Open in Web Editor NEWYour Party with Spotify - without ads!
Home Page: https://github.com/SecUpwN/Spotify-AdKiller
License: GNU General Public License v3.0
Your Party with Spotify - without ads!
Home Page: https://github.com/SecUpwN/Spotify-AdKiller
License: GNU General Public License v3.0
Dear developers and supporters of the original admute-script, I felt like having an official Repository for further development of the automute-continous script would be cool - especially since mentioning people within GitHub Gists is not possible (it really hurts). And to be honest I couldn't sleep while thinking about whether creating this Repo or not. After many sleepless hours, I had to surrender...
My fingers where itchy, I could not resist: I am welcoming you to the official Spotify-AdKiller Project! The script would not have been possible without many awesome people - THANK YOU SO MUCH:
I would like to take this opportunity to THANK all forkers of the original script and who kept their dedication to keep the script alive until I finally found the original script: @paulhernandez, @zmughal, @bull7ya, @aggchaitanya, @F0REacH, @vignirgudmunds, @carlos22 and many many more.
Also, many thanks to the people who starred the original script: @stubb, @Likeyn, @Visgean, @dbezborodovrp, @paulhernandez, @shayel. @morgoth, @zmughal, @Knight4, @zzemla, @claenjoy, @Nan0r, @F0REacH, @Bhudjo, @levibostian, @vforandroid, @anupdhml, @jakicoll, @milkmiruku, @russleyshaw, @tzermias, @trewtzu, @Skamlic, @ozcanesen, @ivankreso, @JustinJ81, @Windsdon, @spectralsun, @mindbreaker, @oroszgy, @adrianbona, @rabisg, @julianpark, @iled, @floft and the spectacular @erroneousboat! ^^
Finally a last SPECIAL SHOUTOUT to @leamas, who's coding the awesome Spotify-Make which enables me to enjoy Spotify on openSUSE Tumbleweed. You rock, buddy - long live your project!
If you read all of the above, I would like to thank you again. I know that the uploaded script is probably far from perfect and may contain numerous bugs - and that's why I would love to have every single one of you guys in my army of ad-free Spotify geeks.
ALL OF YOU ARE VERY WELCOME TO CONTINUE DEVELOPMENT HERE! π
I've been using the dns-block
branch for a long time and today Ads are rolling back and forth :(
I understand the stand on that, but is there a way to see some progress?
I do have the directory $HOME/.config/Spotify-AdKiller/
but there is no $HOME/.config/Spotify-AdKiller/Spotify-AdKiller.cfg
file.
Am I supposed to do something to make this file appear, or write it manually?
Ultimately, I am trying to like to switch the mode from continuous to simple.
I am using Spotify-Adkiller on Ubuntu 16.04 LTS and Spotify Desktop version 1.0.28.89.gf959d4ce. The ads have not been muting lately. Please help.
Thanks,
Hey there, i'm trying to use debug but it logs only the first track and the exit status.. really not understanding why.. some advice?
I'm using Spotify 0.9.17.1 on debian
I'm trying to use debug because the ads are not being muted anymore and i'm trying to understand why
Hey there, at line 562 of spotify-adkiller.sh
:
done < <(xprop -spy -id $(wmctrl -lx | awk -F' ' '$3 == "spotify.Spotify" {print $1}') _NET_WM_NAME)
wmctrl is not a default utility so please add it to dependecies list ty π
The program does not detect when an ad is playing anymore. If I run it from terminal and an ad plays, I get the following:
Paused: Yes
Ad: Can't say
Local: No
Double Hashtag Paused by User Double Hashtag
(I put the double hashtags there because actually writing out the hashtags formats it into a header, I don't know how to cancel that ;P)
The ad will keep on playing at full volume.
I'm having a recurrent muting of spotify after the adds blocking. As you mention in the readme, it is solved by running one simple line. I try it manually and works like a charm... but I have to confess that it is a bit annoying :) So, since I'm using the simple blocking mode (in other words, just mute spotify during the add), I am currently trying this modded version of the adkiller script:
in line 428 of the script I added the "forced unmuting" after the fi
and before the closing of the function, like this:
fi
for i in $(LC_ALL=C pactl list | grep -E '(^Sink Input)|(media.name = "Spotify"$)' | cut -d # -f2 | grep -v Spotify); do pactl set-sink-input-mute "$i" no; done
}
...Until now seems to be working, but I don't have the programming skills I don't know if what I did make sense. ^_^
Anyway, obviously it is only feasible on the automute_simple
mode, but could be a workaround to avoid spotify to stop playing after blocking. Right?
Cheers!!! :+1:
Once audio appears, Vlc starts playing recent video or movie.
Ads are not being muted, I'm on Linux xyz 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux
with Spotify Version 0.9.17.1.g9b85d436
. I believe the adkiller script is closing as soon as Spotify loads for some reason?
user@home:~$ bash ~/bin/spotify-wrapper.sh
## Waiting for Spotify ##
## Waiting for Spotify ##
DEBUG mode active
user@home:~$ _
Everything works fine until the end of my local MP3, after which there is silence, and I must press "play" in Spotify.
Ubuntu 14.04.3 LTS
Spotify-AdKiller.cfg:
## ##
## Configuration file for Spotify-AdKiller ##
## Please make sure to double-quote all custom values ##
## ##
CUSTOM_MODE="continuous"
# ad block mode. possible values:
# - simple β mute Spotify, unmute when ad is over
# - interstitial β mute Spotify, play random local track, stop and unmute when ad is over
# - continuous β mute Spotify, play random local track, stop and unmute when track is over
# -> set to simple by default
CUSTOM_PLAYER="cvlc"
CUSTOM_LOOPOPT=""
# local music player to use
# you can define a loop option (if available) in case you want
# to use a music track shorter than the average ad duration (only applicable to interstitial mode)
# -> chosen automatically by default
CUSTOM_VOLUME=""
# volume of local playback
# -> set to 100 by default
CUSTOM_MUSIC=""
# local music directory / track
# -> set to XDG standard music directory by default
DEBUG="1"
# control debug mode
# - "1" to enable
# - "0" to disable
# -> Will make the CLI output more verbose and write a logfile
# to "$HOME/.Spotify-AdKiller.log"
This is just something that popped up in my mind lately, although I'm not sure if this even works or should be implemented at all: On Android, I'm using the awesome VLC Nightlies. Which made me think: Could our script use these builds to manipulate the Playback of Ads while using the phone, sitting on the campfire and playing relaxing music? Please don't take this as offending question to "circumvent buying Premium" - all I do is just asking, because I'm curious.. Hit me with your feedback! π
If two ads are played in a row, Spotify is unmuted for the second ad. I start spotify by using the spotify-wrapper.sh script.
Ubuntu 14.04
Spotify 0.9.11.27.g2b1a638c
Lastest master version of adkiller.
Config:
CUSTOM_MODE="simple"
CUSTOM_PLAYER=""
CUSTOM_LOOPOPT=""
CUSTOM_VOLUME=""
CUSTOM_MUSIC=""
CUSTOM_ALERT=""
DEBUG="0"
Example output:
XPROP: Spotify - Avicii β Hey Brother
DBUS: Hey Brother
PAUSED: No
AD: No
LOCAL: No
## Initial run ##
## Unmuting sink 1170 ##
------------------------------------------------------------------------------
XPROP: Spotify - Royal Navy β Made In The
DBUS: Hey Brother
PAUSED: No
AD: Yes
LOCAL: No
## Muting sink 1170 ##
------------------------------------------------------------------------------
XPROP: Spotify - Xlite β Swatch
DBUS: Hey Brother
PAUSED: No
AD: Yes
LOCAL: No
## Restoring state ##
## Unmuting sink 1170 ##
When manually issuing the cvlc command in
I get Warning: option --volume no longer exists.
I can't find out when and why they removed it, but as it stands the option is simply ignored which leads to vlc using the volume it had on last close.
I think it should be possible to adjust the volume via pacmd in the same way that you contol the spotify sink.
Hey @pcworld, can you help me out with a quick fix? I am currently testing our script on openSUSE using the latest Spotify. Because Spotify is not yet officially available for openSUSE, I am using Spotify-Make which works awesome for a hassle-free install and provides the latest Spotify binary.
The only difference is the name, by which spotify starts: When using mentioned compilation method, the output filename of the Spotify binary is called my-spotify
located in $HOME/bin/
- but our spotify-wrapper.sh
tries to call just spotify
. How to change this part of our code spotify "$@" > /dev/null 2>&1 &
into a generic variable which calls the Spotify binary, no matter what it is named?
EDIT: This solution works: $HOME/bin/*spotify "" > /dev/null 2>&1 &
. Issue closed for now.
First, congrats for the moving! I'm fan of this project :)
I was wondering if someone have a clue on how to deal with the visual ads. I tried to grab them through a tcpdump | grep "Spotify"
without sucess... and there all my limited ideas reach a limit. My intention was to ban the grep result on /etc/hosts if I were so lucky to find a really simple structure. ^_^
Obviously the real plan was to do something else to block them at the system level, but the concept is the same. However I wasn't able to catch what are the denominations of the banners and, more importantly, where are these images hosted.
Am I thinking in the right direction?
Any help, clue or feedback is really appreciated! :D
Cheers and keep the good vibes! π
@SecUpwN, @OlegSmelov and everyone else following this project:
I just pushed a large commit to the repo that changes quite a lot of things (a full list of changes can be found in the changelog).
I have done my fair share of testing but because this update changes the entire core of the script I'd really appreciate it if you guys could check if everything works fine for you, including the new modes and automated installer.
Cheers, Feltzer
Hey @Feltzer, it seems as if one of my friends has problems using Spotify-AdKiller on the latest version of Ubuntu 14.04.1 LTS
. Spotify-AdKiller always complains that Spotify could not be found, although we installed it. I'm not sure which OS you're using, but could you digg into this to resolve it, please?
I am running our the Spotify-AdKiller on openSUSE, using the current version 0.9.10.17.g4129e1c9 of Spotify. It appears as if Spotify does not really mute the Ad, but rather stops its playback. The Spotify-AdKiller itself does detect the Ad, but seems to switch back to "normal playback" too soon - not sure if there's a looping process in there somehow? Would you please have a look at the script, @AmpGod? Not sure if @Feltzer can re-check the current setup to make sure everything is coded as it should. Thank you ahead for your dedication to this Project!
Hi there!
I've noticed, that when an ad starts, my local track starts as it should, but a few seconds later, another local track starts to play in parallel. And after the ad is over, my online song started to play, so I had 3 songs playing together :)
Possible cause: Maybe two ads are played in one "ad section", and when the second ad starts to play that triggers the second local track.
Is there a problem with my config, or is it a "legitimate bug"? I've used standard installation with the install script. I have Spotify version 0.9.10.17.g4129e1c9, and I use Ubuntu 12.04.
Thanks for the help, and you're doing really great work!
Cheers!
When I try to run the install script, this is what happens:
grove@solitaire> ./install.sh
not found
Please resolve these dependency errors before running the script
Manually checking the listed dependencies, revealed that I missed xdotool, and installing that brought me further.
Hey!
I've been using the dns-block branch for a little while. I noticed that playlist covers were getting blocked, even custom ones I'd set myself. A quick look at various terminal outputs seemed to indicate that blocking u.scdn.co was the culprit. I whitelisted that in dns-block.c and recompiled, and the issue seems to be fixed. I'll report back if unwanted things are now unblocked. Should this be added to the repository code?
Good evening, @Feltzer, I must admit that I have another Issue with the current version of our great script: It doesn't seem to work until I manually start it. I only realized that when I noticed that even if I place spotify-adkiller.sh
and spotify-wrapper.sh
into /usr/bin/ where the I also placed the Spotify-Binary and that Ads can play. I then manuelly started spotify-adkiller.sh
from terminal - and then it (partly) worked. Why "partly"? Because it once in a while classified every song after the first Ad as another Ad, thus muting all songs. Wait a second.. is that the WARNING you mentioned in the script? I resolved it myself by just starting spotify-adkiller.sh
manually once more.
Did I set it up wrong somehow? How come it sometimes doesn't work? Possibly because I minimized the Spotify-Window? Is it possible to update the script to work even when Spotify is minimized?
Current behaviour: Ad becomes paused. No further playback.
Expected behaviour: Ad is played, but muted. No local music is played, because there is nothing to play.
AdKiller is working fine for me as is, but I've been meaning to change some of the options in the cfg file.
Mind you, I'm new to Linux so this might be a stupid oversight on my part, but I can't seem to be able to change AdKiller's behavior when changing the .cfg file. Specifically, I've tried changing mode by setting
CUSTOM_MODE="simple"
The local music folder by setting
CUSTOM_MUSIC="/mnt/00DCCC3679CC023C/MΓΊsica/Toro Y Moi"
And no alert by setting
CUSTOM_ALERT="none"
None of these seem to work, so I must be doing something wrong.
Would be great to know what hardware and OS this works on. Windows? OSX? Linux? Android?
Good evening, @Feltzer! I would like to know if we should keep the Similar Projects in our README
or if we should add those to a separate WIKI entry (in that case I'd need to create our WIKI first). Reason for this discussion is that I do not want outdated or invalid projects to be recommended in our project README
, which could lead users into installing non-working crap. Let me know your thoughts here.
Is it posible that the ads can't be blocked anymore? How can I help to investigate what happened?
Since I first began using Spotify Adkiller just a week ago, all the ads have been killed consistently each and every time. Then today something changed. The ads are detected and local playback starts. But the ads aren't getting muted, so they play alongside the local playback. All of them. If I mute the ads Spotify will stop the ads, but Spotify Adkiller will automatically start the playback on mute (good Spotify Adkiller) saying "Please wait, ad is still on" or something the like. What is happening? How can I fix this?
Recent install, Ubuntu 16.04, latest version of Spotify.
This issue was also present when I was running Ubuntu 14.
Hi all,
I'm preparing a small patch to use arecord
to save audio files. Are you interested in that?
In case you do, I'd like to patch master with the dns-block
branch already merged in. Is it possibile?
Thank you!
Cheers
Since yesterday, AdKiller doesn't manage to find the Spotify runtime, so that ads remain unblocked. I've already pulled the latest git. Maybe Spotify has changed anything in their way of treating songs?
Unfortunately, I haven't had the time to dig deeper. Any ideas?
// Running on Ubuntu 14.10, Spotify 0.9.11.27
Ubuntu 16.04, last version of spotify.
The ad is paused after some seconds of playback. Pressing play lets the ad proceed some seconds, then it stops again. After repeating this operation 5/6 times the ad reaches the end end AdKiller works as expected
i added some files from this repository and i was able to make it work even BETTER on windows. i hope you can add it here aswell!
Hey @Feltzer, just a quick question here: Since the update of our script my Spotify seems to produce a file called collectionCache.bnk
in my home directory. It contains cryptic symbols and many song titles, as well as Playlists I have made. How to avoid this thing being created?
I'm not exactly sure, how are you detecting ads from regular songs.
However, most Indian songs are marked as ads and mute my pulse audio channel.
I can help to fix the issue, if you can help me where to begin.
Provide a script to remove Spotify-AdKiller or give detailed instructions in README.
Adds aren't blocked. Changing name from "Spotify Free - Linux Preview" on "Spotify" in config file(spotify-adkiller.sh) nothing change. Adds still are played.
On a fresh Ubuntu 14.04, when I run the install script I got this error:
sh install.sh install.sh: 69: install.sh: Syntax error: "(" unexpected (expecting "then")
Cheers!
hi! tks for this script works really fine!, I found some ads that were not silenced, the log was:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
XPROP: Spotify - Spotify β Spotify
DBUS:
PAUSED: No
AD: No
LOCAL: No
## Regular track ##
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
XPROP: Spotify - Spotify β Spotify
DBUS:
PAUSED: No
AD: No
LOCAL: No
## Regular track ##
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
XPROP: Spotify - Spotify β Spotify
DBUS:
PAUSED: No
AD: No
LOCAL: No
## Regular track ##
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
XPROP: Spotify - Spotify β Spotify
DBUS:
PAUSED: No
AD: No
LOCAL: No
## Regular track ##
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
XPROP: Spotify
DBUS:
PAUSED: Yes
AD: No
LOCAL: No
## Paused by User ##
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
XPROP: Spotify - Sig Ragga β Cuchillos
DBUS: Cuchillos
PAUSED: No
AD: No
LOCAL: No
## Regular track ##
-------------------------
When I set CUSTOM_MODE to interstitial the random track starts to play from my chosen directory flawlessly.
In addition a bell starts to play continously from /usr/share/sounds/freedesktop/stereo location. It doesn't stop after the playback change back to spotify.
(By the way It's an awesome script. Big thanks to you!)
According to https://google-styleguide.googlecode.com/svn/trunk/shell.xml,
If you are writing a script that is more than 100 lines long, you should probably be writing it in Python instead. Bear in mind that scripts grow. Rewrite your script in another language early to avoid a time-consuming rewrite at a later date.
Let's face it, Bash is not a very good language for anything other than very small and straightforward scripts. As this script is becoming bigger and bigger, we might as well rewrite it in Python before becomes too big.
A huge advantage to Python other than increased maintainability and easier data manipulation is that we'll be able to write a GUI with it, which can be a completely separate module.
This song: https://open.spotify.com/track/061joO5eUg78KlNJIkMt0o
is falsely detected as Ad because it produces the following values which are not equal:
XPROP_DEBUG: CΓ©line Dion - My Heart Will Go On - Love Theme from "Titanic"
DBUS_DEBUG: CΓ©line Dion - My Heart Will Go On - Love Theme from "Titanic"
The README file specified version 0.9.11. However when I installed the official version of Spotify on Ubuntu yesterday, the version was already 0.9.17.g9b85d436
. The script seems to be not working. Is this version not supported indeed? If so, is it possible for me to install 0.9.11 instead of 0.9.17.
Hi! thanks for this script, it works really fine but some rare ads has a DBUS empty value and I have changed the script for remove it.
RARE ADS
-----------------------------------------
XPROP: Spotify - Spotify β Spotify
DBUS:
PAUSED: No
AD: No
LOCAL: No
## Regular track ##
DBUSOUTPUT : method return sender=:1.9904 -> dest=:1.12729 reply_serial=2
array [
]
---------------------------------------
XPROP: Spotify
DBUS:
PAUSED: Yes # <<<<<<< NOT PAUSED. IS AN AD, THE DBUS VALUE IS EMPTY.
AD: No
LOCAL: No
## Paused by User ##
DBUSOUTPUT : method return sender=:1.9904 -> dest=:1.12729 reply_serial=2
array [
]
---------------------------------------
Yesterday I detect the rare tracks of the issue "Some ads are not being muted #13 "
I add this condition to the script and now works fine for me.
On another topic. In the script I found this code:
# get track data from xprop and the DBUS interface
XPROP_TRACKDATA="$(echo "$XPROPOUTPUT" | cut -d\" -f 2- | rev | cut -d\" -f 2- | rev)"
DBUS_TRACKDATA="$(echo "$DBUSOUTPUT" | grep xesam:title -A 1 | grep variant | \
cut -d\" -f 2- | rev | cut -d\" -f 2- | rev)"
# `cut | rev | cut | rev` gets string between first and last double-quotes
# TODO: find a more elegant way to do this
I think the more simple mode of obtain the XPROP_TRACKDATA and DBUS_TRACKDATA variables is:
XPROP_TRACKDATA="$(echo "$XPROPOUTPUT" | cut -d\" -f 2)"
DBUS_TRACKDATA="$(echo "$DBUSOUTPUT" | grep xesam:title -A 1 | grep variant | cut -d\" -f 2)"
You can see these changes in my fork and include it in the master branch if you like it.
The latest changes to the spotify-adkiller.sh seem to stop it working for me. Ads are not muted, and the DBUS_DEBUG: line is empty in the debug log.
Two errors are listed if I run spotify-adkiller.sh manually:
awk: line 6: syntax error at or near ,
awk: line 16: syntax error at or near ,
If I use the previous version of spotify-adkiller.sh, all is well.
Since I am one of the enthusiasts using spotify-make to install and run the latest version of Spotify
, I would like to see Spotify (AdKiller).desktop
automatically detect the installation of spotify-make
, which moves its own launcher into /bin/my-spotify
. In order to launch my-spotify
, I always have to manually modify Spotify (AdKiller).desktop
. Long ago, I tried to make our spotify-wrapper.sh
to generically detect this with #2, but that did not work at all. We currently state the following in our README
:
You can create a symbolic link, if necessary (e.g. linking my-spotify to spotify if you are using the user installation of spotify-make).
Spotify (AdKiller).desktop
(or maybe spotify-wrapper.sh
) should check how Spotify
has been installed and then launch the correct binary file. Would you please have a look at this, @Feltzer?
Maybe @leamas can help us to improve our script here with a pull request or two? Would be lovely!
Hi all,
I followed the readme file (installed dependencies, modified ~/.config/spotify/User//prefs and all) using Ubuntu 14.04, and the script is not working.
On debug mode, it prompts:
Spotify not active. Exiting.
Is there any chance to fix the problem?
Thanks!
The first ad to play is not muted. Any consecutive ads are muted as expected.
Debug output of two ads.
PAUSED: Yes
AD: Can't say
LOCAL: No
admute: 0; pausesignal: 0; adfinished: 0
## Paused by User ##
PAUSED: No
AD: Yes
LOCAL: No
admute: 0; pausesignal: 0; adfinished: 0
pactl: mute
## Muting sink 452 ##
Config
CUSTOM_MODE="simple"
CUSTOM_PLAYER=""
CUSTOM_LOOPOPT=""
CUSTOM_VOLUME=""
CUSTOM_MUSIC=""
CUSTOM_ALERT=""
DEBUG="1"
Spotify Version: 1.0.19.106.gb8a7150f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.