-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmany.php
51 lines (34 loc) · 1.07 KB
/
many.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
// Calling class
require_once('api_class.php');
// Creating object
$object = new ytapi();
// MULTIPLE YOUTUBE VIDEO ID's SEPARATED BY COMMNA (,)
$ids = 'lF-jPBnZ098,OmAlu5T44t8,GTJHrHHAElU';
$response = $object->fetch($ids);
// To print array response
//print_r($response);
foreach($response as $div) {
echo '<center>Youtube to MP3 Link for: <b>'.$div['video_id'].' video id</b></center><br>';
// FOR DIRECT HTML LINK
if(isset($div['html'])) {
echo "HTML LINK: " . $div['html'] . "<br/>";
}
echo "<br><hr><br>";
// FOR A HREF LINK
if(isset($div['link'])) {
echo "A HREF LINK: " . $div['link'] . "<br/>";
}
echo "<br><hr><br>";
// FOR JAVASCRIPT EMBED CODE
if(isset($div['js'])) {
echo "JS Embed code: " . $div['js'] . "<br/>";
}
echo "<br><hr><br>";
// FOR IFRAME EMBED CODE
if(isset($div['iframe'])) {
echo "Iframe Embed code: " . $div['iframe'] . "<br/>";
}
echo "<br><hr><br>";
}
?>