Skip to content

[Enhancement] Support content-disposition header in subtitles endpoint #5211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
syeopite opened this issue Mar 20, 2025 · 2 comments · May be fixed by #5234
Open

[Enhancement] Support content-disposition header in subtitles endpoint #5211

syeopite opened this issue Mar 20, 2025 · 2 comments · May be fixed by #5234
Labels
enhancement Improvement of an existing feature good first issue Good for newcomers

Comments

@syeopite
Copy link
Member

syeopite commented Mar 20, 2025

When trying to download subtitles through the download widget Invidious doesn't add an attachment content-disposition header to the response, resulting in the browser opening the file instead of downloading it.

This should be a trivial fix. The content disposition header can be set right before the captions handler gets called:

if label = download_widget["label"]?
# URL params specific to /api/v1/captions/:id
env.params.url["id"] = video_id
env.params.query["title"] = filename
env.params.query["label"] = URI.decode_www_form(label.as_s)
return Invidious::Routes::API::V1::Videos.captions(env)

@syeopite syeopite added enhancement Improvement of an existing feature good first issue Good for newcomers labels Mar 20, 2025
@ekansh2
Copy link

ekansh2 commented Apr 9, 2025

@syeopite MR created for the issue.

@syeopite syeopite linked a pull request May 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of an existing feature good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@ekansh2 @syeopite and others