SecUpwN / Spotify-AdKiller

Your Party with Spotify - without ads!
https://github.com/SecUpwN/Spotify-AdKiller
GNU General Public License v3.0
836 stars 83 forks source link

Script not working on Spotify 0.9.X #37

Closed cmt29 closed 8 years ago

cmt29 commented 8 years ago

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.

SecUpwN commented 8 years ago

I suspect this to be an Issue caused by https://github.com/SecUpwN/Spotify-AdKiller/commit/3c72601d5a1498dd31e7166ae05c7c07e1c60cfa. @itsamenathan, would you please have a look at this?

itsamenathan commented 8 years ago

@cmt29 what version of Spotify are you using? #35 is based #33 which brought support for the latest version of Spotify.

I do here "Spotify" ads every now and then. I'm not completely sure why. Here are the logs I see when that happens.

XPROP_DEBUG: _NET_WM_NAME(UTF8_STRING) = "Spotify"
DBUS_DEBUG:   - Spotify
XPROP:    Spotify
DBUS:      - Spotify
PAUSED:   Yes
AD:       Can't say
LOCAL:    No
admute: 0; pausesignal: 0; adfinished: 0
## Paused by User ##
XPROP_DEBUG: _NET_WM_NAME(UTF8_STRING) = "Spotify "
DBUS_DEBUG:   - Spotify 
XPROP:    Spotify 
DBUS:      - Spotify 
PAUSED:   No
AD:       Yes
LOCAL:    No
admute: 0; pausesignal: 0; adfinished: 0
pactl: mute
## Muting sink 6 ##
cmt29 commented 8 years ago

I'm on version 0.9.17.1.g9b85d436. Are the changes not backwards compatible?

With the latest version of spotify-adkiller.sh, the DBUS_DEBUG: line is empty the whole time, and I only ever get one entry in the log no matter how many songs or ads are played.

TarekHC commented 8 years ago

I have exactly the same problem as described by cmt29. Same spotify version, on Ubuntu 14.04.

TarekHC commented 8 years ago

Just to confirm, I tested the tree d9f83491a164f07c03d2325cc47838f67756fce0 and still did not work. I tested tree 6b6252cc0626633a1d5700d0cfb9ddde940d1d75 and solved the problem.

SecUpwN commented 8 years ago

@cmt29, we've had some smaller code changes. Would you please tell us if this Issue persists?

cmt29 commented 8 years ago

Yes, I'm afraid the issue persists.

johnspear2015 commented 8 years ago

Hello I am having the same problem, still getting ads. Please help. Ubuntu 14.04 Spotify 0.9.17.1.g9b85d436

With the following errors:

Using cvlc for local playback

awk: line 6: syntax error at or near , awk: line 16: syntax error at or near , XPROP: Spotify Free - Linux Preview DBUS:
PAUSED: No AD: No LOCAL: No

Initial run

Unmuting sink 39


SecUpwN commented 8 years ago

@Feltzer, I'm not sure why this suddenly happens. Would you please try to find out? Thank you!

Feltzer commented 8 years ago

Commit d59e2609ff960cd75c59bb39fa6d2cf6ca990441 is probably the root issue of this as it added support for Spotify 1.x without keeping the script backwards-compatible wih 0.9.x. For the time being please switch to the last release known to be working with 0.9.x: https://github.com/SecUpwN/Spotify-AdKiller/tree/6b6252cc0626633a1d5700d0cfb9ddde940d1d75

Sadly I don't have the time right now to work on a proper fix that works with both releases. @SecUpwN , for the time being, could you update the README to point users of Spotify 0.9.x to the version above, please? That would help a lot.

SecUpwN commented 8 years ago

Sadly I don't have the time right now to work on a proper fix that works with both releases.

No worries, I am very thankful you found the time to come back and have a look at it!

for the time being, could you update the README to point users of Spotify 0.9.x to the version above, please?

Before doing so, I'd like the original author of https://github.com/SecUpwN/Spotify-AdKiller/commit/d59e2609ff960cd75c59bb39fa6d2cf6ca990441, @ysangkok, have a look if he finds the bug.

ysangkok commented 8 years ago

@SecUpwN I just downgraded to 0.9.17.1.g9b85d43 and tried out 6b6252cc (before my commit), and it wasn't working.

This is what I get when Spotify is paused, playing an ad or playing a song:

% dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify / org.freedesktop.MediaPlayer2.GetMetadata
method return time=1449753684.671169 sender=:1.921 -> destination=:1.941 serial=28 reply_serial=2
   array [
   ]

I'd like to get it working with both versions, but first I have to get the old version working... @tialis which distribution version are you using?

johnspear2015 commented 8 years ago

I reverted back and it works, as suggested above:

For the time being please switch to the last release known to be working with 0.9.x: https://github.com/SecUpwN/Spotify-AdKiller/tree/6b6252cc0626633a1d5700d0cfb9ddde940d1d75

Nhoya commented 8 years ago

Jus make a new branch for the oldstable (:

SecUpwN commented 8 years ago

Jus make a new branch for the oldstable (:

@Nhoya, so that we then have x different branches for everything? No. I'm still waiting for @ysangkok.

kriswebdev commented 8 years ago

Issue confirmed with Spotify testing version 1.0.19.106.gb8a7150f, with latest Adkiller (master d10e543) on Ubuntu 15.10 "The Wily Werewolf".

Issue solved with sudo apt-get install gawk

Note that Ubuntu 15.10 uses mawk as the default awk implementation. Installating gawk replaces awk implementatiton (it can be undone through sudo update-alternatives --config awk).

Also note that I installed Spotify testing version as per this post on Spotify community, since the stable version has an open issue with missing libgcrypt.so.11 on Ubuntu. This library is missing from Ubuntu since it's unsecure.

SecUpwN commented 8 years ago

Thanks for proposing this fix, @kriswebdev! Do you think adding gawk to the dependencies of every Linux variant in our README would finally fix this problem? @cmt29, please confirm this fix! ;-)

kriswebdev commented 8 years ago

@SecUpwN , you really can't rely on mawk, due to this code portion in spotify-adkiller.sh:

DBUSOUTPUT=$(dbus-send ... | awk '
...
        match(line, /"(.*?)"/, arr)
...
  ')

The code uses the match() function with 3 arguments. This is not supported by mawk and this is not POSIX compliant so you should not invoke awk. The code really depends on a gawk specific function.

POSIX awk specifications:

match(s, ere)

mawk manual:

match(s,r)

gawk manual:

match(string, regexp [, array])

I suggest replacing awk references by gawk and adding gawk to the list of dependencies.

The only issue is that by installing this dependency through apt-get, gawk will be the default awk implementaiton of the system. Some rare people will want to reconfigure mawk as the default implementation through sudo update-alternatives --config awk (and still expect Spotify AdKiller to work). You should maybe add a warning about that.

Feltzer commented 8 years ago

Everyone, please give the latest version of the script a try. a45eabbc6db09d64e0bc1a187102ef78aa5fa859 should fix most of these issues. AdKiller now supports both the legacy Spotify releases and the new beta version. The dependency on wmctrl has been dropped in favor of xdotool, so please make sure to install the corresponding package on your distro.

gawk is no longer a problem, either, as the script now uses a much simpler (yet somewhat ugly) way of processing the DBUS output.

cmt29 commented 8 years ago

Thanks. Can confirm that a45eabbc6db09d64e0bc1a187102ef78aa5fa859 fixes all the problems I was experiencing that opened this issue.

Nhoya commented 8 years ago

Nope, still not working on the older version with the last commit.

Nope, fixed