youtubedl-android

Android library wrapper for youtube-dl executable

Credits


Sample app

Debug apk for testing can be downloaded from the releases page

Download Example Streaming Example

Checkout dvd, a video downloader app based on this library.

dvd

Installation

Gradle

Step 1 : Add jitpack repository to your project build file

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Step 2: Add the dependency

dependencies {
    implementation 'com.github.yausername.youtubedl-android:library:0.11.+'
}

Optional FFmpeg dependency can also be added

dependencies {
    implementation 'com.github.yausername.youtubedl-android:library:0.11.+'
    implementation 'com.github.yausername.youtubedl-android:ffmpeg:0.11.+'
}



Usage

try {
    YoutubeDL.getInstance().init(getApplication());
} catch (YoutubeDLException e) {
    Log.e(TAG, "failed to initialize youtubedl-android", e);
}

FFmpeg

If you wish to use ffmpeg features of youtube-dl (e.g. --extract-audio), include and initialize the ffmpeg library.

try {
    YoutubeDL.getInstance().init(getApplication());
    FFmpeg.getInstance().init(getApplication());
} catch (YoutubeDLException e) {
    Log.e(TAG, "failed to initialize youtubedl-android", e);
}

Docs