Skip to content
Nightscape Coffee edited this page Dec 11, 2022 · 11 revisions

Browser Extensions

Import to Redirector

Get Redirector for Firefox
Get Redirector for Other Browsers

Notes:

  • ✅ Spotify Desktop users: Good for previewing Spotify links in-browser without interrupting desktop listening
  • 🧪 Spotify Web Player users: May cause unwanted redirects. Please report bugs to Issues.
  • Redirector extension is not affiliated in any way to Soju.

Advanced

To get a direct link, you can also add the url to a ?s= query parameter like so:

https://soju.▉▉▉▉▉.▉▉/?s=SPOTIFYLINKHERE

Here's a list of query parameters. Many of these can be strung together using ?s=str&sm=str&method=str.

Query Type Description
?s= str Jump straight to processing a Spotify url
?sa= bool Run all processing methods for an ?s= url
see ?method= for more info
?sm= str Processing method for an ?s= url
see ?method= for more info
?method= str Set default processing method for the browsing session
  • api (default): Uses Spotify Web API to fetch data
  • embed: Loads a Spotify webpage directly (fallback)

Privacy

The regex parses your Spotify links for track/album/playlist and the item ID. All other parts of the Spotify link are discarded. Cookies from Spotify are not placed until an unmodified Spotify webpage is displayed, either as a fallback when the API fails, or manually fetching from the fallback.

Soju is a static site with no server backend. To provide a secure connection to the Spotify API and to authenticate all requests, Soju fetches/displays all Spotify data to the end user through Netlify Functions and Netlify CDN, which uses AWS Lambda and Cloudflare.

Soju can be considered as a "private frontend for Spotify", particularly as it lets you access publicly available free Spotify data without logging in, doesn't track you, and because Spotify-to-YouTube frontends are more "YouTube frontends that support Spotify links". As an in-between service, Spotify does not see that you submitted the songs, as Soju requests the data for you. Soju does not run analytics, does not log the music you send, and does not leave cookies (excluding unmodified Spotify webpages).

But, Soju cannot be considered a "Spotify replacement". If you define a "private frontend" as "giving users unlimited, anonymous access to copyrighted content for free" (beyond what can be accessed without an account for free), then Soju will not be for you. Consider a redirector service instead (Spotify links -> another service). If you are willing to pay for Spotify's copyrighted content, then you will be able to use other full-featured FOSS Spotify clients.

Soju is for previewing Spotify links quickly, without logins, and with a comfortable user experience. Soju was made for both non-Spotify users and Spotify users, who may find a need to preview Spotify links, albeit for different reasons. To achieve this, Soju includes using Vue/JavaScript, accessing/displaying unmodified Spotify webpages where necessary, and relying on Netlify/Cloudflare to stand between you and Spotify. Soju will try to be privacy-friendly, but does not promise to protect users from "big tech", governments, or Spotify's legal team. If your threat model depends on avoiding commonplace web technologies and services, Soju may not be for you. Soju's code is open-source, and the Node.js scripts are ready, if you would like to adapt it to create an API-only (no-JavaScript) frontend.


Spotify License Limitations

Soju fetches copyrighted music data licensed by Spotify. Soju website hosts use an API key from Spotify Web API to license this data for use in Soju.

  • Soju will only use "Audio Preview Clips", which are 30 second preview clips for public use. For the purposes of Spotify's licenses, Soju does not and will not do "Streaming", which is defined as streaming/making available the full song.
  • Soju fetches the most up-to-date content from Spotify to display at the time of request by a user. No data is collected or stored after the user closes the tab. Soju cannot access any data Spotify removes from its API.
  • Soju does not and will not bypass geo-restrictions. Songs that are geo-blocked or otherwise restricted by the API will not play and show a crossed-out music note icon.
  • Soju provides a link back to all content fetched from Spotify.
  • Soju may display an unmodified Spotify webpage in its original form (outside of the control of Soju) when the API fails. This webpage is maintained by Spotify, who may place cookies, use tracking technologies, and restrict access to Spotify content within that webpage.

On page load, a Spotify access token is retrieved using the website host's Spotify API Key via Netlify Functions and cached for use during the session. The Spotify access token is removed when the tab closes, or expires after an hour, whichever comes earlier. Spotify ratelimits requests from users using this access token. All data from the session is cleared when the user closes the tab.


Self-Host

Soju is free, open source, and self-hostable. However, this comes with some big caveats:

  • Soju was designed for Netlify, which effectively restricts you to only hosting on Netlify at the moment.
  • Soju uses copyrighted content from Spotify, which means you must obtain a Spotify API key to use the data. Soju will not parse and does not endorse parsing any public Spotify webpages for any licensed Spotify content.

Prerequisites:

  • Netlify account (free)
  • Spotify account + API key
  • A public electronic mail inbox or webpage with contact info, for DMCA and contact

Steps:

  1. Click "Fork" on the top right corner
  2. Add your info under instanceInfo in src/main.js
  3. Go to Netlify (create an account if you haven't) and deploy the site
  4. Under Build settings > Environment variables, add the variables listed in .env.example (your Spotify API keys go here)
  5. Under Top Bar > Deploys > Trigger deploy > click "Clear cache and deploy site" to re-deploy the site

Development

Fork the project, then install all dependencies using npm install.

Copy the .env.example file to .env and fill in the values.

Run the development server using netlify dev.

  • Use npx to run Netlify CLI if it's not installed locally.
  • Due to a bug, Netlify CLI currently requires Node 14-16 (not 17) for the server to run properly.

License

Soju is licensed under the GPLv3 License, which allows changes as long as your code remains open-source.

Soju is not endorsed by Spotify. Soju uses copyrighted content from the Spotify Web API under license.

Feel free to modify Soju for white-label purposes, but please keep all credits per LICENSE.

This was an educational project exploring Vue/Vite, Nodejs, and the Spotify Web API. All code has been open-sourced in the hopes that this software can be useful to someone. If there are any legal questions (DMCA, license, white-label, etc.) please send them to sojumail [@] catdev.anonaddy.com.

© 2021–Present, by coffeebank.

Clone this wiki locally