feat(frontend): config option to disable video downloads

This commit is contained in:
Fijxu 2025-05-08 00:31:03 -04:00
parent ea587758a5
commit b9114cbb9d
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4
2 changed files with 19 additions and 14 deletions

View File

@ -244,6 +244,8 @@ class Config
property max_popular_results : Int32 = 40
property disable_video_downloads : Bool = false
{% if flag?(:linux) %}
property reload_config_automatically : Bool = true
{% end %}

View File

@ -52,6 +52,7 @@ module Invidious::Frontend::WatchPage
# Non-DASH videos (audio+video)
if !CONFIG.disable_video_downloads
video_assets.full_videos.each do |option|
mimetype = option["mimeType"].as_s.split(";")[0]
@ -63,9 +64,10 @@ module Invidious::Frontend::WatchPage
str << (height || "~240") << "p - " << mimetype
str << "</option>\n"
end
end
# DASH video streams
if !CONFIG.disable_video_downloads
video_assets.video_streams.each do |option|
mimetype = option["mimeType"].as_s.split(";")[0]
@ -75,6 +77,7 @@ module Invidious::Frontend::WatchPage
str << option["qualityLabel"] << " - " << mimetype << " @ " << option["fps"] << "fps - video only"
str << "</option>\n"
end
end
# DASH audio streams