diff options
Diffstat (limited to 'src/invidious.cr')
| -rw-r--r-- | src/invidious.cr | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 02eaec6b..7af339ed 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -242,17 +242,23 @@ get "/watch" do |env| next env.redirect "/" end - video_start = env.params.query["start"]?.try &.to_i - video_start ||= 0 + if env.params.query["start"]? + video_start = decode_time(env.params.query["start"]) + else + video_start = 0 + end - video_end = env.params.query["end"]?.try &.to_i - video_end ||= -1 + if env.params.query["end"]? + video_end = decode_time(env.params.query["end"]) + else + video_end = -1 + end - listen = false if env.params.query["listen"]? && env.params.query["listen"] == "true" listen = true env.params.query.delete_all("listen") end + listen ||= false authorized = env.get? "authorized" if authorized |
