Nuzair46 / SpotX-Linux

Spotify Ad blocker based on SpotX for Linux
MIT License
760 stars 33 forks source link

[Fedora] xpui not found. *solved* #11

Closed UnsuitableFollower closed 1 year ago

UnsuitableFollower commented 1 year ago

Screenshot from 2022-11-19 13-58-41 how to fix this

jetfir3 commented 1 year ago

@UnsuitableFollower

Did you use Snap to install? Snap isn't supported (as noted in readme). If this is not with Snap, please give more details on the Spotify install.

UnsuitableFollower commented 1 year ago

no I've tried spotify flatpak and spotify (from the rpm repository source) it's still the same Screenshot from 2022-11-20 07-52-43

the two versions of spotify are the same (1.1.84.716)

kierandrewett commented 1 year ago

I had the same issue as you on Fedora. Manually setting the path to spotify's install dir to /usr/share/spotify-client worked for me.

bash <(curl -sSL https://raw.githubusercontent.com/SpotX-CLI/SpotX-Linux/main/install.sh) -P /usr/share/spotify-client
UnsuitableFollower commented 1 year ago

I had the same issue as you on Fedora. Manually setting the path to spotify's install dir to /usr/share/spotify-client worked for me.

bash <(curl -sSL https://raw.githubusercontent.com/SpotX-CLI/SpotX-Linux/main/install.sh) -P /usr/share/spotify-client

thanks! now working

jetfir3 commented 1 year ago

Glad this was sorted by using the path flag.

This got me curious so I installed a Fedora 36 container today to poke around and noted the following two things:

  1. I was able to reproduce the initial issue when building/installing via rpm. It seems that this install method sets spotify in PATH to /usr/bin without a symlink. In various other distros I've tested this is not typical behavior and if "spotify" is added to /usr/bin it's just a symlink pointing the the actual spotify binary which we detect with SpotX and auto-add the directory that way.

When Spotify is detected in PATH, SpotX assumes it can then use said PATH to find the app directory to then find the files to patch. But /usr/bin/spotify in PATH with no symlink confused SpotX so it was not able to locate the files for patching, hence the error in initial issue.

  1. Installing Spotify flatpak allowed SpotX to work without any additional flags needed. When using only flatpak to install Spotify, no Spotify binary or symlink is added to usr/bin and SpotX then knew to look elsewhere for the app directory.

It was mentioned above that both flatpak and rpm methods were used to install Spotify and SpotX was failing with both -- I suspect rpm method was used first, so SpotX continued to detect /usr/bin/spotify, which ignored the flatpak install.

I've updated the SpotX install script to exclude /usr/bin as a path to settle on, and it will now continue looking elsewhere if detected. This should help with Spotify install conditions where spotify is added to /usr/bin without a symlink. Output should then look something like:

**************************
SpotX-Linux by @SpotX-CLI
**************************

Spotify PATH is set to /usr/bin, searching for Spotify directory...
Spotify directory found: /usr/share/spotify-client
Creating xpui backup...
Extracting xpui...
Applying SpotX patches...
Removing empty ad block...
Removing playlist sponsors...
Removing upgrade button...
Removing audio ads...
Removing billboard ads...
Removing premium upselling...
Removing premium-only features...
Unlocking Spotify Connect...
Removing logging...
Rebuilding xpui...
SpotX finished patching!

If multiple install methods are used, SpotX may still get "confused" and patch an install directory not intended by the user. Example: spotify is installed via rpm and flatpak, SpotX patches rpm install but user wanted the flatpak install patched.

Trying to account for various simultaneous Spotify installations made by the user is not something I want to try to factor in. If for some reason there are multiple Spotify app directories installed and SpotX is not patching the one the user prefers -- the user should use the -P flag to specify the intended directory.