feat: add -seekable 0 to fix 405 errors and configurable User-Agent presets for stream requests
This commit is contained in:
@@ -540,6 +540,27 @@
|
||||
<option value="ts">MPEG-TS (ts) - Better buffer</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info" style="flex: 1;">
|
||||
<span class="setting-label">User-Agent</span>
|
||||
<span class="setting-hint">HTTP User-Agent for stream requests. Try VLC if your provider blocks
|
||||
Chrome.</span>
|
||||
</div>
|
||||
<select id="setting-user-agent" class="source-select" style="width: auto; min-width: 200px;">
|
||||
<option value="chrome">Chrome (Default)</option>
|
||||
<option value="vlc">VLC</option>
|
||||
<option value="tivimate">TiviMate</option>
|
||||
<option value="custom">Custom...</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="setting-item" id="custom-user-agent-container" style="display: none;">
|
||||
<div class="setting-info" style="flex: 1;">
|
||||
<span class="setting-label">Custom User-Agent</span>
|
||||
<span class="setting-hint">Enter your own User-Agent string.</span>
|
||||
</div>
|
||||
<input type="text" id="setting-user-agent-custom" class="search-input" style="width: 300px;"
|
||||
placeholder="Custom User-Agent string...">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-section">
|
||||
|
||||
@@ -145,6 +145,39 @@ class SettingsPage {
|
||||
this.app.player.saveSettings();
|
||||
});
|
||||
}
|
||||
|
||||
// User-Agent preset
|
||||
const userAgentSelect = document.getElementById('setting-user-agent');
|
||||
const userAgentCustomInput = document.getElementById('setting-user-agent-custom');
|
||||
const customUaContainer = document.getElementById('custom-user-agent-container');
|
||||
|
||||
if (userAgentSelect && this.app.player?.settings) {
|
||||
// Load saved values
|
||||
userAgentSelect.value = this.app.player.settings.userAgentPreset || 'chrome';
|
||||
if (userAgentCustomInput) {
|
||||
userAgentCustomInput.value = this.app.player.settings.userAgentCustom || '';
|
||||
}
|
||||
|
||||
// Show/hide custom input
|
||||
const toggleCustomInput = () => {
|
||||
if (customUaContainer) {
|
||||
customUaContainer.style.display = userAgentSelect.value === 'custom' ? 'flex' : 'none';
|
||||
}
|
||||
};
|
||||
toggleCustomInput();
|
||||
|
||||
// Save on change
|
||||
userAgentSelect.addEventListener('change', () => {
|
||||
this.app.player.settings.userAgentPreset = userAgentSelect.value;
|
||||
this.app.player.saveSettings();
|
||||
toggleCustomInput();
|
||||
});
|
||||
|
||||
userAgentCustomInput?.addEventListener('change', () => {
|
||||
this.app.player.settings.userAgentCustom = userAgentCustomInput.value;
|
||||
this.app.player.saveSettings();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
initUserManagement() {
|
||||
@@ -297,6 +330,18 @@ class SettingsPage {
|
||||
if (autoTranscodeToggle) autoTranscodeToggle.checked = s.autoTranscode || false;
|
||||
if (epgRefreshSelect) epgRefreshSelect.value = s.epgRefreshInterval || '24';
|
||||
if (streamFormatSelect) streamFormatSelect.value = s.streamFormat || 'm3u8';
|
||||
|
||||
// User-Agent settings
|
||||
const userAgentSelect = document.getElementById('setting-user-agent');
|
||||
const userAgentCustomInput = document.getElementById('setting-user-agent-custom');
|
||||
const customUaContainer = document.getElementById('custom-user-agent-container');
|
||||
if (userAgentSelect) {
|
||||
userAgentSelect.value = s.userAgentPreset || 'chrome';
|
||||
if (customUaContainer) {
|
||||
customUaContainer.style.display = userAgentSelect.value === 'custom' ? 'flex' : 'none';
|
||||
}
|
||||
}
|
||||
if (userAgentCustomInput) userAgentCustomInput.value = s.userAgentCustom || '';
|
||||
}
|
||||
|
||||
// Update EPG last refreshed display
|
||||
|
||||
Reference in New Issue
Block a user