|
|
@ -730,6 +730,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
def process_video_params(query, preferences)
|
|
|
|
def process_video_params(query, preferences)
|
|
|
|
autoplay = query["autoplay"]?.try &.to_i?
|
|
|
|
autoplay = query["autoplay"]?.try &.to_i?
|
|
|
|
|
|
|
|
continue = query["continue"]?.try &.to_i?
|
|
|
|
listen = query["listen"]? && (query["listen"] == "true" || query["listen"] == "1").to_unsafe
|
|
|
|
listen = query["listen"]? && (query["listen"] == "true" || query["listen"] == "1").to_unsafe
|
|
|
|
preferred_captions = query["subtitles"]?.try &.split(",").map { |a| a.downcase }
|
|
|
|
preferred_captions = query["subtitles"]?.try &.split(",").map { |a| a.downcase }
|
|
|
|
quality = query["quality"]?
|
|
|
|
quality = query["quality"]?
|
|
|
@ -739,6 +740,7 @@ def process_video_params(query, preferences)
|
|
|
|
|
|
|
|
|
|
|
|
if preferences
|
|
|
|
if preferences
|
|
|
|
autoplay ||= preferences.autoplay.to_unsafe
|
|
|
|
autoplay ||= preferences.autoplay.to_unsafe
|
|
|
|
|
|
|
|
continue ||= preferences.continue.to_unsafe
|
|
|
|
listen ||= preferences.listen.to_unsafe
|
|
|
|
listen ||= preferences.listen.to_unsafe
|
|
|
|
preferred_captions ||= preferences.captions
|
|
|
|
preferred_captions ||= preferences.captions
|
|
|
|
quality ||= preferences.quality
|
|
|
|
quality ||= preferences.quality
|
|
|
@ -748,6 +750,7 @@ def process_video_params(query, preferences)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
autoplay ||= 0
|
|
|
|
autoplay ||= 0
|
|
|
|
|
|
|
|
continue ||= 0
|
|
|
|
listen ||= 0
|
|
|
|
listen ||= 0
|
|
|
|
preferred_captions ||= [] of String
|
|
|
|
preferred_captions ||= [] of String
|
|
|
|
quality ||= "hd720"
|
|
|
|
quality ||= "hd720"
|
|
|
@ -756,6 +759,7 @@ def process_video_params(query, preferences)
|
|
|
|
volume ||= 100
|
|
|
|
volume ||= 100
|
|
|
|
|
|
|
|
|
|
|
|
autoplay = autoplay == 1
|
|
|
|
autoplay = autoplay == 1
|
|
|
|
|
|
|
|
continue = continue == 1
|
|
|
|
listen = listen == 1
|
|
|
|
listen = listen == 1
|
|
|
|
video_loop = video_loop == 1
|
|
|
|
video_loop = video_loop == 1
|
|
|
|
|
|
|
|
|
|
|
@ -786,6 +790,7 @@ def process_video_params(query, preferences)
|
|
|
|
|
|
|
|
|
|
|
|
params = {
|
|
|
|
params = {
|
|
|
|
autoplay: autoplay,
|
|
|
|
autoplay: autoplay,
|
|
|
|
|
|
|
|
continue: continue,
|
|
|
|
controls: controls,
|
|
|
|
controls: controls,
|
|
|
|
listen: listen,
|
|
|
|
listen: listen,
|
|
|
|
preferred_captions: preferred_captions,
|
|
|
|
preferred_captions: preferred_captions,
|
|
|
|