forked from 9inevolt/OverRustle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchannel.php
More file actions
175 lines (148 loc) · 7.63 KB
/
Copy pathchannel.php
File metadata and controls
175 lines (148 loc) · 7.63 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
require_once 'vendor/autoload.php';
require_once 'config.php';
require_once 'helpers.php';
require_once 'session.php';
$redis = new Predis\Client($config['redis']);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (empty($_POST['service']) || empty($_POST['stream'])) {
header('HTTP/1.1 400 Bad Request');
die('Invalid input');
}
if (isset($_SESSION['user'])) {
$user = $_SESSION['user'];
$channel = array( 'service' => sanitize($_POST['service']), 'stream' => sanitize($_POST['stream']) );
$redis->hmset('channel:'.$user['name'], $channel);
header('Location: /channel?user='.$user['name']);
die();
} else {
header('HTTP/1.1 401 Unauthorized');
die('Unauthorized');
}
} else {
if (empty($_GET['user'])) {
header('HTTP/1.1 400 Bad Request');
die('User must be specified');
}
$user = $redis->hgetall('user:'.$_GET['user']);
$channel = $redis->hgetall('channel:'.$_GET['user']);
if (empty($user) || empty($channel)) {
header('HTTP/1.1 404 Not Found');
die('Channel not found');
}
}
$s = $channel['service'];
$stream = $channel['stream'];
//handle stream blacklists even in channels
require_once 'blacklist.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Watch streams and videos with destiny.gg!">
<link rel="icon" href="favicon.ico">
<title>OverRustle - <?php echo $user['name'] ?></title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/overrustle.css" rel="stylesheet">
<script src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="//api.OverRustle.com/socket.io/socket.io.js"></script>
<script type="text/javascript" src="//api.OverRustle.com/strims.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-49711133-1', 'overrustle.com');
ga('send', 'pageview');
</script>
</head>
<body>
<?php include 'navbar.php' ?>
<div class="container-full fill">
<div class="pull-left stream-box" id="map">
<?php
switch($s)
{
case "twitch":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.twitch.tv/' . $stream . '/embed" scrolling="no"></iframe>';
break;
case "twitch-vod":
echo "
<object data='http://www.twitch.tv/widgets/archive_embed_player.swf' id='clip_embed_player_flash' type='application/x-shockwave-flash' width='100%' height='100%'>
<param name='movie' value='http://www.twitch.tv/widgets/archive_embed_player.swf' />
<param name='allowScriptAccess' value='always' />
<param name='allowNetworking' value='all' />
<param name='allowFullScreen' value='true' />
<param name='flashvars' value='initial_time=" . $t . "&start_volume=25&auto_play=true&archive_id=" . $stream . "' />
</object>";
break;
case "advanced":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="' . $stream . '" scrolling="yes"></iframe>';
break;
case "castamp":
if (strlen(strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox')) > 0)
{
echo '<script type="text/javascript"> channel="' . $stream . '"; vwidth="1280"; vheight="720";</script><script type="text/javascript" src="http://castamp.com/embed.js"></script>';
}
else
{
echo '<script type="text/javascript"> channel="' . $stream . '";</script><script type="text/javascript" src="js/castamp.js"></script>';
}
break;
case "hitbox":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.hitbox.tv/embed/' . $stream . '?autoplay=true" scrolling="no"></iframe>';
break; //stop fucking asking, I'm not going to add azubu TV. It's shit and so are you for thinking about it
case "youtube":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.youtube.com/embed/' . $stream . '?autoplay=1&start=' . $t . '" scrolling="no"></iframe>';
break;
case "youtube-playlist":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.youtube.com/embed/videoseries?list=' . $stream . '&autoplay=1&start=' . $t . '" scrolling="no"></iframe>';
break;
case "mlg":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.teamliquid.net/video/streams/' . $stream . '/popout" scrolling="no"></iframe>';
break;
case "ustream":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.ustream.tv/embed/' . $stream . '?v=3&wmode=direct&autoplay=true" scrolling="no"></iframe>';
break;
case "dailymotion":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.dailymotion.com/embed/video/' . $stream . '" scrolling="no"></iframe>';
break;
case "azubu":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://www.azubu.tv/azubulink/embed=' . $stream . '" scrolling="no"></iframe>';
break;
case "picarto":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="https://www.picarto.tv/live/playerpopout.php?popit=' . $stream . '&off=1&token=undefined" scrolling="no"></iframe>';
break;
case "chaturbate":
echo '<iframe width="100%" height="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://chaturbate.com/affiliates/in/SHBY/xlKAe/?track=embed&room=' . $stream . '&bgcolor=white"></iframe>';
break;
case "strims":
include('strims_content.php');
}
?>
</div>
<div class="pull-right" id="map" style="width: 390px;">
<div class="tab-content" style="height: 100%;">
<div class="tab-pane fade active in" id="destinychat" style="height: 100%;">
<iframe width="100%" marginheight="0" marginwidth="0" frameborder="0" src="http://destiny.gg/embed/chat" scrolling="no" style="height: 100%;"></iframe>
</div>
<?php if ($config['chat_enable']): ?>
<div class="tab-pane fade" id="otherchat" style="height: 100%;">
<?php include 'chat.php' ?>
</div>
<?php endif ?>
</div>
</div>
</div>
<script src="js/bootstrap.min.js"></script>
<script src="js/overrustle.js"></script>
</body>
</html>