File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,9 @@ module Invidious::Routes::VideoPlayback
164164
165165 if title = query_params[" title" ]?
166166 # https://blog.fastmail.com/2011/06/24/download-non-english-filenames/
167- env.response.headers[" Content-Disposition" ] = " attachment; filename=\" #{ URI .encode_www_form(title)} \" ; filename*=UTF-8''#{ URI .encode_www_form(title)} "
167+ filename = URI .encode_www_form(title, space_to_plus: false )
168+ header = " attachment; filename=\" #{ filename } \" ; filename*=UTF-8''#{ filename } "
169+ env.response.headers[" Content-Disposition" ] = header
168170 end
169171
170172 if ! resp.headers.includes_word?(" Transfer-Encoding" , " chunked" )
Original file line number Diff line number Diff line change @@ -304,12 +304,9 @@ module Invidious::Routes::Watch
304304 end
305305
306306 download_widget = JSON .parse(selection)
307- extension = download_widget[" ext" ].as_s
308307
309- filename = URI .encode_www_form(
310- " #{ video_id } -#{ title } .#{ extension } " ,
311- space_to_plus: false
312- )
308+ extension = download_widget[" ext" ].as_s
309+ filename = " #{ video_id } -#{ title } .#{ extension } "
313310
314311 # Pass form parameters as URL parameters for the handlers of both
315312 # /latest_version and /api/v1/captions. This avoids an un-necessary
You can’t perform that action at this time.
0 commit comments