HaarigerHarald / android-youtubeExtractor

Deprecated: Android based YouTube URL extractor and downloader
Other
877 stars 304 forks source link

Android based YouTube url extractor

These are the urls to the YouTube video or audio files, so you can stream or download them. It features an age verification circumvention and a signature deciphering method (mainly for vevo videos).

Gradle

To always build from the latest commit with all updates. Add the JitPack repository:

repositories {
    maven { url "https://jitpack.io" }
}

And the dependency:

implementation 'com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT'

Usage

It's build around an AsyncTask. Called from an Activity you can write:

String youtubeLink = "http://youtube.com/watch?v=xxxx";

new YouTubeExtractor(this) {
    @Override
    public void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta vMeta) {
        if (ytFiles != null) {
            int itag = 22;
        String downloadUrl = ytFiles.get(itag).getUrl();
        }
    }
}.extract(youtubeLink);

The ytFiles SparseArray is a map of available media files for one YouTube video, accessible by their itag value. For further infos about itags and their associated formats refer to: Wikipedia - YouTube Quality and formats.

Requirements

Android 4.0 (API version 14) and up for Webview Javascript execution see: js-evaluator-for-android. Not signature enciphered Videos may work on lower Android versions (untested).

Limitations

Those videos aren't working:

Modules

License

Modified BSD license see LICENSE and 3rd party licenses depending on what you need