abba23/spotify-adblock

Spotify flatpak fix

pizzadude opened this issue · 15 comments

The actual spotify binary is in a different folder, so people may need to run spotify flatpak with something like this:

flatpak run --command=/app/extra/share/spotify/spotify --env="LD_PRELOAD=/home/user/.spotify-adblock/spotify-adblock.so" com.spotify.Client

--env="LD_PRELOAD=/path/to/adblock.so" might work also?

This doesn't load the adblocker since you set the command directly to the spotify binary. --command has to be set to sh in order for the -c '...' in the end to be executed.
And if set correctly it still can't start.

For me the fix was to download the prebuilt binary instead of building it myself.

Yeah, maybe I got it wrong.

flatpak run --command=/app/extra/share/spotify/spotify --env="LD_PRELOAD=/home/user/.spotify-adblock/spotify-adblock.so" com.spotify.Client seems to work, but I built the library in an Ubuntu distrobox container.

abba23 commented

I don't use Flatpak, so I can't test this. Can someone confirm that the path has changed, the current instructions in the README are broken and

flatpak run --command=/app/extra/share/spotify/spotify --env="LD_PRELOAD=/home/user/.spotify-adblock/spotify-adblock.so" com.spotify.Client

definitely works without breaking anything else (e.g. by overriding LD_PRELOAD like that)?

Rand-o commented

@abba23 Hey I did test it out on 2 of my Fedora computers running flatpak and it runs fine but doesnt block ads

same here on archlinux

commandline: flatpak run --command=/app/extra/share/spotify/spotify --file-forwarding --env="LD_PRELOAD=/home/alsog/.spotify-adblock/spotify-adblock.so" com.spotify.Client --no-sandbox --no-zygote

ERROR: ld.so: object '/home/alsog/.spotify-adblock/spotify-adblock.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

You need to whitelist ~/.spotify-adblock with flatseal

@pizzadude thanks! seems to be working fine now

Rand-o commented

@pizzadude that was it :) thanks!