Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Latest commit

 

History

History
84 lines (56 loc) · 3.29 KB

README.md

File metadata and controls

84 lines (56 loc) · 3.29 KB

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

Usage

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

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

YouTubeUriExtractor ytEx = new YouTubeUriExtractor(this) {
    @Override
    public void onUrisAvailable(String videoId, String videoTitle, SparseArray<YtFile> ytFiles) {
        if (ytFiles != null) {
            int itag = 22;
			String downloadUrl = ytFiles.get(itag).getUrl();
        }
    }
};
    
ytEx.execute(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.

Configuration

There are 3 configuration set functions that you can use to configure the extraction before calling execute. The 2 really important ones are:

setParseDashManifest(boolean parseDashManifest) // Default: false

The dash manifest contains dash streams and usually additionally the higher quality audio formats. But the main difference is that dash streams from the dash manifest seem to not get throttled by the YouTube servers. If you don't use the dash streams at all leave it deactivated since it needs to download additional files for extraction.

setIncludeWebM(boolean includeWebM) // Default: true

This excludes the webm container format streams from the result.

Requirements

Android 4.0.3 (API version 15) 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:

  • Everything private (private videos, bought movies, ...)
  • Live streams
  • Unavailable in your country
  • RTMPE urls (very rare)

Modules

  • youtubeExtractor: The extractor android library.

  • sampleApp: A simple example downloader App.

  • advancedDownloader: A more sophisticated App using the mp4parser library to mux dash audio and video files together and add metadata to audio files after downloading. youtubeDownloader.apk

License

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