mirror of
https://github.com/UrloMythus/UnHided.git
synced 2026-04-11 11:50:51 +00:00
new version
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
<title>App Status</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Your App is running</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
h2 { color: #2c5aa0; border-bottom: 2px solid #2c5aa0; padding-bottom: 5px; text-align: left; margin-top: 30px; }
|
||||
.form-group { margin-bottom: 15px; }
|
||||
label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
|
||||
.proxy-label { display: inline-block; margin-left: 5px; font-weight: normal; }
|
||||
input[type="text"], input[type="url"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
|
||||
.btn { display: inline-block; padding: 10px 20px; background: #2c5aa0; color: white; text-decoration: none; border-radius: 5px; margin: 5px; cursor: pointer; border: none; font-size: 16px; }
|
||||
.btn:hover { background: #1e3d6f; }
|
||||
@@ -60,6 +61,14 @@
|
||||
<label>M3U Playlist URL</label>
|
||||
<input type="url" class="playlist-url" placeholder="Ex: http://provider.com/playlist.m3u">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" class="proxy-playlist" checked>
|
||||
<label class="proxy-label">Proxy this playlist</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" class="sort-playlist">
|
||||
<label class="proxy-label">Sort this playlist</label>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -94,8 +103,14 @@
|
||||
for (const entry of entries) {
|
||||
const playlistUrl = entry.querySelector('.playlist-url').value.trim();
|
||||
if (playlistUrl) {
|
||||
const shouldProxy = entry.querySelector('.proxy-playlist').checked;
|
||||
const shouldSort = entry.querySelector('.sort-playlist').checked;
|
||||
|
||||
let definition = (shouldSort ? 'sort:' : '') + (shouldProxy ? '' : 'no_proxy:') + playlistUrl;
|
||||
|
||||
if (playlistUrl.startsWith('http://') || playlistUrl.startsWith('https://')) {
|
||||
definitions.push(playlistUrl);
|
||||
// Se l'URL non ha proxy, ma ha sort, il prefisso sarà 'sort:no_proxy:'
|
||||
definitions.push(definition);
|
||||
} else {
|
||||
alert('Invalid URL: ' + playlistUrl + '. URLs must start with http:// or https://');
|
||||
return;
|
||||
|
||||
@@ -425,12 +425,14 @@ class MediaFlowSpeedTest {
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
// Add current API password to headers if provided
|
||||
// Build URL with api_password as query parameter if provided
|
||||
// This is more reliable than headers when behind reverse proxies
|
||||
let configUrl = '/speedtest/config';
|
||||
if (currentApiPassword) {
|
||||
headers['api_password'] = currentApiPassword;
|
||||
configUrl += `?api_password=${encodeURIComponent(currentApiPassword)}`;
|
||||
}
|
||||
|
||||
const response = await fetch('/speedtest/config', {
|
||||
const response = await fetch(configUrl, {
|
||||
method: 'POST',
|
||||
headers: headers,
|
||||
body: JSON.stringify(requestBody)
|
||||
|
||||
Reference in New Issue
Block a user