Skip to content

idMJA/accessify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accessify

Credit: This project is based on devoxin/anonify with refactoring and adaptation for LavaSrc and general Spotify access token needs.

A simple REST API to generate and cache anonymous Spotify access tokens using Playwright. This project is primarily designed for use as a custom anonymous token endpoint for LavaSrc on Lavalink, but can be used in any application or service that needs a fresh Spotify access token.

Alternative: For a compiled/binary version, you can use accessify-rs — a Rust port of this project.

Features

  • Generate anonymous Spotify access tokens (browser automation, Playwright)
  • Designed for seamless integration with LavaSrc/Lavalink (customTokenEndpoint)
  • Can be used by any service needing a Spotify access token
  • Token caching with force refresh support
  • Concurrency-safe (Semaphore)
  • Fast REST API (Hono framework)
  • TypeScript, modular and maintainable structure

Requirements

  • Node.js 18+
  • Chromium browser (see below for installation instructions)

Install dependencies

npm install

Chromium Installation

For most environments (not Pterodactyl):

Install Playwright's bundled Chromium automatically:

npx playwright install chromium

For Pterodactyl (or restricted environments):

  1. Download Chromium
  2. Extract the archive and upload the chrome/chromium binary (and its folder) to your Pterodactyl server, e.g. /home/container/chrome-linux/chrome.
  3. Set the path in .env:
    CHROME_PATH=/home/container/chrome-linux/chrome
  4. Restart your server/container.

If CHROME_PATH is not set, Playwright will use its default browser (if installed).

Build & Run

npm start

API Usage

  • GET /spotifytoken
    • Returns a cached Spotify access token (auto-refresh if expired)

Example:

curl http://localhost:3000/spotifytoken

Integration: LavaSrc Custom Anonymous Token Endpoint

This API can be used as a custom anonymous token endpoint for LavaSrc and Lavalink (see LavaSrc PR #286).

Example LavaSrc on Lavalink config:

spotify:
  preferAnonymousToken: true
  customTokenEndpoint: "http://localhost:3000/spotifytoken"

Notes

  • For deployment on server/CI, make sure Chromium is available:
    • Use npx playwright install chromium for most environments.
    • For Pterodactyl, upload Chromium manually and set CHROME_PATH in .env.
  • Request logs include IP and user-agent.

About

A simple REST API to generate and cache anonymous access tokens using Playwright.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •