Compare commits

...

2 Commits

Author SHA1 Message Date
Brahim Hadriche 65175a1d12
Merge e569aaed9d into b673695aa2 2024-04-10 21:53:09 +00:00
Brahim Hadriche e569aaed9d add a refresh param to /api/v1/videos/:id 2024-02-19 19:34:38 -05:00
1 changed files with 5 additions and 1 deletions

View File

@ -8,8 +8,12 @@ module Invidious::Routes::API::V1::Videos
region = env.params.query["region"]?
proxy = {"1", "true"}.any? &.== env.params.query["local"]?
refresh = env.params.query["refresh"]?
refresh ||= "1"
refresh = refresh == "1" || refresh == "true"
begin
video = get_video(id, region: region)
video = get_video(id, refresh: refresh, region: region)
rescue ex : NotFoundException
return error_json(404, ex)
rescue ex