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