forked from PRNDA/you2php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thumbnail.php
32 lines (31 loc) · 824 Bytes
/
thumbnail.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
<?php
if(!is_array($_GET)&&count($_GET)<=0){
exit();
}
header('content-type:image/jpg;');
include('./lib.php');
$vid = $_GET['vid'];
switch ($_GET['type'])
{
case "mqdefault":
$vidimg = 'https://i.ytimg.com/vi/' . $vid . '/mqdefault.jpg';
break;
case "0":
$vidimg = 'http://img.youtube.com/vi/' . $vid . '/0.jpg';
break;
case "photo":
$photo = get_channel_info($vid, APIKEY);
$vidimg = $photo['items'][0]['snippet']['thumbnails']['default']['url'];
break;
case "maxresdefault":
$vidimg = get_thumbnail_code($vid);
break;
case "banner":
$vidimg = get_banner($vid, APIKEY);
break;
default:
$vidimg = 'https://i.ytimg.com/vi/' . $vid . '/default.jpg';
}
$img = get_data($vidimg);
echo $img;
?>