mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-26 02:00:11 +05:30
add a refresh param to /api/v1/videos/:id
This commit is contained in:
parent
e8a36985af
commit
e569aaed9d
@ -8,8 +8,12 @@ module Invidious::Routes::API::V1::Videos
|
|||||||
region = env.params.query["region"]?
|
region = env.params.query["region"]?
|
||||||
proxy = {"1", "true"}.any? &.== env.params.query["local"]?
|
proxy = {"1", "true"}.any? &.== env.params.query["local"]?
|
||||||
|
|
||||||
|
refresh = env.params.query["refresh"]?
|
||||||
|
refresh ||= "1"
|
||||||
|
refresh = refresh == "1" || refresh == "true"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
video = get_video(id, region: region)
|
video = get_video(id, refresh: refresh, region: region)
|
||||||
rescue ex : NotFoundException
|
rescue ex : NotFoundException
|
||||||
return error_json(404, ex)
|
return error_json(404, ex)
|
||||||
rescue ex
|
rescue ex
|
||||||
|
Loading…
Reference in New Issue
Block a user