-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwatch.php
More file actions
339 lines (308 loc) · 16 KB
/
watch.php
File metadata and controls
339 lines (308 loc) · 16 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<?php
$type = 'anime';
$anime_id = '238';
$episode = '1';
$numEpisodes = '1';
$anime_title = 'TSI';
if(isset($_GET['id']))
{
$anime_id = $_GET['id'];
$episode = $_GET['episode'];
$numEpisodes = $_GET['tot_eps'];
$anime_title = $_GET['title'];
}
include('config.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.0">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="iGodMan">
<meta name="authorUrl" content="#">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/app.css">
<link rel="icon" type="image/x-icon" href="assets/img/icon.png">
<title>Watch Online <?php echo $anime_title.' Episode '.$episode; ?> in English Japanes For Free | TSIAnime | Toonsouthindia.com</title>
</head>
<style>
#summary{
max-height:200px;
overflow: auto;
}
.episode-btn.active{
background-color: #1c1b1b;
}
.more-episodes-list{
max-height: 400px;
overflow:auto;
}
.section_heading
{
border-radius: 10px;
padding: 6px 4px 4px 20px;
}
.section_heading span img{
width: 40px;
position: absolute;
margin-left: -20px;
margin-top: -26px;
}
.section_heading h5{
padding-left:20px;
}
</style>
<body>
<div class="bg-opacity">
<div class="my-5 container">
<?php include('header.php');?>
<div class="col-12 py-3 text-center">
<div class="header-title py-3">
<h2>
Watch <span class="title"><?php echo $anime_title; ?></span> Episode <?php echo $episode;?>
</h2>
</div>
<div class="row pb-2">
<div class="col-lg-3 col-3 text-start download_btn">
</div>
<div class="col-lg-9 col-9 text-end">
<span class="text-danger">
Please Wait 5 sec for Player Loading.
</span>
</div>
<!-- <div class="col-lg-2 col-4 text-end">
<select name="" id="" class="form-control">
<option disabled selected>Change Server</option>
<option value="1">Server 1</option>
<option value="2">Server 2</option>
</select>
</div> -->
</div>
<div class="video-frame">
<iframe src="https:\/\/database.gdriveplayer.us\/player.php?type=anime&id=<?php echo $anime_id;?>&episode=<?php echo $episode;?>" allowFullScreen="true" frameborder="0" width="100%" height="320" webkitallowfullscreen mozallowfullscreen></iframe>
</div>
<div class="col-12 py-3">
<span>Change Server : </span>
<button class="btn btn-warning btn-sm tsi_server1" disabled>Server 1</button>
<button class="btn btn-danger btn-sm tsi_server2">Server 2</button>
</div>
<div class="tag-msg pt-2 row">
<div class="col-3 text-start">
<?php
if($episode != '1')
{
$prevEp = $episode-1;
echo '<a href="watch.php?id='.$anime_id.'&episode='.$prevEp.'&tot_eps='.$numEpisodes.'" class="btn btn-danger btn-sm"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-left-fill" viewBox="0 0 16 16">
<path d="m3.86 8.753 5.482 4.796c.646.566 1.658.106 1.658-.753V3.204a1 1 0 0 0-1.659-.753l-5.48 4.796a1 1 0 0 0 0 1.506z"/>
</svg></a>';
}
?>
</div>
<div class="col-6 text-center">
<p class="text-warning">You're Watching Episode <?php echo $episode;?></p>
</div>
<div class="col-3 text-end">
<?php
if($episode != $numEpisodes)
{
$nxtEp = $episode+1;
echo '<a href="watch.php?id='.$anime_id.'&episode='.$nxtEp.'&tot_eps='.$numEpisodes.'" class="btn btn-danger btn-sm"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-right-fill" viewBox="0 0 16 16">
<path d="m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z"/>
</svg></a>';
}
?>
</div>
</div>
</div>
<div class="col-12 bg-secondary section_heading my-3">
<span><img src="assets/img/luffy.png" alt=""></span>
<h5>Anime Info</h5>
</div>
<div class="row pt-3">
<div class="col-lg-4 text-center">
<div class="poster" id="poster">
<div class="img" height="200"></div>
</div>
<!-- <div class="watch-btn pt-2">
<input type="btn" name="" id="watch" class="btn btn-danger" value="Watch Episode">
</div> -->
</div>
<div class="col-lg-8">
<table class="table table-borderless text-white mt-3">
<tbody>
<tr>
<th>Series Title</th>
<td>:</td>
<td class="title" id="title"></td>
</tr>
<tr>
<th>Genre</th>
<td>:</td>
<td id="genre"></td>
</tr>
<tr>
<th>Total Episode</th>
<td>:</td>
<td id="total_episode">
</td>
<input type="text" name="" id="tot_eps" hidden>
</tr>
<tr>
<th>Status</th>
<td>:</td>
<td id="status"></td>
</tr>
<tr>
<th>Type</th>
<td>:</td>
<td id="type"></td>
</tr>
<tr>
<th>Summary</th>
<td>:</td>
<td id="summary"></td>
</tr>
<tr>
<th>Sub</th>
<td>:</td>
<td id="sub"></td>
</tr>
<tr>
<th>Views</th>
<td>:</td>
<td id="views">
<?php
$sql = mysqli_query($conn, "SELECT * FROM episode_views_data WHERE anime_id = '$anime_id' AND episode_number = '$episode'");
if($view = mysqli_fetch_assoc($sql))
{
echo $view['views'];
}
else{echo '1';}
?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-12 bg-secondary section_heading my-3">
<span><img src="assets/img/zoro.png" alt=""></span>
<h5>Episodes List</h5>
</div>
<div class="col-12">
<div class="more-episodes-list">
<?php
for ($i = 1; $i <= $numEpisodes; $i++) {
$episodeNumber = str_pad($i, 2, "0", STR_PAD_LEFT); // Pad single-digit numbers with leading zero
$activeClass = ($i == $episode) ? "active" : "";
$episodeButton = '<a href="watch.php?id='.$anime_id.'&episode='.$i.'&tot_eps='.$numEpisodes.'&title='.$anime_title.'" class="m-1 episode-btn btn btn-danger '.$activeClass.'">E'.$episodeNumber.'</a>';
echo $episodeButton;
}
?>
</div>
</div>
</div>
<?php include('footer.php');?>
<input type="text" name="" id="title_input" hidden>
</div>
</div>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/jquery.min.js"></script>
<script>
$(document).ready(function () {
var anime_id = '<?php echo $anime_id; ?>';
$.getJSON('https://api.gdriveplayer.us/v1/animes/id/' + anime_id,
function (data) {
var title = data[0].title;
$("#poster").html('<img src="'+ data[0].poster +'" width="200" class="Tamilanime_poster">');
$(".title").html(data[0].title);
$("#genre").html(data[0].genre);
$("#total_episode").html(data[0].total_episode);
$("#status").html(data[0].status);
$("#type").html(data[0].type);
$("#summary").html('<p style="max-height:80px; overflow:auto;">'+data[0].summary+'</p>');
$("#sub").html(data[0].sub);
$("#tot_eps").val(data[0].total_episode);
$("#title_input").val(data[0].title);
window.title_in = title;
}).then(function(){
var link = '<?php $link = $anime_title.'-episode-'.$episode;
$strrrepl = str_replace([' ', '(', ')'], ['-', '', ''], $link);
echo $strrrepl; ?>';
window.link_i = link;
var fd = new FormData();
fd.append('link', link);
$.ajax({
url: 'ajax/get-episode-download-id.php',
data: fd,
type:'post',
contentType: false,
processData: false,
success: function (response)
{
console.log(response);
data = JSON.parse(response);
if(data.status == 'Ok'){
$('.download_btn').html(`<a href="https://gotaku1.com/download?id=${data.id}&typesub=TSI_Anime&title=${link}" style="cursor:pointer;" target="_blank">
<button class="btn btn-danger btn-sm">
Download
</button>
</a>`);
$(".tsi_server2").attr('data-gogoID', data.id);
}
else
{
$('.download_btn').html(`
<button class="btn btn-danger btn-sm" disabled>
No Download Option
</button>
`);
$(".tsi_server2").addClass('d-none');
}
}
});
}).then(function(){
var anime_title = window.title_in;
var views = $("#views").html();
var episode_number = '<?php echo $episode;?>';
var fd = new FormData();
fd.append('anime_id', anime_id);
fd.append('anime_title', anime_title);
fd.append('episode_number', episode_number);
fd.append('views', views);
$.ajax({
url: 'ajax/views.php',
data: fd,
type:'post',
contentType: false,
processData: false,
success: function (response)
{
console.log(response);
}
});
})
$('body').on('click', '.tsi_server2', function(){
console.log('test');
var gogoID = $(this).attr('data-gogoID');
console.log(gogoID);
var link = window.link_i;
$(".video-frame").html(`
<iframe src="https://gotaku1.com/streaming.php?id=`+ gogoID +`&typesub=TSI_Anime&title=`+ link +`" allowFullScreen="true" frameborder="0" width="100%" webkitallowfullscreen mozallowfullscreen></iframe>
`);
$('.tsi_server2').removeClass('btn-danger').addClass('btn-warning').prop('disabled', true);
$('.tsi_server1').removeClass('btn-wrning').addClass('btn-danger').prop('disabled', false);
});
$('body').on('click', '.tsi_server1', function(){
$(".video-frame").html(`
<iframe src="https:\/\/database.gdriveplayer.us\/player.php?type=anime&id=<?php echo $anime_id;?>&episode=<?php echo $episode;?>" allowFullScreen="true" frameborder="0" width="100%" height="320" webkitallowfullscreen mozallowfullscreen></iframe>
`);
$('.tsi_server1').removeClass('btn-danger').addClass('btn-warning').prop('disabled', true);
$('.tsi_server2').removeClass('btn-wrning').addClass('btn-danger').prop('disabled', false);
});
})
</script>
</body>
</html>