#
Introduction
#
JioSaavn API
#
A wrapper for JioSaavn API in Typescript Rust programming language 🦀.
Note
This project is for educational purposes only. The author of this project is not responsible for any misuse of this API. Use it at your own risk.
#
✨ Features
- 🚀 Ultrafast - Powered by Hono.js.The router
RegExpRouter
is really fast. - 🪶 Lightweight - Has minimal dependencies.
- 🌍 Multi-runtime - Works on
Bun
,Node.js
,Vercel
orCloudflare Workers
. The same code runs on all platforms. - 🔥 Download High Quality Songs, w/ lyrics for supported songs.
- 🎵 Get Songs, Albums, Playlists, Artists, Radio Stations, Podcasts Lyrics, Recommendations, and more.
- ❤️ Open Source
- 🚀 Ultrafast - Powered by Axum Web Framework
- 🪶 Lightweight - Has minimal dependencies.
- 🌍 Multi-platform - Supports
Vercel
(using community based Rust Runtime)Docker
,Render
,Shuttle.rs
orFly.io
and more. - 🔥 Download High Quality Songs, w/ lyrics for supported songs.
- 🎵 Get Songs, Albums, Playlists, Artists, Radio Stations, Podcasts Lyrics, Recommendations, and more.
- ❤️ Open Source
#
🛠️ Local Development
- Clone the repository
git clone https://github.com/rajput-hemant/jiosaavn-api-ts
cd jiosaavn-api-ts
- Install dependencies
#
Bun
Warning
You need to have Bun Runtime installed on your machine to run the project with bun.
bun i || pnpm i || yarn || npm i
bun run dev || pnpm dev || yarn dev || npm run dev
#
Node.js
bun run dev:node || pnpm dev:node || yarn dev:node || npm run dev:node
#
Vercel Dev Server
bun run dev:vercel || pnpm dev:vercel || yarn dev:vercel || npm run dev:vercel
#
Cloudflare Workers
Warning
Make sure to remove Node API code from src/index.ts
& config.ts
before deploying or running the project with Cloudflare Workers.
...
- port: +(process.env.PORT ?? 3000),
+ port: 3000, # update accordingly
...
...
- enableRateLimit: process.env.ENABLE_RATE_LIMIT === "true" ?? false,
+ enableRateLimit: false, # update accordingly
...
bun run dev:vercel || pnpm dev:cf || npm run dev:cf || yarn dev:cf
- Rust should be installed on your system. If not, then install it from here.
git clone https://github.com/rajput-hemant/jiosaavn-api-rs
cd jiosaavn-api-rs
- Run the following command to build the project.
cargo build --release
- Run the following command to launch the api server.
cargo run --release
#
☁️ Deploying your own instance
#
One Click Deploy
You can easily deploy your own hosted version of the JioSaavn API
by clicking on one of the links below, which will set up a ready-to-go version for you:
OR
#
Deploying using CLI
#
Vercel
- It utilizes Edge Functions and can automatically execute in the region nearest to the user who triggers them.
- It's worth noting that
Mumbai, India (South) - bom1
is the recommended region for this project deployment.
bun run deploy:vercel || pnpm deploy:vercel || npm run deploy:vercel || yarn deploy:vercel
#
Cloudfare Workers
bun run deploy:cf || pnpm deploy:cf || npm run deploy:cf || yarn deploy:cf
#
Build and Run Docker Image
Warning
You need to have Docker installed on your system.
You might need to run the following commands with sudo
depending on your system.
#
Docker Compose (Recommended)
- Start the container
docker-compose up -d # detached mode
- Stop the container
docker-compose stop # stops the container
docker-compose down # stops and removes the container
#
Docker
- Start Docker daemon (Skip if already running)
sudo dockerd
- Build the image
docker build -t jiosaavn .
- Run the image
docker run -p 80:3000 jiosaavn
Open http://localhost to view it in the browser.
Stop the container
docker ps
docker stop <container-id>
#
One Click Deploy
Login to your Render account and create a new 🌐 Web Service.
Fill in the details, choose Runtime
as Rust
and click on Create Web Service.
#
Build and Run Docker Image
Warning
You need to have Docker installed on your system.
You might need to run the following commands with sudo
depending on your system.
#
Docker Compose (Recommended)
- Start the container
docker-compose up -d # detached mode
- Stop the container
docker-compose stop # stops the container
docker-compose down # stops and removes the container
#
Docker
- Start Docker daemon (Skip if already running)
sudo dockerd
- Build the image
docker build -t jiosaavn .
- Run the image
docker run -p 8080:8080 jiosaavn
- Stop the container
docker ps
docker stop <container-id>
#
Shuttle.rs
- Install the Shuttle CLI
cargo install cargo-shuttle
- Add the following crates for shuttle to work
cargo add shuttle-runtime shuttle-axum
- Make sure to change the
main.rs
file to the following:
// #[tokio::main]
// async fn main() {
#[shuttle_runtime::main]
async fn axum() -> shuttle_axum::ShuttleAxum {
// tracing_subscriber::fmt::init();
...
// let addr = "[::]:8080".parse().unwrap();
// tracing::debug!("🚀 Server listening on {}", addr);
// axum::Server::bind(&addr)
// .serve(app.into_make_service())
// .await
// .unwrap();
Ok(router.into())
}
cargo shuttle project start
cargo shuttle deploy --allow-dirty
#
Fly.io
- Install the Fly CLI
curl -L https://fly.io/install.sh | sh
- A
fly.toml
file will be automatically generated byfly launch
command which will ask a few questions to set everything up.
fly launch --name jiosaavn
- Deploy the app
fly deploy
#
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
#
🦾 Contributors: