Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sajitha-tj committed Jun 15, 2024
1 parent b092bee commit 583d2c6
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 10 deletions.
76 changes: 70 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# 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. You can create one [here](https://developer.spotify.com).
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 as JSON files
- 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

Expand All @@ -20,9 +30,13 @@ You need a spotify developer account to use this application. You can create one
- Requests
- FFMPEG
- dotenv
- argparse
- pygame

## Prerequisites

- Spotify Developer Account (for API credentials). You can create one [here](https://developer.spotify.com).
- FFMPEG installed on your system (look below for installation instructions)

## Installation

1. Clone the repository:
Expand Down Expand Up @@ -76,17 +90,63 @@ You need a spotify developer account to use this application. You can create one
- `p`: Play the previous track
- `q`: Quit the player

## Example

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

```bash
python shellify.py -u <spotify_url>
```

- List saved playlists:

```bash
python shellify.py --list
```

- Play all playlists with songs:

```bash
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):

```bash
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):

```bash
python shellify.py -p <playlist_name>
```

- Download songs from a playlist and save it with a custom name:

```bash
python shellify.py -u <spotify_url> -o <playlist_name>
```

- For more information:

```bash
python shellify.py -h
```

## Project Structure

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

Expand All @@ -111,7 +171,11 @@ This module handles the MP3 player functionality:

#### `mini_cli_animator.py`

This module can be used to add CLI animations and improve user experience. This still work in progress. mp3_player.py uses this module to display a simple animation while playing songs.
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

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ eyed3
pytube
requests
python-dotenv
argparse
pygame
19 changes: 16 additions & 3 deletions shellify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from dotenv import load_dotenv
import argparse
import time
import threading
from modules.sp_downloader import Sp_downloader
from modules.mp3_player import Mp3Player
from modules.mini_cli_animator import Mini_cli_animator
import threading

from modules.test_requirements import TestRequirements

def get_playlist_from_url(playlist_url:str, spd: Sp_downloader):
# download the playlist from spotify
Expand Down Expand Up @@ -101,7 +101,7 @@ def cli_display(mp3Player: Mp3Player, animater: Mini_cli_animator, playlist):
/\ ___\/\ \_\ \/\ ___\/\ \ /\ \ /\ \/\ ___/\ \_\ \
\ \___ \ \ __ \ \ __\ \ \___\ \ \___\ \ \ \ __\ \____ \
\/\_____\ \_\ \_\ \_____\ \_____\ \_____\ \_\ \_\ \/\_____\
\/_____/\/_/\/_/\/_____/\/_____/\/_____/\/_/\/_/ \/_____/ ~v1.0
\/_____/\/_/\/_/\/_____/\/_____/\/_____/\/_/\/_/ \/_____/ ~v0.1.0
"""
print(banner)

Expand All @@ -111,10 +111,23 @@ def cli_display(mp3Player: Mp3Player, animater: Mini_cli_animator, playlist):
client_secret = os.getenv('CLIENT_SECRET')
user_id = os.getenv('USER_ID')

# check if spotify credentials are present in .env
if not client_id or not client_secret or not user_id:
print("[!] Shellify needs spotify developer credentials on a '.env' to work. You can create a spotify developer account at https://developer.spotify.com \n[!]Check the README for more info.")
sys.exit(1)

# test if all requirements are satisfied
requirements_result, requirements_message = TestRequirements().test_requirements()
if requirements_result == False:
print(f"[!] Requirements not satisfied. {requirements_message} \n[!] Please install the requirements using 'pip install -r requirements.txt'")
sys.exit(1)

# test if ffmpeg is installed
ffmpeg_result, ffmpeg_message = TestRequirements().test_ffmpeg()
if ffmpeg_result == False:
print(f"[!] ffmpeg is not installed. \n[!] Please install ffmpeg from https://ffmpeg.org/download.html \n[!]Check the README for more info.")
sys.exit(1)

# argument parser
usage_msg = "Shellify is a terminal-based application that allows you to download and play Spotify playlists and albums directly from your terminal. 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."
parser = argparse.ArgumentParser(description=usage_msg)
Expand Down

0 comments on commit 583d2c6

Please sign in to comment.