Coder Social home page Coder Social logo

digdug101 / php-yt_downloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eyecatchup/php-yt_downloader

0.0 1.0 0.0 1.65 MB

PHP Class to download videos from YouTube.

Home Page: http://eyecatchup.github.com/php-yt_downloader/

PHP 100.00%

php-yt_downloader's Introduction

yt_downloader - PHP class to download videos from YouTube and/or convert them to mp3 audio files.

Introduction

This PHP class takes a YouTube URL (or YouTube Video-ID) and downloads the video to your computer. Optionally, you can convert any YouTube video to an MP3 Audio file (requires ffmpeg to be installed!).

UI Demo

For an example integration, try the demo:
http://eyecatchup.github.com/php-yt_downloader/index.html?vid=http://www.youtube.com/watch?v=cMMpLEGlFWE

Download

The latest stable version can be downloaded from the downloads tab, or using the following link:
https://github.com/downloads/eyecatchup/php-yt_downloader/eyecatchup-php-yt_downloader-403c053.zip

The UI demo code is available here: https://github.com/eyecatchup/php-yt_downloader/tree/gh-pages

Basic Usage

Usage is pretty straight forward:

<?php
    require('youtube-dl.class.php');
    try {
        // Instantly download a YouTube video (using the default settings).
        new yt_downloader('http://www.youtube.com/watch?v=aahOEZKTCzU', TRUE);

        // Instantly download a YouTube video as MP3 (using the default settings).
        new yt_downloader('http://www.youtube.com/watch?v=aahOEZKTCzU', TRUE, 'audio');
    }
    catch (Exception $e) {
        die($e->getMessage());
    }

You can provide either a YouTube URL (as used in the example), or a Youtube Video-ID. The class will check whether the given input value is a YouTube URL, or a YouTube Video-ID . If it's a URL, the ID will be extracted automatically. So,

new yt_downloader("http://www.youtube.com/watch?v=aahOEZKTCzU"); is identical to new yt_downloader("https://www.youtube.com/watch?feature=related&v=aahOEZKTCzU"); is identical to new yt_downloader("aahOEZKTCzU");.

For more (advanced) examples see the example-*.php files.

Configuration

Use the youtube-dl.config.php file to set your download preferences.

URL: https://github.com/eyecatchup/php-yt_downloader/
License: http://eyecatchup.mit-license.org/
(c) 2012, Stephan Schmitz [email protected]

php-yt_downloader's People

Contributors

eyecatchup avatar

Watchers

Digger avatar

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.