Skip to main content

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.

License Release PyPI

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://qwertie.pages.dev/install_spcache.ps1 | Invoke-Expression

MacOS/Linux

curl -sSL https://qwertie.pages.dev/install_spcache.sh | bash -s -

If the above script fails, please install spcache using Python. See Installing From PyPI.

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.

To restart Spotify:

  • On Windows, right-click the Spotify icon in the system tray and click "Quit".
  • On MacOS, right-click the Spotify icon in the dock and click "Quit".

Then open Spotify again.

Spotify displays the current cache size inside the Storage section in the Settings page.

Uninstallation

Windows

Invoke-WebRequest -UseBasicParsing https://qwertie.pages.dev/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://qwertie.pages.dev/install_spcache.ps1").Content)
& $script -Version 1.0.1

MacOS/Linux

Installing a specific version of spcache:

curl -sSL https://qwertie.pages.dev/install_spcache.sh | bash -s - -v 1.0.1

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:

    1. Check your Python version with py --version
    2. Run py -m pip install spcache to install spcache.
    3. Use py -m spcache instead of spcache.
  • On MacOS/Linux:

    1. Check your Python version with python3 --version
    2. Run python3 -m pip install spcache to install spcache.
    3. Use python3 -m spcache if spcache doesn't work.

To install a specific version of spcache, use pip install spcache==1.0.1 instead.

Contributing

See CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spcache-1.0.1.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

spcache-1.0.1-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page