Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI empty square (bottom banner) #12

Closed
danieldodi opened this issue May 19, 2021 · 30 comments
Closed

UI empty square (bottom banner) #12

danieldodi opened this issue May 19, 2021 · 30 comments

Comments

@danieldodi
Copy link

Is there any way to remove this bottom empty banner?

image

@abba23
Copy link
Owner

abba23 commented May 19, 2021

Not using this adblocker, but you could do it by modifying xpui.js (e.g. search for {adsEnabled:!0} and remove the !) in <path to Spotify>/Apps/xpui.spa, which is just a zip file. You would have to repeat that process after every Spotify update though.

@NoNameForMee
Copy link

Dear @abba23 thanks for this information!
I too was looking for a way to get rid of that annoying empty banner..

Wrote a quick bash script which some may find useful (it requires permissions to change content in Spotify directory however it does not check that it has those permissions):

#!/bin/bash
sPATH=$(dirname $(realpath -L $(which spotify)))  # absolute path to Spotify
cd ${sPATH}/Apps/
cp xpui.spa ~/xpui.spa_bak  # create a backup, in home folder, in case of trouble
unzip -p xpui.spa xpui.js | sed 's/{adsEnabled:\!0}/{adsEnabled:0}/' > xpui.js
zip --update xpui.spa xpui.js
rm xpui.js

@abba23 abba23 closed this as completed May 23, 2021
@abba23 abba23 pinned this issue May 23, 2021
@snbk97
Copy link

snbk97 commented May 28, 2021

@NoNameForMee Currently the banner shows a 0 at the bottom left for me. I've changed the sed expression a bit 's/adsEnabled:a/adsEnabled:false/'

@Zzombiee2361
Copy link

Zzombiee2361 commented Jun 10, 2021

Here's a script based on @NoNameForMee's script and @snbk97 change. It also include an option to restore and checks for permission.

Edit: Added support for flatpak

Edit 2: Fixed sed expression

#!/bin/bash
if which spotify > /dev/null; then
    sPATH=$(dirname $(realpath -L $(which spotify)))  # absolute path to Spotify
elif flatpak list | grep --q com.spotify.Client; then
    sPATH="$(flatpak --installations)/app/com.spotify.Client/current/active/files/extra/share/spotify"
else
    echo "Spotify not found"
    exit 0
fi
cd ${sPATH}/Apps/

if [ "$1" == 'restore' ]; then
    if [ -w xpui.spa_bak ] && [ -w . ]; then
        rm -f xpui.spa
        mv xpui.spa_bak xpui.spa
        echo "Restore success"
    else
        [ -f xpui.spa_bak ] && echo "Permission denied" || echo "Backup not found"
    fi
    exit 0
fi

if [ -w xpui.spa ] && [ -w . ]; then
    cp xpui.spa xpui.spa_bak  # create a backup, in case of trouble
    unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > xpui.js
    zip --update xpui.spa xpui.js
    rm xpui.js
    echo "Success"
else
    [ -f xpui.spa ] && echo "Permission denied" || echo "File not found"
fi

Usage

# to remove ad banner
sudo ./remove_spotify_banner.sh

# restore from backup, in case of trouble
sudo ./remove_spotify_banner.sh restore

@abba23 abba23 mentioned this issue Jun 10, 2021
@ab1nn
Copy link

ab1nn commented Sep 17, 2021

I still have the zero. I tried all the three sed commands by @NoNameForMee @snbk97 @Zzombiee2361 . Is it a problem on my end?

@Zzombiee2361
Copy link

@abinlatheef if you ran @NoNameForMee's script without @snbk97's change, your xpui.js is already modified and running my script won't change a thing. Restore the file and run the script again. You can do that with my script e.g. sudo ./remove_banner.sh restore && ./remove_banner.sh

@ab1nn
Copy link

ab1nn commented Sep 18, 2021

@Zzombiee2361 Thank you very much bro. It worked like a charm.

@jpmvferreira
Copy link

I'm running Manjaro with spotify-adblock-git installed from the AUR and I don't have such a file, only a folder named xpui with a lot of files inside, neither is called xpui.spa and one is called xpui.js (a massive one line 1.5 Mb file) and other named xpui.css.

In the file xpui.js removing the ! as mentioned before also shows up a 0 in the bottom as others have mentioned, however changing it to adsEnabled:false works.

Just mentioning this because the previous scripts all consider the Apps folder, not sure if this is due a new update or something to do with being installed from the AUR.

@realnc
Copy link

realnc commented May 1, 2022

To automate this on Gentoo Linux, you can add a post_src_install() hook that patches the spa file. Create this file:

/etc/portage/env/media-sound/spotify

with this in it:

post_src_install() {
    elog "Patching xpui.spa to remove ad box."
    cd "${ED}"/opt/spotify/spotify-client/Apps || die
    unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0}/adsEnabled:false}/' > xpui.js || die
    zip --update xpui.spa xpui.js || die
    rm xpui.js || die
}

Now just reinstall spotify (emerge -a1 spotify) and it should be patched.

@liukliukliuk
Copy link

To automate this in Fedora 36+ with lpf package

#!/bin/bash
cd /usr/lib64/spotify-client/Apps/
cp xpui.spa ~/xpui.spa_bak  # create a backup, in home folder, in case of trouble
unzip -p xpui.spa xpui.js | sed 's/{adsEnabled:\!0}/{adsEnabled:false}/' > xpui.js
zip --update xpui.spa xpui.js
rm xpui.js

@ghost
Copy link

ghost commented Nov 30, 2022

Guys, is there an equally practical way to remove the Upgrade button?

xd

I tried this method, but it seems that the xpui.sa file they provide hides more elements than expected, for example in the Settings tab.

Could someone take a look at it? Thanks!

@semka95
Copy link

semka95 commented Nov 30, 2022

@soonan5, try to use spicetify-cli, you can create custom css and hide anything.

@ghost
Copy link

ghost commented Nov 30, 2022

I've already used spicetify-cli, but I am not looking to make extreme changes to the interface, I just want to get rid of the Upgrade button, which has become bigger with a new Spotify update (⌣̩̩́_⌣̩̩̀)

@sun95n
Copy link

sun95n commented Jan 4, 2023

It's much easier than you think, even without making drastic changes to the interface. Just follow the detailed installation instructions for your platform.

Then edit user.css located in /usr/share/spotify/Apps/xpui/ (this directory may be different depending on your version of Spotify).

/*BOTTOM BANNER*/
.main-leaderboardComponent-container {
  display: none;
}

/*CONTEXT MENU DOWNLOAD BUTTON*/
.main-contextMenu-disabled:not([as=a]) {
  display: none;
}

/*CONTEXT MENU UPGRADE TO PREMIUM BUTTON*/
.main-contextMenu-menuItem [href="https://www.spotify.com/premium/?ref=desktop_loggedin_upgrade_menu"] {
  display: none;
}

/*DOWNLOAD BUTTON*/
.x-downloadButton-DownloadButton{
  display: none;
}

/*SPONSORED BANNER*/
.WiPggcPDzbwGxoxwLWFf {
  display: none;
}

/*UPGRADE BUTTON*/
.main-topBar-UpgradeButton {
  display: none;
}

Also, if you don't like the new Experimental Features and Sidebar Config buttons, you can hide them by editing config-xpui.ini located in $HOME/.config/spicetify

sidebar_config = 0
home_config = 0
experimental_features = 0

After that make sure to apply changes: spicetify apply

If you decide to do the latter, edit user.css again (the spicetify apply command resets this file to default).

That would be all, this wonderful repository does the rest!

Perhaps you can consider this as an alternative to the previously proposed script, although both work fine, it's more comfortable to work on a CSS base than on a harcoded one.

@pakosaan
Copy link

To automate this in Fedora 36+ with lpf package

#!/bin/bash
cd /usr/lib64/spotify-client/Apps/
cp xpui.spa ~/xpui.spa_bak  # create a backup, in home folder, in case of trouble
unzip -p xpui.spa xpui.js | sed 's/{adsEnabled:\!0}/{adsEnabled:false}/' > xpui.js
zip --update xpui.spa xpui.js
rm xpui.js

does this still work

@pakosaan
Copy link

It's much easier than you think, even without making drastic changes to the interface. Just follow the detailed installation instructions for your platform.

Then edit user.css located in /usr/share/spotify/Apps/xpui/ (This directory may be different depending on your version of Spotify)

/*CONTEXT MENU UPGRADE TO PREMIUM BUTTON*/
.main-contextMenu-menuItem [href="https://www.spotify.com/premium/"] {
  display: none;
}

/*BOTTOM BANNER*/
.main-leaderboardComponent-container {
  display: none;
}

/*UPGRADE BUTTON*/
.main-topBar-UpgradeButton {
  display: none;
}

Also, if you don't like the new Your Episodes, Experimental Features, and Sidebar Settings buttons, you can hide them by editing config-xpui.ini located in $HOME/.config/spicetify

sidebar_config        = 0
experimental_features = 0

After that make sure to apply changes: spicetify apply

003 ep

That would be all, this wonderful repository does the rest!

Perhaps you can consider this as an alternative to the previously proposed script, although both work fine, it's more comfortable to work on a CSS base than on a harcoded one.

There is no user.css file. can we add to xpui.css file instead

@liukliukliuk
Copy link

To automate this in Fedora 36+ with lpf package

#!/bin/bash
cd /usr/lib64/spotify-client/Apps/
cp xpui.spa ~/xpui.spa_bak  # create a backup, in home folder, in case of trouble
unzip -p xpui.spa xpui.js | sed 's/{adsEnabled:\!0}/{adsEnabled:false}/' > xpui.js
zip --update xpui.spa xpui.js
rm xpui.js

does this still work

it should

@sun95n
Copy link

sun95n commented Feb 10, 2023

There is no user.css file. can we add to xpui.css file instead

Try to create it. You can also read Themes.

@liukliukliuk
Copy link

Well, the new update that supposedly removed the banner actually made mine show up again. And the script doesn't work anymore to remove it. :/

@abba23
Copy link
Owner

abba23 commented Apr 6, 2023

Well, the new update that supposedly removed the banner actually made mine show up again.

There was no such update.

And the script doesn't work anymore to remove it. :/

The scripts only modify your Spotify installation and are completely independent of this project. If a script you're using doesn't work, it's not because of (any changes to) spotify-adblock. The likely explanation is that you installed a Spotify update that changed something in its Javascript code, so the script would have to be modified.

@ErrorNoInternet
Copy link

ErrorNoInternet commented Apr 6, 2023

Well, the new update that supposedly removed the banner actually made mine show up again. And the script doesn't work anymore to remove it. :/

Also happening to me, I had just installed the Flatpak version and noticed the script wasn't working.
Try removing the brackets in the sed part of the script (around line 26):

-    unzip -p xpui.spa xpui.js | sed 's/{adsEnabled:\!0}/{adsEnabled:false}/' > xpui.js
+    unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > xpui.js

@liukliukliuk
Copy link

Well, the new update that supposedly removed the banner actually made mine show up again. And the script doesn't work anymore to remove it. :/

Also happening to me, I just installed the Flatpak version and had found that the script wasn't working. Try removing the brackets in the sed part of the script (around line 26):

-    unzip -p xpui.spa xpui.js | sed 's/{adsEnabled:\!0}/{adsEnabled:false}/' > xpui.js
+    unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > xpui.js

worked for me now, thank you :3

@almera-vs
Copy link

I'm trying to run the script, but all I get is this blank screen, not sure what I'm doing wrong
blank screen

@dxcvvxd
Copy link

dxcvvxd commented Jun 8, 2023

here on artix on latest (at the moment) spotify update, the absolute path is over at /opt/spotify
edit: thanks @liukliukliuk for the working remove sed part.

@sun95n
Copy link

sun95n commented Jun 9, 2023

For users of the new look of Spotify. I edited my comment to fix #149

I guess that's it for now. If you find something equally annoying, you can let me know or try to fix it using spicetify enable-devtools

@liukliukliuk
Copy link

Someone e-mailed us with the script with the new absolute file path

#!/bin/bash
cd /opt/spotify/Apps/

if [ "$1" == 'restore' ]; then
    if [ -w xpui.spa_bak ] && [ -w . ]; then
        rm -f xpui.spa
        mv xpui.spa_bak xpui.spa
        echo "Restore success"
    else
        [ -f xpui.spa_bak ] && echo "Permission denied" || echo "Backup not found"
    fi
    exit 0
fi

if [ -w xpui.spa ] && [ -w . ]; then
    cp xpui.spa xpui.spa_bak  # create a backup, in case of trouble
    unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > xpui.js
    zip --update xpui.spa xpui.js
    rm xpui.js
    echo "Success"
else
    [ -f xpui.spa ] && echo "Permission denied" || echo "File not found"
fi

usage: save this to a sh file, make it executable and then run it with sudo.
e.g: sudo ./remove_banner.sh restore && sudo ./remove_banner.sh
Just putting this here for convenience.
Thanks for the work and cheers!

@pakosaan
Copy link

Anyway to remove the blackbox bar from the flatpak version of spotify

@F-36
Copy link

F-36 commented Oct 23, 2023

Someone e-mailed us with the script with the new absolute file path

cd /opt/spotify/Apps/

I don't have anything there, only in /usr/share/spotify/Apps.

unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > xpui.js
zip --update xpui.spa xpui.js

Did that and nothing changed.

@pakosaan
Copy link

Someone e-mailed us with the script with the new absolute file path

cd /opt/spotify/Apps/

I don't have anything there, only in /usr/share/spotify/Apps.

unzip -p xpui.spa xpui.js | sed 's/adsEnabled:\!0/adsEnabled:false/' > xpui.js
zip --update xpui.spa xpui.js

Did that and nothing changed.

Did the banner removed or not?
can you please tell things you did?

@trinaldi
Copy link

trinaldi commented Dec 8, 2023

@semka95 Instructions is working pretty well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests