Ensure Spotify's cache size doesn't exceed a specified threshold.
Project description
spcache
A simple CLI tool to set a limit on Spotify's cache size.Installation
See Installing a Specific Version for additional options.
Windows
Open PowerShell. You can do this by searching for "PowerShell" in the Start menu.
Paste the following and hit enter:
Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Qwerty-133/spcache/main/bin/install_spcache.ps1 |
Invoke-Expression
MacOS/Linux
curl -sSL https://raw.githubusercontent.com/Qwerty-133/spcache/main/bin/install_spcache.sh | bash -s -
Usage
-
Set the cache size limit to 1GB:
spcache set --size 1000
spcache will try to detect your Spotify prefs file and set the cache size to the specified value in megabytes (MB).
-
Specify the path to your prefs file manually:
spcache set --size 1000 --file /path/to/prefs
-
View the current cache size limit:
spcache get
-
View more options:
spcache --help
How It Works
spcache works by changing the value of storage.size
in your Spotify prefs file.
:warning: Changes are applied when the Spotify app is restarted.
Spotify displays the current cache size inside the Storage section in the Settings page.
Uninstallation
Windows
Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Qwerty-133/spcache/main/bin/uninstall_spcache.ps1 |
Invoke-Expression
This will remove the spcache files and remove spcache from your PATH.
MacOS/Linux
spcache is installed in ~/.local/share/spcache
, unless $XDG_DATA_HOME
is set.
rm -r "~/.local/share/spcache" || rm -r "${XDG_DATA_HOME}/spcache"
Installing a Specific Version
Available versions are listed here https://github.com/Qwerty-133/spcache/releases.
Windows
Installing a specific version of spcache:
$script = [scriptblock]::Create(
(iwr -useb "https://raw.githubusercontent.com/Qwerty-133/spcache/main/bin/install_spcache.ps1").Content
)
& $script -Version 1.0.0
MacOS/Linux
Installing a specific version of spcache:
curl -sSL https://raw.githubusercontent.com/Qwerty-133/spcache/main/bin/install_spcache.sh |
bash -s - --version 1.0.0
Installing from PyPI
spcache is also available on PyPI https://pypi.org/project/spcache/. If you have Python 3.8+ installed, you can install spcache using pip:
-
On Windows:
- Check your Python version with
py --version
- Run
py -m pip install spcache
to install spcache. - Use
py -m spcache
instead ofspcache
.
- Check your Python version with
-
On MacOS/Linux:
- Check your Python version with
python3 --version
- Run
python3 -m pip install spcache
to install spcache. - Use
python3 -m spcache
ifspcache
doesn't work.
- Check your Python version with
Contributing
See CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.