Youtube-dl for android

Overview

youtube-dl-android Android CI

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.

GitHub license Twitter

GitHub stars GitHub forks

Credits


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)
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

Download Example Streaming Example


Docs

  • Though not required for just using this library, documentation on building python for android can be seen here. Same for ffmpeg here.
  • youtubedl-android uses lazy extractors based build of youtube-dl (youtubedl-lazy)
Comments
  • Cannot download some videos

    Cannot download some videos

    Hello.

    Cannot download this video. https://www.youtube.com/watch?v=OUZTFpIqhVk&ab_channel=UruOfficialYouTubeChannel

    But original youtube-dl can that. Original youtube-dl was update in 2020.11.01.

    Best regards.

    opened by MimuraKyosuke 7
  • java.io.IOException Permission Denied

    java.io.IOException Permission Denied

    I always get permission denied error. I don't understand what did I do wrong

    String url = "www.youtube.com/watch?v=xxxxx"; try { VideoInfo streamInfo = YoutubeDL.getInstance().getInfo(url); System.out.println(); } catch (YoutubeDLException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); }

    com.bawaviki.youtubedl_android.YoutubeDLException: java.io.IOException: Cannot run program "/data/user/0/xxxxxx/files/youtubedl-android/packages/usr/bin/python": error=13, Permission denied

    opened by codaman 6
  • Add code for sample app

    Add code for sample app

    You show a gif of your sample app in your Readme, could you upload that code as well? Maybe in an extra repository, if you don't want to include it in this one, that would be very helpful :)

    opened by JohannesPertl 2
  • Downloading from YouTube is very slow

    Downloading from YouTube is very slow

    Downloading from YouTube has been very slow for a few days. There seems to be no problem using yt-dlp, but I'm not sure.

    https://github.com/ytdl-org/youtube-dl/issues/30097

    Can you fix it?

    opened by MimuraKyosuke 0
  • Permission denied

    Permission denied

    From android version 10.. google restricted execution of executable outsite of native lib dir. This library save python binary in data folder which is not permitted from android 10 onwards.

    To Reproduce

    • just make target sdk to 29.(from november 1st this is mandatory requirements)

    Is there any workaround available for this after targetting 29 ?

    opened by cse-ariful 1
  • Update downloads when content deleted

    Update downloads when content deleted

    I like the app thank you.

    Feature request: can you add a remove feature to remove downloads.

    Alternatively add a way to update the in app content list once downloads are manually deleted. I removed several downloads manually but they still show in the app.

    Thank you

    opened by leopard3 0
Releases(0.7.1.0)
Owner
Vikas
Vikas
Flutter Youtube View

flutter_youtube_view This plugin provides Inlining YouTube player. To interact with YouTube the library uses the Frame Player API, inside of a WebView

SpextrumSecurity 0 Dec 8, 2021
Android Stories library - Instagram-like android stories library that supports images from disk or from internet (url)

Android Stories Library Instagram like stories library for Android. Add it in your root build.gradle at the end of repositories: allprojects { reposi

Panagiotis Makris 3 Dec 20, 2022
Library for easy work with Facebook, Twitter, LinkedIn and Google on Android

THIS PROJECT IS NO LONGER MAINTAINED, FEEL FREE TO FORK AND FIX IT FOR YOUR NEEDS There is also an Android Library that is being maintained, CloudRail

Anton Krasov 1k Dec 18, 2022
Easy social network authorization for Android. Supports Facebook, Twitter, Instagram, Google+, Vkontakte. Made by Stfalcon

SocialAuthHelper A library that helps to implement social network authorization (Facebook, Twitter, Instagram, GooglePlus, Vkontakte). Who we are Need

Stfalcon LLC 97 Nov 24, 2022
Twidere for Android

Twidere for Android Material Design ready and feature rich Twitter/Mastodon/Fanfou app for Android 4.1+. Enjoy Fediverse now! Twidere-Android is maint

Twidere Project 2.7k Dec 27, 2022
A Reddit client for Android

This is a Reddit client on Android written in Java. It does not have any ads and it features clean UI and smooth browsing experience.

null 2.6k Jan 9, 2023
An unofficial open source Reddit client for Android.

RedReader An unofficial, open source Android client for Reddit. Features Free and open-source Software - no ads/tracking Lightweight and fast Swipe po

null 1.4k Jan 7, 2023
Slide is an open sourced, ad free Reddit browser for Android

Slide Slide is an open source, ad free Reddit browser for Android. It is based around the Java Reddit API Wrapper. Slide is available on the Google Pl

Carlos Crane 1.7k Dec 27, 2022
Open-source alternative Instagram client on Android.

Instagram client; previously known as InstaGrabber.

Austin Huang 1.1k Jul 23, 2021
Kickstarter for Android. Bring new ideas to life, anywhere.

Welcome to Kickstarter's open source Android app! Come on in, take your shoes off, stay a while—explore how Kickstarter's native squad has built and c

Kickstarter 5.7k Jan 2, 2023
A light Sina Weibo client for Android

BlackLight 新浪微博客户端 请注意,当前BlackLight的开发已经被冻结,直到2016年高考后重启。 The development progress has been FROZEN till June 2016. 详细介绍以及Changelog请见Play商店。 https://pl

Paper Airplane Dev Team/纸飞机开发团队 884 Nov 22, 2022
Cnblogs Client for Android - Material Design

Cotable - Yet Another Cnblogs Client for Android Description Cotable = Code + Stable (The Paradise of Coder) The Android client of Cnblogs that named

Steve Lemuel 38 Feb 12, 2022
GitHub client for Android based on the abandoned official app

ForkHub ForkHub started off as a fork of the official Android app from GitHub, and has since seen lots of improvements. You can see a comprehensive li

Jon Ander Peñalba 2.8k Dec 28, 2022
GitHub Android application

Gitskarios Beta Testing Community Forum / Discussion Join the beta here Download it from Google Play! What is Gitskarios? Gitskarios is an Android App

Gitskarios 530 Dec 19, 2022
The Google I/O Android App

Google I/O Android App 2021 Update Due to global events, Google I/O 2020 was canceled and Google I/O 2021 is an online-only event, so the companion ap

Google 21.7k Jan 7, 2023
A handy Dribbble client for Android.

Notice Gunnner has been deprecated since Dribbble API v1 has been retired on March 26, 2018. Gunnner Gunnner1 is a handy Dribbble client for Android.

Egor Neliuba 60 Feb 12, 2022
📲 Android Application to track any user activity on Github built using the Github Developers API. Used Retrofit to fetch data and MVVM Architecture.

Github Visualizer ?? Android Application to track any user activity on Github built using the Github Developers Api. A sample application to demonstra

Dheeraj Kotwani 104 Dec 28, 2022
An Android client for Pump.io

Impeller - An Android client for Pump.io What is it A client for Pump.io, intended to provide a rich, platform-integrated experience. Runs on Android

Erin 46 Nov 1, 2022
A libre lightweight streaming front-end for Android.

NewPipe A libre lightweight streaming frontend for Android. Screenshots • Description • Features • Installation and updates • Contribution • Donate •

Team NewPipe 22.4k Jan 2, 2023