From 8c7411544411312ff5c15f1ba6d7ee32ed352b6a Mon Sep 17 00:00:00 2001 From: ekansh sharma Date: Thu, 10 Apr 2025 00:56:50 +0530 Subject: [PATCH] content-disposition-header added --- src/invidious/routes/watch.cr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index ab588ad6..6c35192d 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -321,6 +321,9 @@ module Invidious::Routes::Watch env.params.query["title"] = filename env.params.query["label"] = URI.decode_www_form(label.as_s) + # Set content disposition header to force download + env.response.headers["Content-Disposition"] = "attachment; filename=\"#{filename}\"" + return Invidious::Routes::API::V1::Videos.captions(env) elsif itag = download_widget["itag"]?.try &.as_i.to_s # URL params specific to /latest_version