-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathwebtor_player.php
118 lines (111 loc) · 4.48 KB
/
webtor_player.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
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
<?php
if (isset($_GET['magnet_uri']) && !empty($_GET['magnet_uri'])) { $magnet_uri = $_GET["magnet_uri"]; $images_uri = $_GET["images_uri"]; $images_uri = 'load_page.php?images='.$images_uri; }
else { //die($magnet_uri_placeolder);
$style = ' <style>
@import url("https://fonts.googleapis.com/css?family=Quicksand&display=swap");
.background{
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
background-color:#1e88e5;
text-align:center;
font-family: "Quicksand", sans-serif;
color:white;
}
.inputText{
width:80%;
margin:20px;
padding:10px;
border:0px;
background-color:white;
color: #1e88e5;
border-radius:5px;
font-size:32px;
}
.submitbox{
width:10%;
margin:20px;
padding:10px;
border:0px;
background-color:white;
color: #1e88e5;
border-radius:5px;
font-size:32px;
}
.inputText:focus{
outline:none;
box-shadow: none;
}
::placeholder{
font-weight: italic;
color:crimson;
}
.inputText:hover{
/* box-shadow: 0px 0px 2px 2px gainsboro; */
cursor:pointer;
}
</style>';
$html = '<div class="background">
<h1>Magnet Player</h1>
<small>Using webtor</small>
<!-- Input tag -->
<br>
<form action="?">
<input type="text" class="inputText" id="magnet_uri" name="magnet_uri" placeholder="Enter Magnet Link"><br>
<input type="submit" class="submitbox" value="Play">
</form>
<h4>@2020</h4>
</div>';
die($style.$html);
}
?>
<!doctype html>
<html>
<head>
<title>Yify Player</title>
<style>
#player {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
body {
position: relative;
height: 100vh;
background-color: gray;
}
</style>
</head>
<body>
<div id="player" class="webtor" />
<script>
window.webtor = window.webtor || [];
window.webtor.push({
id: 'player',
magnet: '<?php echo $magnet_uri; ?>&dn=Player&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F',
on: function(e) {
if (e.name == window.webtor.TORRENT_FETCHED) {
console.log('Torrent fetched!')
}
if (e.name == window.webtor.TORRENT_ERROR) {
console.log('Torrent error!')
}
},
poster: '<?php echo $images_uri; ?>',
// subtitles: [
// {
// srclang: 'en',
// label: 'test',
// src: 'https://raw.githubusercontent.com/andreyvit/subtitle-tools/master/sample.srt',
// }
// ],
});
</script>
<script src="webtor_min.js" charset="utf-8"></script>
</body>
</html>