Description
Android library wrapper for youtube-dl executable. Based on yausername's youtubedl-android but with ability to download binary files at runtime to decrease apk size.
youtube-dl-android alternatives and similar packages
Based on the "SocialNetworks" category.
Alternatively, view youtube-dl-android alternatives based on common mentions on social networks and blogs.
-
StatusStories
Status Stories = Snapchat stories, Instagram stories, Whatsapp Statuses, Facebook Messenger Stories. -
SocialAuthHelper
Easy social network authorization for Android. Supports Facebook, Twitter, Instagram, Google+, Vkontakte. Made by Stfalcon
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of youtube-dl-android or a related project?
README
youtube-dl-android 
Android library wrapper for youtube-dl executable. Based on yausername's youtubedl-android but with ability to download binary files at runtime to decrease apk size.
Credits
- youtubedl-java by sapher, youtubedl-android adds android compatibility to youtubedl-java.
- youtubedl-android by yausername, youtube-dl-android adds ondemand library files download compatibility to youtubedl-android.
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.bawaviki.youtube-dl-android:library:0.7.+'
}
Optional FFmpeg dependency can also be added
dependencies {
implementation 'com.github.bawaviki.youtube-dl-android:library:0.7.+'
implementation 'com.github.bawaviki.youtube-dl-android:ffmpeg:0.7.+'
}
Usage
- youtube-dl executable and python 3.7 are bundled in the library.
- Initialize library, preferably in
onCreate
.
try {
YoutubeDL.getInstance().init(getApplication(),this);
} catch (YoutubeDLException e) {
Log.e(TAG, "failed to initialize youtubedl-android", e);
}
Downloading / custom command (A detailed example can be found in the [sample app](app/src/main/java/com/bawaviki/youtubedl_android_example/DownloadingExampleActivity.java))
File youtubeDLDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "youtubedl-android"); YoutubeDLRequest request = new YoutubeDLRequest("https://vimeo.com/22439234"); request.setOption("-o", youtubeDLDir.getAbsolutePath() + "/%(title)s.%(ext)s"); YoutubeDL.getInstance().execute(request, (progress, etaInSeconds) -> { System.out.println(String.valueOf(progress) + "% (ETA " + String.valueOf(etaInSeconds) + " seconds)"); });
Get stream info (equivalent to
--dump-json
of youtube-dl)VideoInfo streamInfo = YoutubeDL.getInstance().getInfo("https://vimeo.com/22439234"); System.out.println(streamInfo.getTitle());
Get Playlist info (equivalent to
--dump-single-json
of youtube-dl)PlaylistInfo playlistInfo = YoutubeDL.getInstance().getPlaylistInfo("https://www.youtube.com/playlist?list=PLpuxPG4TUOR4N78vlcDHu46hM1LDrz8Lw"); System.out.println(playlistInfo.Id());
youtube-dl supports myriad different options which be seen here
youtube-dl binary can be updated from within the library
YoutubeDL.getInstance().updateYoutubeDL(getApplication());
FFmpeg
If you wish to use ffmpeg features of youtube-dl (e.g. --extract-audio), include and initialize the ffmpeg library(you only need to Initialize FFmpeg library youtube-dl already initialize in this).
try {
FFmpeg.getInstance().init(getApplication(),this);
} catch (YoutubeDLException e) {
Log.e(TAG, "failed to initialize ffmpeg", e);
}
Sample app
Docs
- Though not required for just using this library, documentation on building python for android can be seen [here](BUILD_PYTHON.md). Same for ffmpeg [here](BUILD_FFMPEG.md).
- youtubedl-android uses lazy extractors based build of youtube-dl (youtubedl-lazy)
*Note that all licence references and agreements mentioned in the youtube-dl-android README section above
are relevant to that project's source code only.