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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file spcache-1.0.1.tar.gz.

File metadata

  • Download URL: spcache-1.0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Linux/5.15.0-1038-azure

File hashes

Hashes for spcache-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35e3460ffa6f20b222b4b0880cf477776b2846d4b1995e427a887da21f30c763
MD5 dd56f05dde1befd0c77f6f0e0d744d9c
BLAKE2b-256 1c494afeca707fab9ba7984291b7318da52e6ec1e599785c1c8f305acfa8bf21

See more details on using hashes here.

File details

Details for the file spcache-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: spcache-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Linux/5.15.0-1038-azure

File hashes

Hashes for spcache-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5078178097299af43a1394f512b457702fc0e8958a7b13c5b2e0471021bf3e3
MD5 88148a1e5d7a2fd19d94b6ae64fc12f8
BLAKE2b-256 0868957dcd0fe65447be75b657eced91ed524033cdb9c921924e44af92a59469

See more details on using hashes here.

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