|
|
@ -235,6 +235,7 @@ struct VideoPreferences
|
|
|
|
property preferred_captions : Array(String)
|
|
|
|
property preferred_captions : Array(String)
|
|
|
|
property player_style : String
|
|
|
|
property player_style : String
|
|
|
|
property quality : String
|
|
|
|
property quality : String
|
|
|
|
|
|
|
|
property quality_dash : String
|
|
|
|
property raw : Bool
|
|
|
|
property raw : Bool
|
|
|
|
property region : String?
|
|
|
|
property region : String?
|
|
|
|
property related_videos : Bool
|
|
|
|
property related_videos : Bool
|
|
|
@ -1043,6 +1044,7 @@ def process_video_params(query, preferences)
|
|
|
|
player_style = query["player_style"]?
|
|
|
|
player_style = query["player_style"]?
|
|
|
|
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"]?
|
|
|
|
|
|
|
|
quality_dash = query["quality_dash"]?
|
|
|
|
region = query["region"]?
|
|
|
|
region = query["region"]?
|
|
|
|
related_videos = query["related_videos"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
|
|
|
related_videos = query["related_videos"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
|
|
|
speed = query["speed"]?.try &.rchop("x").to_f?
|
|
|
|
speed = query["speed"]?.try &.rchop("x").to_f?
|
|
|
@ -1061,6 +1063,7 @@ def process_video_params(query, preferences)
|
|
|
|
player_style ||= preferences.player_style
|
|
|
|
player_style ||= preferences.player_style
|
|
|
|
preferred_captions ||= preferences.captions
|
|
|
|
preferred_captions ||= preferences.captions
|
|
|
|
quality ||= preferences.quality
|
|
|
|
quality ||= preferences.quality
|
|
|
|
|
|
|
|
quality_dash ||= preferences.quality_dash
|
|
|
|
related_videos ||= preferences.related_videos.to_unsafe
|
|
|
|
related_videos ||= preferences.related_videos.to_unsafe
|
|
|
|
speed ||= preferences.speed
|
|
|
|
speed ||= preferences.speed
|
|
|
|
video_loop ||= preferences.video_loop.to_unsafe
|
|
|
|
video_loop ||= preferences.video_loop.to_unsafe
|
|
|
@ -1077,6 +1080,7 @@ def process_video_params(query, preferences)
|
|
|
|
player_style ||= CONFIG.default_user_preferences.player_style
|
|
|
|
player_style ||= CONFIG.default_user_preferences.player_style
|
|
|
|
preferred_captions ||= CONFIG.default_user_preferences.captions
|
|
|
|
preferred_captions ||= CONFIG.default_user_preferences.captions
|
|
|
|
quality ||= CONFIG.default_user_preferences.quality
|
|
|
|
quality ||= CONFIG.default_user_preferences.quality
|
|
|
|
|
|
|
|
quality_dash ||= CONFIG.default_user_preferences.quality_dash
|
|
|
|
related_videos ||= CONFIG.default_user_preferences.related_videos.to_unsafe
|
|
|
|
related_videos ||= CONFIG.default_user_preferences.related_videos.to_unsafe
|
|
|
|
speed ||= CONFIG.default_user_preferences.speed
|
|
|
|
speed ||= CONFIG.default_user_preferences.speed
|
|
|
|
video_loop ||= CONFIG.default_user_preferences.video_loop.to_unsafe
|
|
|
|
video_loop ||= CONFIG.default_user_preferences.video_loop.to_unsafe
|
|
|
@ -1129,6 +1133,7 @@ def process_video_params(query, preferences)
|
|
|
|
player_style: player_style,
|
|
|
|
player_style: player_style,
|
|
|
|
preferred_captions: preferred_captions,
|
|
|
|
preferred_captions: preferred_captions,
|
|
|
|
quality: quality,
|
|
|
|
quality: quality,
|
|
|
|
|
|
|
|
quality_dash: quality_dash,
|
|
|
|
raw: raw,
|
|
|
|
raw: raw,
|
|
|
|
region: region,
|
|
|
|
region: region,
|
|
|
|
related_videos: related_videos,
|
|
|
|
related_videos: related_videos,
|
|
|
|