Skip to content

SpotHack is a project where you can convert your Spotify Playlists to .mp3 files in the respective folder. Download your favorites musics and playlists to listen when you are offline 🎧🎧

License

Notifications You must be signed in to change notification settings

Darguima/SpotHack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SpotHack

SpotHack is a project where you can convert your Spotify Playlists to .mp3 files in the respective folder. Download your favorites musics and playlists to listen when you are offline. SpotHack is also an open-source project so is possible anyone help since reporting bugs, writing code, documentation, giving ideas or just checking the homepage.

⭐ Don't forget to Starring ⭐

SpotHack


Table of Contents πŸ—ƒοΈ

Download & Installation πŸ“₯πŸ“²

You can download this App in the Releases or build the code with some changes that you may want.

How it works? βš™βš™

After you select your music or playlist our Download Machine will, with the YouTube Scraper or the YouTube API, search for the music video, with the query starting with the artists name followed by the track name. Once we get the YouTube ID we can download the music video and convert it to .mp3 with ffmpeg.

Getting Started πŸš€

Prerequisites

  • Git to clone the repository;

  • Yarn to install dependencies;

  • For run the project you will need the React Native Environment configured. You can follow the ReactNative Official Documentation;

Note: This project was only tested and developed for Android, so I don't know if it works properly in IOS. Is recommended that you run it in an Android Phone;
Cloning
$ git clone https://github.com/Darguima/SpotHack.git
Installing Dependencies
$ yarn
Set credentials for third-party APIs πŸͺͺ

This App use 2 third-party APIs:

  • Spotify Api (Web Api)
  • Youtube Api (YouTube Data API v3)

You can save this credentials in a .env file or input them directly on the App. To get the required credentials you can follow our tutorial.

Setup πŸ› οΈ

  • To setup the application you can use:
yarn start
yarn android

At this moment you should have a Android Emulator with SpotHack running

Building the APK

Generate a KeyStore πŸ”‘

Fill in the required inputs (and remember the password):

$ keytool -genkey -v -keystore android/app/spothack.keystore -alias spothack -keyalg RSA -keysize 2048 -validity 10000

Edit the gradle ✏️

Edit the file android/app/build.gradle, changing storePassword and keyPassword to the previous password.

Assemble πŸ§‘β€πŸ­

cd android
./gradlew assembleRelease
Based on this tutorial.

API CredentialsπŸͺͺ

For store the credentials you can create a file .env with the next structure or you can input the credentials directly in the App, on Login Screen.

SPOTIFY_CLIENT_ID= ...
SPOTIFY_CLIENT_SECRET= ...
YOUTUBE_API_KEY= ...

Spotify

As the entire App is based on Spotify's repertoire, it is required have access to their API, or in others words: a Client Id and a Client Secret. To get this tokens you can follow the next tutorial:

  1. Access the Spotify Developer Dashboard.

  2. Login with any Spotify Account.

  3. Click on Create App (name of your choice).

  4. Edit the Settings - add com.darguima.spothack://oauthredirect to Redirect URIs

  5. Go to Users and Access > Add new user and fill in with your users accounts.

  6. Now you are able to copy the Client ID and the Client Secret

spotifyCredentails.mp4

YouTube

Unlike Spotify, YouTube API is not essential for the App flow, so you can omit this key without problems, but if for some reason the YouTube Scrape Server is not working, this can be a plan B for Music Download. To get the API Key is a little more complicated than Spotify; Follow the next steps:

  1. Access the Google Cloud Platform Console.

  2. Login with any Google Account.

  3. Click on Select a Project > New Project.

  4. Create a project with a name of your choice and Select it.

  5. Select in Navigation Menu > APIs and services > Library

  6. Search and Enable YouTube Data API v3

  7. Go to OAuth consent Screen and select External > Create, then fill in the required inputs and continue to the end.

  8. Go to Credentials and click Create Credentials > API key. Now you can copy the key!

YoutubeCredentials.mp4

Pages/Features πŸ“š

Login Page

  • Enter your APIs tokens (if not configured on APK building).
  • Login !!

Home Page

  • Shortcuts to "Outdated Playlists", "Downloads Manager", "Settings Page" and others ...

Search Pages

  • Search for your favorite musics and playlists.
  • Download them !!

Download Page

  • Follow the download status of your musics.
  • Know about the errors.

Settings Page

  • Change the "Root Path", "Download Default Source", "Music Time Limit", and the Render Mode.

Outdate Playlist Page

  • Follow your playlist Status.
  • Download the news musics.
  • Delete the old ones.

Add Playlist Page

  • Reference a Playlist to a folder, if we can't do it.

Technologies Used πŸ’»


🚨 Disclaimer 🚨

This project can be considered a piracy service to download music. No source code here was used in production, nor was it ever used with the idea of making money. I only disposed of the code as open source because this is a study project. If you want to use it as a service, use it at your own risk, but remember that artists and publishers are likely to own the downloaded music.

License πŸ‘¨πŸΎβ€βš–οΈ

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

About

SpotHack is a project where you can convert your Spotify Playlists to .mp3 files in the respective folder. Download your favorites musics and playlists to listen when you are offline 🎧🎧

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published