PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
  Classes of Kapil Sharma  >  PHP Youtube to MP3 Converter  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: This is the main file.
Class: PHP Youtube to MP3 Converter
Download YouTube videos in MP3 audio format
Author: By
Last change: Update of index.php
Date: 1 year ago
Size: 754 bytes
 

Contents

Class file image Download
<?php
 
// calling class

require_once('api_class.php');

// Creating object
 
$object = new ytapi();

// YOUTUBE VIDEO ID
 
$response = $object->fetch('lF-jPBnZ098');

// To print array response
  //print_r($response);

        // FOR DIRECT HTML LINK
       
if(isset($response['data']['html'])) {
         echo
$response['data']['html'];
        }

       
// FOR A HREF LINK
       
if(isset($response['data']['link'])) {
         echo
$response['data']['link'];
        }

       
// FOR JAVASCRIPT EMBED CODE
       
if(isset($response['data']['js'])) {
         echo
$response['data']['js'];
        }

       
// FOR IFRAME LINK EMBED CODE
       
if(isset($response['data']['iframe'])) {
         echo
$response['data']['iframe'];
        }
?>