abba23 / spotify-adblock

Adblocker for Spotify
https://github.com/abba23/spotify-adblock
1.86k stars 93 forks source link

Can't run the app #2

Closed Amanse closed 3 years ago

Amanse commented 3 years ago

I have fedora 34 and spotify client installed from unitedRPMs, compiled from source adblock and when i run LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify i get /usr/bin/bash: symbol lookup error: /usr/local/lib/spotify-adblock.so: undefined symbol: cef_string_userfree_utf16_free

edit: I also tried the release and it is giving the same error

abba23 commented 3 years ago

My first guess would be that your Spotify version is outdated (you can find out using spotify --version). The latest Linux version should be 1.1.56.595.g2d2da0de I think. I've never used Fedora, but the installation script in the UnitedRPMs repository seems like a complete mess to me at first glance.

Looking at the Fedora documentation on installing Spotify, installing it through the RPM Fusion repository might be an idea. Alternatively you could try your luck with the Flatpak version and the corresponding instructions in the readme.

Amanse commented 3 years ago

Thanks for replying this fast! It was the unitedRPMs issue, the version is old, even the icon, could have judged from it, thanks again!

Amanse commented 3 years ago

Haha, sorry about this but i updated and the issue still persists, it is 1.1.55.498.gf9a83c60 i'll try the flatpak version, is there a way to know if shared libraries would let it work?

Amanse commented 3 years ago

Didn't work with flatpak due to glibc issue :( is there any way to get it to work with 1.1.55.498.gf9a83c60 ?

jclsn commented 3 years ago

I have this issue

Usage:

ERROR: ld.so: object '/usr/local/lib/spotify-adblock.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
  showHelp <command>

Commands:

  play                         # Resumes playback where Spotify last left off.
  play <song name>             # Finds a song by name and plays it.
  play album <album name>      # Finds an album by name and plays it.
  play artist <artist name>    # Finds an artist by name and plays it.
  play list <playlist name>    # Finds a playlist by name and plays it.
  play uri <uri>               # Play songs from specific uri.

  next                         # Skips to the next song in a playlist.
  prev                         # Returns to the previous song in a playlist.
  replay                       # Replays the current track from the beginning.
  pos <time>                   # Jumps to a time (in secs) in the current song.
  pause                        # Pauses (or resumes) Spotify playback.
  stop                         # Stops playback.
  quit                         # Stops playback and quits Spotify.

  vol up                       # Increases the volume by 10%.
  vol down                     # Decreases the volume by 10%.
  vol <amount>                 # Sets the volume to an amount between 0 and 100.
  vol [show]                   # Shows the current Spotify volume.

  status                       # Shows the current player status.
  status artist                # Shows the currently playing artist.
  status album                 # Shows the currently playing album.
  status track                 # Shows the currently playing track.

  share                        # Displays the current song's Spotify URL and URI.
  share url                    # Displays the current song's Spotify URL and copies it to the clipboard.
  share uri                    # Displays the current song's Spotify URI and copies it to the clipboard.

  toggle shuffle               # Toggles shuffle playback mode.
  toggle repeat                # Toggles repeat playback mode.

Connecting to Spotify's API:

  This command line application needs to connect to Spotify's API in order to
  find music by name. It is very likely you want this feature!

  To get this to work, you need to sign up (or in) and create an 'Application' at:
  https://developer.spotify.com/my-applications/#!/applications/create

  Once you've created an application, find the 'Client ID' and 'Client Secret'
  values, and enter them into your shpotify config file at '/home/jan/.shpotify.cfg'

  Be sure to quote your values and don't add any extra spaces!
  When done, it should look like this (but with your own values):
  CLIENT_ID="abc01de2fghijk345lmnop"
  CLIENT_SECRET="qr6stu789vwxyz"
Amanse commented 3 years ago

@coldspark29 you need to allow flatpak override system command from readme(recommended, just copy paste command from readme), if you don't know how then make spotify-adblock in home, but the .so and .toml file in it and use flatseal to allow spotify the access to that directory

jclsn commented 3 years ago

I have installed it via the AUR as always. Do I have to use Flatpak? I actually don't want to because they don't integrate well into the system theming.

abba23 commented 3 years ago

@coldspark29 That seems like a different problem. Please create a new issue for problems unrelated to the one discussed here. That output doesn't even look like it's from the actual Spotify client, but from some kind of command line interface.

jclsn commented 3 years ago

Yeah seems this is a zsh problem. It also doesn't work with bash though. Will create an issue!

Amanse commented 3 years ago

the original spotify doesn't have this cli commands, are you using spotify-cli or something?

Amanse commented 3 years ago

@abba23 should i try getting the latest .deb and installing with some converter if the verison is the issue?

edit: i don't think that's possible, i will try the non-rust version

Amanse commented 3 years ago

There is a cef build for non-rust version can it have anything to do with this?

abba23 commented 3 years ago

Does the Spotify package your're using place a wrapper script in /usr/bin instead of (linking to) the actual binary? In that case you might need to set LD_PRELOAD in that script, where the actual binary is launched. The wrapper would likely be overwritten though when Spotify gets updated, so you'd have to modify it again after every update.

Alternatively, you could just skip the wrapper script and launch the binary directly (i.e. LD_PRELOAD=/usr/local/lib/spotify-adblock.so /path/to/binary). This might however cause other problems if the wrapper does some setup that is needed for Spotify to work on Fedora.

Amanse commented 3 years ago

yes, there is a wrapper, if i run the binary directly it gives error about libcurl-gnutils being shared object file, I'll try putting it in the wrapper

Amanse commented 3 years ago

THANKS A LOT SIR! it worked by putting it in the wrapper☺️🥳

Albortolsd commented 3 years ago

THANKS A LOT SIR! it worked by putting it in the wrapperrelaxedpartying_face

hello, can i know where is the wrapper and how to modify it? Thanks a lot

Amanse commented 3 years ago

THANKS A LOT SIR! it worked by putting it in the wrapperrelaxedpartying_face

hello, can i know where is the wrapper and how to modify it? Thanks a lot

the wrapper is /usr/bin/spotify in the last line put the LDPRELOAD command from Readme, and done

Albortolsd commented 3 years ago

THANKS A LOT SIR! it worked by putting it in the wrapperrelaxedpartying_face

hello, can i know where is the wrapper and how to modify it? Thanks a lot

the wrapper is /usr/bin/spotify in the last line put the LDPRELOAD command from Readme, and done

Thanks a lot for your reply. I installed Spotify 1.1.55.498.gf9a83c60 from flathub but i haven't any spotify's file inside /usr/bin on fedora 34. What did i do different?

Ok i found it, the script is installed with the rpm fusion version, no the flatpack

Amanse commented 3 years ago

THANKS A LOT SIR! it worked by putting it in the wrapperrelaxedpartying_face

hello, can i know where is the wrapper and how to modify it? Thanks a lot

the wrapper is /usr/bin/spotify in the last line put the LDPRELOAD command from Readme, and done

Thanks a lot for your reply. I installed Spotify 1.1.55.498.gf9a83c60 from flathub but i haven't any spotify's file inside /usr/bin on fedora 34. What did i do different?

Ok i found it, the script is installed with the rpm fusion version, no the flatpack

yeah, for flatpak refer to readme

Albortolsd commented 3 years ago

i'm not sure but i added the string "LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify" at the end of the script "/usr/bin/spotify" but i have the publicity anyway, not the banners, but the audio

kuboosoft commented 3 years ago

If you use the UnitedRPMs spotify, you can put the "*.so" in "/home/your_user_name/.local/share/spotify/spotify-client/" or permanent in "/usr/lib64"

I completely forgot; if your spotify is outdated you can use "spotify-reset" (Generally each 20 days update automatic)

Albortolsd commented 3 years ago

If you use the UnitedRPMs spotify, you can put the "*.so" in "/home/your_user_name/.local/share/spotify/spotify-client/" or permanent in "/usr/lib64"

I completely forgot; if your spotify is outdated you can use "spotify-reset" (Generally each 20 days update automatic)

Thanks for the reply, i tried the UnitedRPMs and moved the .so in "/home/your_user_name/.local/share/spotify/spotify-client/" and in "/usr/lib64" too but i have the same error, undefined symbol: cef_string_userfree_utf16_free, and all the advertising too. I added "LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify" at the end of the script "/usr/bin/spotify" too I don't understand what else i have to do

tr1p0p commented 3 years ago

I confirm this bug still here on fedora 34, and add line on wrapper not working either. spotify-adblock seem just unusable on fedora that's all.

So stop closing this bug, it's still here, no instructions on wiki for solving it..

For the moment just not work on Fedora/Rhel based distro.

abba23 commented 3 years ago

It's kind of difficult for me to help you with this issue without knowing what the wrapper script looks like. Maybe @Amanse can expand on how exactly they did it.

Assuming the Spotify binary is launched on the last line of the wrapper script and the LD_PRELOAD environment variable isn't already being set anywhere, just adding LD_PRELOAD=/usr/local/lib/spotify-adblock.so to the beginning of that line should work.

tr1p0p commented 3 years ago

Ok, so i paste the all wrapper here for study : https://paste.ubuntu.com/p/6hg6xcbWMg/

I've been trying to add LD_PRELOAD=/usr/local/lib/spotify-adblock.so at the end, but no effect. terminal don't mention spotify-adblock at launch with spotify in terminal. (edit: maybe like the term at the end i have to add $spotify $@ ?)

Will investigate more this evening.

abba23 commented 3 years ago

I've been trying to add LD_PRELOAD=/usr/local/lib/spotify-adblock.so at the end

So that last line now looks like this?

LD_PRELOAD=/usr/local/lib/spotify-adblock.so LD_LIBRARY_PATH=$( dirname $spotify ) LC_NUMERIC=en_US.utf8 $spotify $@
tr1p0p commented 3 years ago

No more like this :

LD_LIBRARY_PATH=$( dirname $spotify ) LC_NUMERIC=en_US.utf8 $spotify $@
LD_PRELOAD=/usr/local/lib/spotify-adblock.so

So.. it's because the last $spotify $@launch spotify and i put the line just after, i guess is just don't take it then.. Will try that.

tr1p0p commented 3 years ago

So... now after put the line in that order, terminal show this :

dirname: symbol lookup error: /usr/local/lib/spotify-adblock.so: undefined symbol: cef_string_userfree_utf16_free
/usr/lib64/spotify-client/spotify: error while loading shared libraries: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory

My spotify version installed :

 spotify --version
/usr/lib64/spotify-client/spotify: /usr/lib64/spotify-client/libcurl-gnutls.so.4: no version information available (required by /usr/lib64/spotify-client/spotify)
Spotify version 1.1.56.595.g2d2da0de, Copyright (c) 2021, Spotify Ltd
abba23 commented 3 years ago

Try setting LD_PRELOAD after LD_LIBRARY_PATH then. I.e. like this:

LD_LIBRARY_PATH=$( dirname $spotify ) LD_PRELOAD=/usr/local/lib/spotify-adblock.so LC_NUMERIC=en_US.utf8 $spotify $@
tr1p0p commented 3 years ago

That's it !

So it's this line and no other that do the trick. I guess fedora user need like a echo line for add this in the wrapper then ? (don't really know echo..)

So for me

sudo nano /usr/bin/spotify remove last line and add this : LD_LIBRARY_PATH=$( dirname $spotify ) LD_PRELOAD=/usr/local/lib/spotify-adblock.so LC_NUMERIC=en_US.utf8 $spotify $@

Ctrl+x Enter

And now it work !

amankaif commented 3 years ago

Just logged in to say I've been using your work for every linux distro and now that I'm on fedora you've thoroughly helped getting it to run there too, I really appreciate it.

softExploit commented 2 years ago

Does the Spotify package your're using place a wrapper script in /usr/bin instead of (linking to) the actual binary? In that case you might need to set LD_PRELOAD in that script, where the actual binary is launched. The wrapper would likely be overwritten though when Spotify gets updated, so you'd have to modify it again after every update.

Alternatively, you could just skip the wrapper script and launch the binary directly (i.e. LD_PRELOAD=/usr/local/lib/spotify-adblock.so /path/to/binary). This might however cause other problems if the wrapper does some setup that is needed for Spotify to work on Fedora.

and make sure that this /usr/local/lib/spotify-adblock.so have the correct permision or it won't let you load it, i use $ sudo chmod 751 /usr/local/lib/spotify-adblock.so, or where ever you have the spotify-adblock.so located :)

bluelhf commented 2 years ago

I had this problem when I switched to the fish shell — setting LD_PRELOAD and running Spotify through bash solved the issue for me. If someone has a more idiomatic solution, feel free to share.