WIGAStudio / saavn-cli-test

Command Line tool to search, download MP3 songs from Saavn Library. Open-source and High Quality Music

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

saavn-cli - Command-Line Music Downloader

Search, Download and Play your favorite songs right away from the command-line. High-Quality MP3 Files upto 320kbps bitrate with Metadata.

Details


Developer : @wiz64
Status : In Development
Version : v 1.0.1
Last Updated : June 2022
Based on : Saavn Unofficial API By @sumitkolhe


Written in - Python
Compatible with Linux, Windows, Android(Termux) & MacOS

Features -

  • ❤️ Free and Open Source
  • 📙 A large library of tracks
  • 🚀 Search and Download tracks directly from the command Line
  • 🎶 Upto 320kbps MP3 files with Metadata
  • 🎧 Download Multiple tracks at once

Usage

Quickstart

  • Compiled Executable

Download the executable binary file, and run it directly or from the terminal

./saavn-cli search english songs

This will query the API for "english songs" and then display the results as a list. Enter comma-seperated numbers of tracks to download (eg. 4,6,12,15)

  • Python Script (Lighter)

Universal :

python saavn-cli.py search english songs

How it works ?

When a user runs the script to search or download songs,
The script requests download links, album art, album details, etc from the unofficial API. It downloads the raw files and then compiles them using ffmpeg.

Installation

Requirements

  • ffmpeg
  • Python (v3)
  1. Install FFMPEG
    To check if ffmpeg is properly installed, run
    ffmpeg -version
    Download ffmpeg
  • Termius/Linux : sudo apt install ffmpeg
  • MacOS (Homebrew) : brew install ffmpeg
    check brew.sh
  • Windows users can copy ffmpeg.exe to C:\Windows\System32 or any other $PATH Directory
  1. Download Executable from RELEASES PAGE (new) Directly run commands relatively to the executables.

Using Python Script:

Python
Download and install Python v3+. Run

pip install -r requirements.txt

execute script :

python saavn-cli.py search:160 english songs

Compiling Binary :

With pyinstaller

pip install -U pyinstaller

pyinstaller --onefile saavn-cli.py

The Executable file will be saved to dist folder


Argument Parsing

Example Command :

./saavn-cli search:160 English Songs
  • Here saavn-cli is argv[0], the script entry point
  • search:160 is argv[1], action and bitrate option, seperated by : colon as ACTION:BITRATE.
  • Action is Necessary but Bitrate is optional, 320 by default.
  • English Songs - Rest Arguments are "terms" used to query the API in search action or Links/IDs seperated by spacing in download mode

Actions

Search

To search for songs available on Saavn and download MP3 to current directory.
Syntax : saavn-cli <s/search> <query>
Argument : s or search
Bitrate can be added optionally. Example:

./saavn-cli s:160 DJ Snake

Multi Link Downloading (upcoming)

From saavn song links or IDs :

Syntax : saavn-cli download LINK1 LINK2 ID1 ID2
Argument : d or download
Bitrate can be added optionally.
Supports Multiple Links/IDs
Example :

saavn-cli download IEBQ7- DFEHNB- SJADKEi

Bitrate Settings

(Optional) To specify bitrate, pass the desired bitrate to right of : after action.
Supported Values : 320 (default), 160, 96, 48, 12
Example:

saavn-cli search:96 Magneta Riddim

Check for Updates

To check for updates, run command

saavn-cli update

Todo -

  • adding link-download support
  • fix some bugs
  • album, artist search

Footnotes

I dedicate this project to a special one. Any guess who are they ?

Anyone is free to contribute to this project, fixing bugs, optimising code, improving documentation, testing, feedback, etc.

License

Copyright © 2022 wiz64

The source code of this tool has been licensed under MIT License Read the LICENSE File for more info.

Copyright Disclaimer

I am not responsible for anything related to Third-Party copyright holders, This script comes with absolutely no warranties. Kindly use at your own risk.
We do not host or serve the Music files on our servers or accounts.

About

Command Line tool to search, download MP3 songs from Saavn Library. Open-source and High Quality Music

License:MIT License


Languages

Language:Python 100.0%