Skip to content

Shellify is a terminal-based application that allows you to download and play Spotify playlists and albums directly from your terminal.

License

Notifications You must be signed in to change notification settings

sajitha-tj/shellify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shellify

 ______  __  __  ______  __      __      __  ______ __  __
/\  ___\/\ \_\ \/\  ___\/\ \    /\ \    /\ \/\  ___/\ \_\ \
\ \___  \ \  __ \ \  __\  \ \___\ \ \___\ \ \ \  __\ \____ \
 \/\_____\ \_\ \_\ \_____\ \_____\ \_____\ \_\ \_\  \/\_____\
  \/_____/\/_/\/_/\/_____/\/_____/\/_____/\/_/\/_/   \/_____/ ~v0.1.0

Shellify is a terminal-based application that allows you to download and play Spotify playlists and albums directly from your terminal. It uses various Python modules to fetch songs from Spotify, download their audio from YouTube, and play them using a built-in MP3 player. Shellify lets you enjoy spotify, without the need of the spotify app and helps you have peace of mind while listening to your favorite songs without annoying ad breaks. You need a spotify developer account to use this application.

Features

  • Download songs from Spotify playlists and albums
  • Play downloaded songs directly from the terminal
  • Save playlists for offline use
  • Metadata handling for downloaded MP3 files
  • Basic MP3 player functionality (play, next, previous, different play modes)
  • Simple CLI animations for better user experience
  • Cross-platform support (Windows, MacOS, Linux)

Requirements

  • Python 3.x
  • Spotipy
  • Eyed3
  • Pytube
  • Requests
  • FFMPEG
  • dotenv
  • pygame

Prerequisites

  • Spotify Developer Account (for API credentials). You can create one here.
  • FFMPEG installed on your system (look below for installation instructions)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/shellify.git
    cd shellify
  2. Install the required packages:

    pip install -r requirements.txt
  3. Install FFMPEG:

  4. Set up your Spotify API credentials:

    • Create a .env file in the project directory with the following content:
      CLIENT_ID=your_spotify_client_id
      CLIENT_SECRET=your_spotify_client_secret
      USER_ID=your_spotify_user_id

Usage

  1. Run the Shellify script with a Spotify playlist or album URL:

    python shellify.py -u <spotify_playlist_or_album_url>

    Use -h/--help for more information

  2. The program will start downloading the songs and playing the first track automatically. Subsequent tracks will be downloaded in the background.

  3. Control the playback using the following commands:

    • n: Play the next track
    • p: Play the previous track
    • q: Quit the player

Example

  • Download songs from a Spotify playlist/album and play them:

    python shellify.py -u <spotify_url>
  • List saved playlists:

    python shellify.py --list
  • Play all playlists with songs:

    python shellify.py --list-all
  • List all songs in a playlist (You can use the playlist number from the list command as the playlist name as well):

    python shellify.py --list -p <playlist_name>
  • Play a specific playlist (You can use the playlist number from the list command as the playlist name as well):

    python shellify.py -p <playlist_name>
  • Download songs from a playlist and save it with a custom name:

    python shellify.py -u <spotify_url> -o <playlist_name>
  • For more information:

    python shellify.py -h

Project Structure

shellify/
├── modules/
│   ├── sp_downloader.py
│   ├── mp3_player.py
│   ├── mini_cli_animator.py
│   └── test_requirements.py
├── shellify.py
├── requirements.txt
├── .env
├── LICENSE
└── README.md

Modules

sp_downloader.py

This module handles the following:

  • Fetching songs from Spotify playlists and albums
  • Fetching songs from saved playlist JSONs
  • Downloading audio from YouTube
  • Converting downloaded audio to MP3 format
  • Adding metadata to MP3 files

mp3_player.py

This module handles the MP3 player functionality:

  • Playing MP3 files
  • Handling playback controls (play, next, previous, play modes)

mini_cli_animator.py

This module can be used to add CLI animations and improve user experience. This is still a work in progress. mp3_player.py uses this module to display simple animations while playing songs.

test_requirements.py

This module is used to check if all the required packages are installed. It is used in the main script to check if the required packages are installed before running the program.

Contributing

Feel free to fork this repository and submit pull requests for any improvements or additional features. If you encounter any issues, please open an issue on the repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Spotipy - A light weight Python library for the Spotify Web API
  • Eyed3 - A Python tool for working with audio files, specifically mp3 files
  • Pytube - A lightweight, dependency-free Python library (and command-line utility) for downloading YouTube videos
  • FFMPEG - A complete, cross-platform solution to record, convert and stream audio and video
  • Pygame - A set of Python modules designed for writing video games

Enjoy using Shellify!

About

Shellify is a terminal-based application that allows you to download and play Spotify playlists and albums directly from your terminal.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages