-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathzee5.php
74 lines (69 loc) · 3.14 KB
/
zee5.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
include 'helpers.php';
function zee5_get_feed() {
$client = new \GuzzleHttp\Client(array(
'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ),
'allow_redirects' => false,
'cookies' => true,
'verify' => false
) );
$response = $client->get("https://catalogapi.zee5.com/v1/channel/bygenre?sort_by_field=channel_number&sort_order=ASC&genres=FREE%20Channels,Hindi%20Entertainment,Hindi%20Movies,English%20Entertainment,Entertainment,Movie,News,Hindi%20News,English%20News,Marathi,Tamil,Telugu,Bengali,Malayalam,Kannada,Punjabi,Kids,Gujarati,Odiya,Music,Lifestyle,Devotional,Comedy,Drama,Sports,Infotainment&country=IN&translation=en&languages=en,hi,te");
$data = json_decode($response->getBody()->getContents(),true);
$i =0;
foreach($data['items'] as $t) {
foreach ($t['items'] as $d) {
if (!($d['id'] == "0-9-214" || $d['id'] == "0-9-channel_477236247" || $d['id'] == "0-9-210")) {
$final[$i]['id'] = "zee5:{$d['id']}";
$final[$i]['poster'] = "https://akamaividz2.zee5.com/image/upload/w_386,h_386,c_scale/resources/{$d['id']}/channel_web/{$d['list_image']}";
$final[$i]['name'] = $d['title'];
$final[$i]['description'] = $d['description'];
$metas['metas'][] = generate_meta($final[$i]);
$i++;
}
}
}
return $metas;
}
function zee5_meta($id) {
$client = new \GuzzleHttp\Client(array(
'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ),
'allow_redirects' => false,
'cookies' => true,
'verify' => false
) );
$response = $client->get("https://catalogapi.zee5.com/v1/channel/{$id}?translation=en&country=IN");
$data = json_decode($response->getBody()->getContents(),true);
$final['poster'] = "https://akamaividz2.zee5.com/image/upload/w_386,h_386,c_scale/resources/{$id}/channel_web/{$data['list_image']}";
$final['name'] = $data['title'];
$final['description'] = $data['description'];
$final['id'] = "zee5:{$id}";
return $final;
}
function zee5_get_token() {
$client = new \GuzzleHttp\Client(array(
'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ),
'allow_redirects' => false,
'cookies' => true,
'verify' => false
) );
$response = $client->get("https://gwapi.zee5.com/user/videoStreamingToken?channel_id=0-9-zing&country=IN&device_id=WebBrowser");
$data = json_decode($response->getBody()->getContents(),true);
return $data['video_token'];
}
function zee5_stream($id) {
$client = new \GuzzleHttp\Client(array(
'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ),
'allow_redirects' => false,
'cookies' => true,
'verify' => false
) );
$response = $client->get("https://catalogapi.zee5.com/v1/channel/{$id}?translation=en&country=IN");
$data = json_decode($response->getBody()->getContents(),true);
$token = zee5_get_token();
$arr = array();
$arr['name'] = $data['title'];
$arr['title'] = "zee5";
$arr['streams']['0']['url'] = "{$data['stream_url_hls']}{$token}";
$arr['streams']['0']['res'] = "Adaptive Bitrate";
return $arr;
}