From e569aaed9d3737139cb52fa48c1414918c936560 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 19 Feb 2024 19:34:38 -0500 Subject: [PATCH] add a refresh param to /api/v1/videos/:id --- src/invidious/routes/api/v1/videos.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/api/v1/videos.cr b/src/invidious/routes/api/v1/videos.cr index 9281f4dd..409d63ac 100644 --- a/src/invidious/routes/api/v1/videos.cr +++ b/src/invidious/routes/api/v1/videos.cr @@ -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