-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathgenerator.html
90 lines (79 loc) · 3.29 KB
/
generator.html
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
<!doctype html>
<html lang="en">
<head>
<title>IPTV Bouquet Install Generator</title>
<style>
h1 {
font-size: 1.5em
}
input, button {
min-width: 200px;
min-height: 36px;
border: 1px solid grey;
padding: 3px;
}
button {
min-width: 72px;
}
label, input, button {
display: block;
}
input {
margin-bottom: 1em;
}
pre {
background: #f1f1f1;
border: 1px solid #ccc;
overflow: auto;
padding: 1em;
white-space: pre-wrap;
word-break: break-all;
word-wrap: break-word;
}
.hidden {
display: none;
}
</style>
</head>
<body>
<h1>IPTV Bouquet Install Generator</h1>
<p>This is a simple page that will generate a install command for the plugin.</p>
<p>This page <strong>does not</strong> send or store any of your details it runs entirley within your browser.</p>
<p>To use enter your providers hostname and port e.g. http://www.suls.co.uk:8080 then your username and password.</p>
<p>Once you press <strong>Generate</strong> the one line install command will be shown. Connect to your box (i.e. using PuTTY) and then paste in the command.</p>
<label for="host">Host</label>
<input id="host" placeholder=" e.g. http://www.suls.co.uk:8080">
<label for="username">Username</label>
<input id="username" placeholder="username">
<label for="password">Password</label>
<input id="password" placeholder="password">
<button id="generate">Generate</button>
<pre id="output" class="hidden"></pre>
<script type="text/javascript">
function onClick() {
var host = document.getElementById('host').value;
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var output = document.getElementById('output');
output.classList.remove('hidden');
if (inputsAreEmpty(host, username, password)) {
output.textContent = 'Error: need to enter host, username and password';
return;
}
var displaycmd = installcmd.replace('myhost', host).replace('myusername', username).replace('mypassword', password);
output.textContent = displaycmd;
return;
}
function inputsAreEmpty(provider,username, password) {
if (provider === '' || username === '' || password === '') {
return true;
} else {
return false;
}
}
var installcmd = "wget -O /tmp/config.xml \"https://raw.githubusercontent.com/su1s/e2m3u2bouquet/master/generator_config.xml\" && sed -i 's#hhhhh#myhost#g' /tmp/config.xml && sed -i 's/uuuuu/myusername/g' /tmp/config.xml && sed -i 's/ppppp/mypassword/g' /tmp/config.xml && opkg install --force-reinstall \"https://github.com/su1s/e2m3u2bouquet/releases/download/v0.8.5/enigma2-plugin-extensions-e2m3u2bouquet_0.8.5_all.ipk\" && reboot";
var button = document.getElementById('generate');
button.addEventListener('click', onClick);
</script>
</body>
</html>