Code Monkey home page Code Monkey logo

spotdl-android's Introduction

SpotDL Android

A SpotDL (python library) Android wrapper built with Kotlin

⬇️ DOWNLOAD SAMPLE APP

Download the sample app from the releases page.

Note that this app is just an example of the usage of this library. Many people asked me for new features, but I'm making a brand new app that will be fully customizable and with the ability to use custom commands along other things. This app is Spowlo. Currently it is only a Spotify mods downloader, but I'm doing a remake in a secondary branch in the same repo called "remake", where I'll be coding the new app that will have as principal functionality download songs (and also the mod downloader inside the app!). I'll keep you updated!

📣 DOCS IN PROGRESS!!

🎉 ANNOUNCEMENT: FIRST RELEASE

The library has came out, go to the releases page and see!

🔨 HOW IT WORKS

Installation

In Gradle:

  • Step 1: Add the Jitpack repository to your build.gradle file at the project level.
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}
  • Step 2: Add the two library dependencies to your build.gradle file at app/module level.
dependencies {
  implementation "com.github.BobbyESP.spotdl-android:spotdl-android-library:$spotdllib_version"  
  implementation "com.github.BobbyESP.spotdl-android:spotdl-android-ffmpeg:$spotdllib_version"
}

Note You can add an extra property in Gradle for more organization/readability. In this example, as you can see, the property for putting the version of the library in the dependency declaration is called spotdllib_version and it should look like this:

 allprojects{
    extras{
      spotdllib_version = '0.1.0'
    }
  }

Jitpack sometimes works quite bad, so if the library downloading fails, please, change the version value to -SNAPSHOT

Things that are mandatory:

  • You need to put the property android:extractNativeLibs="true" in your app's AndroidManifest.xml because the spotdl binary is already included in the library and Android can't open it without this permission.

Usage

Note Python 3.8 is already bundled in the library

  • Step 1: The first thing you have to do is to initialize the library. It's highly recommended to do it in the onCreate function in your MainActivity or Application class.
try {
 SpotDL.getInstance().init(this@App) //Replace @App by the class you're using to initiate the lib.
} catch (e: Excpetion) {
 Log.e("SpotDLExample", "An error ocurreed while trying to initiate the library: $e")
}

FFMpeg

The library won't work without FFmpeg, so for using it, you have to add the second library that was told at the very top of the README

  • You have to add to your dependecies declaration the next library:
dependencies {
  implementation "com.github.BobbyESP.spotdl-android:spotdl-android-ffmpeg:$spotdllib_version"
}

Now, you have to add this code to the last try-catch example:

FFMpeg.getInstance.init(this@App) //Same as before

Getting a final try-catch like this:

try {
 SpotDL.getInstance().init(this@App) //Replace @App by the class you're using to initiate the lib.
 FFMpeg.getInstance().init(this@App)
} catch (e: Excpetion) {
 Log.e("SpotDLExample", "An error ocurreed while trying to initiate the library: $e")
}

👷 CREDITS

  • SpotDL for it's amazing python library for downloading any song/album from Spotify!

  • xnetcat for helping me understand some parts/commands of Linux (XD), fix some bugs of this wrapper and for giving us all the files and binaries needed for working!

  • JunkFood02 for helping me fix some bugs and explain me some code and functionality of the youtubedl-android library (in which this library is a little based on) and explaining me the storage framework of Android.

  • youtubedl-android for some parts of the code of the library aswell as the inspiration for making this library (I really wanted to learn how to do one!)

⚖️ LICENSE

This project is under the MIT License, the same as SpotDL uses.

spotdl-android's People

Contributors

bobbyesp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spotdl-android's Issues

Lrc

Any plans to embed lrc. Synced lyrics

[Bug report] Python isn't able to open spotdl binary because of Non-UTF-8 characters.

When trying to do a request to the library, the log throws the next error:

Stderr:   File "/data/user/0/com.bobbyesp.spotdl_android/no_backup/spotdl-android/spotdl/spotdl", line 1
          SyntaxError: Non-UTF-8 code starting with '\xf9' in file /data/user/0/com.bobbyesp.spotdl_android/no_backup/spotdl-android/spotdl/spotdl on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Help is needed!!

F-Droid inclusion

Hello, would you consider publishing thus app on F-Droid please ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.