mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-14 09:28:32 +00:00
Allow hls to be disabled via disable_proxy config
This commit is contained in:
parent
2b1a940298
commit
4ea606e3c0
@ -139,7 +139,7 @@ https_only: false
|
||||
## Disable proxying server-wide. Can be disable as a whole, or
|
||||
## only for a single function.
|
||||
##
|
||||
## Accepted values: true, false, dash, livestreams, downloads, local
|
||||
## Accepted values: true, false, dash, livestreams, downloads, local, hls
|
||||
## Default: false
|
||||
##
|
||||
#disable_proxy: false
|
||||
|
@ -91,7 +91,7 @@ module Invidious::Routes::VideoPlayback
|
||||
end
|
||||
|
||||
if url.includes? "&file=seg.ts"
|
||||
if CONFIG.disabled?("livestreams")
|
||||
if CONFIG.disabled?("livestreams") || CONFIG.disabled?("hls")
|
||||
return error_template(403, "Administrator has disabled this endpoint.")
|
||||
end
|
||||
|
||||
|
@ -105,8 +105,12 @@ def process_video_params(query, preferences)
|
||||
vr_mode = vr_mode == 1
|
||||
save_player_pos = save_player_pos == 1
|
||||
|
||||
if CONFIG.disabled?("dash") && quality == "dash"
|
||||
quality = "high"
|
||||
# Force set quality to "high" if dash or hls has been disabled by the server
|
||||
{"dash", "hls"}.each do |disabled_quality|
|
||||
if CONFIG.disabled?("dash") && quality == "dash"
|
||||
quality = "high"
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if CONFIG.disabled?("local") && local
|
||||
|
@ -6,7 +6,7 @@
|
||||
<% if params.controls %>controls<% end %>>
|
||||
<% if (hlsvp = video.hls_manifest_url) && video.live_now && !CONFIG.disabled?("livestreams") %>
|
||||
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="livestream">
|
||||
<% elsif (hlsvp = video.hls_manifest_url) && params.quality == "hls" %>
|
||||
<% elsif (hlsvp = video.hls_manifest_url) && params.quality == "hls" && !CONFIG.disabled?("hls") %>
|
||||
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="HLS">
|
||||
<% else %>
|
||||
<% if params.listen %>
|
||||
|
@ -55,9 +55,9 @@
|
||||
<label for="quality"><%= translate(locale, "preferences_quality_label") %></label>
|
||||
<select name="quality" id="quality">
|
||||
<% {"hls", "dash", "hd720", "medium", "small"}.each do |option| %>
|
||||
<% if !(option == "dash" && CONFIG.disabled?("dash")) %>
|
||||
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, "preferences_quality_option_" + option) %></option>
|
||||
<% end %>
|
||||
<% next if (option == "dash" && CONFIG.disabled?("dash"))%>
|
||||
<% next if (option == "hls" && CONFIG.disabled?("hls"))%>
|
||||
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, "preferences_quality_option_" + option) %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user