Giter Site home page Giter Site logo

android-youtubeextractor's Introduction

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.sarbagyastha:android-youtubeExtractor:v2.3.0'

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, true, true);

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 2 configuration options set via extract:

extract(youtubeLink, /*parseDashManifest*/ true, /*includeWebm*/ true);

parseDashManifest

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.

Known issue: the dash manifest can't be parsed for signature enciphered videos

includeWebm

If set to false it excludes the webm container format streams from the result.

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:

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

Modules

  • youtubeExtractor: The extractor android library.

License

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

android-youtubeextractor's People

Contributors

barisahmet avatar haarigerharald avatar jideguru avatar meoyawn avatar sarbagyastha avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

vitaliyhan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.