Skip to content

Darshanx256/LinkPark

Repository files navigation

LinkPark Logo

You send a Spotify link to a friend. They reply "I don't have Spotify." You roll your eyes. That's why LinkPark exists.

LinkPark takes a track, it could be a messy URL you copied from an app or just a few lyrics you vaguely remember, then figures out exactly what song it is. It then spits out clean, tracker-free links for every major streaming platform so you can actually share music without the back-and-forth.

LinkPark handles the heavy lifting in the background by orchestrating a "Metadata-First" resolution pipeline. It uses randomized sequential proxy fallbacks for Odesli, YouTube OEmbed for metadata discovery, and automated scraper-based recovery for streaming links. It purposely scrubs out annoying tracking parameters (like ?si= or &mt=) and uses a server-side O(1) response cache to ensure near-instantaneous resolution for repeat searches.

What's different here? By combining OEmbed, scraping, and deep-search via Tinyfish and Apple Music, LinkPark almost always provides links for the "Big 3" (Spotify, YouTube Music, and Apple Music) even when Odesli's native matching fails! ;D

Key Features

  • Robust URL Drops: Intelligent extraction of Artist/Song from messy URLs via OEmbed and Scraping.
  • Sequential Proxy Fallback: Shuffles multiple external proxies to bypass rate limits and regional blocks.
  • O(1) Server-Side Cache: Instant results for repeat resolutions and shared links.
  • Proof-of-Work (PoW) Security: Uses SHA-256 challenges to prevent API abuse without requiring complex auth.
  • Native 30s Audio Previews: Integrated player for instant verification.

How to use it

Deployment & Local Setup

LinkPark is flexible. You can run it in three different ways depending on how much you care about API key security and pain:

1. The Standalone Server (Recommended for zero-effort hosting)

If you want to host everything in one place (like on Render, Vercel, or a VPS), just point your hosting service to this repository.

  • The server.js acts as both the web server and a secure API proxy.
  • Setup:
    • Add TFKEY to your environment variables.
    • Set PROXY = '/api/search' in index.html and push.
    • Your API key stays safe on the server and is never seen by the browser.

2. The Hybrid Way (GitHub Pages + External Proxy)

You can keep the frontend on GitHub Pages and host the proxy elsewhere.

  • Setup:
    • Deploy the server.js to a service like Vercel or Render.
    • Add TFKEYS, SERVICE, and POW_DIFFICULTY to that service's environment variables.
    • Set SERVICE to a comma-separated list of frontend origins that may use the proxy, for example https://your-site.example,https://your-user.github.io.
    • Optional proxy tuning envs: PROXY_TOKEN_TTL_SECONDS, SESSION_RATE_LIMIT_WINDOW_MS, SESSION_RATE_LIMIT_MAX, API_RATE_LIMIT_WINDOW_MS, and API_RATE_LIMIT_MAX.
    • Set PROXY = 'https://your-proxy-url.com/api/search' in index.html and push.
  • This is great if you want to keep the "static" feel of GitHub Pages but still want a secure key.

3. Least pain (Local Development)

Perfect for testing things out on your machine without setting up a server.

  • Setup:
    • Clone the folder.
    • Create a config.js in the root:
      window.LINKPARK_CONFIG = { TFKEY: "your_key_here" };
    • Leave PROXY = '' in index.html.
    • Open index.html in your browser. (Note: Search might fail in some browsers due to CORS if run directly from a file).

👉 Live Demo: LinkPark

What it uses under the hood

  • Frontend: Plain HTML, CSS, and Vanilla JavaScript.
  • Primary Resolution: Odesli API
  • Deep Search: Tinyfish API
  • Metadata & Audio Previews: iTunes Search API

Stress testing Odesli reliability

The repo includes a pytest stress test that runs the real Express proxy, uses the normal /api/challenge proof-of-work flow, replaces only Tinyfish with a local simulator, and then slowly resolves 50 random tracks through /api/resolve over 10 minutes. Odesli and iTunes are still real network calls.

python -m pip install -r requirements-dev.txt
RUN_LINKPARK_STRESS=1 python -m pytest tests/stress/test_odesli_reliability.py -q

Useful knobs:

LINKPARK_STRESS_COUNT=5 LINKPARK_STRESS_DURATION_SECONDS=60 RUN_LINKPARK_STRESS=1 python -m pytest tests/stress/test_odesli_reliability.py -q

Design

The LinkPark logo uses the Open Sans font (licensed under the Apache License, Version 2.0).

Free to do whatever, just don't abuse my api at preview site :D

About

Convert links across various music services! gives consistent links for Spotify, Apple Music, YT Music and more.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors