It looks like only URLs without query params are supported. The gem seems to toss away the query part which may result in 403 errors for Amazon S3 resources where the auth token is part of the query param. On top of that, the gem just throws a "the file does not exist" error which totally obscures the 403 code.
As a workaround, I'm doing this:
def ffmpeg_video_from_remote(remote_file_url)
open(File.join('public', file.file.filename), 'wb') do |file|
file << open(remote_file_url).read
FFMPEG::Movie.new(Rails.root.join(file.path).to_s)
end
end
Edit: I was wrong. It looks like the query params do get used but what is happening is my pre-signed URL to Amazon S3 is only meant to be used with GET but the library does a HEAD request.
It looks like only URLs without query params are supported. The gem seems to toss away the query part which may result in 403 errors for Amazon S3 resources where the auth token is part of the query param. On top of that, the gem just throws a "the file does not exist" error which totally obscures the 403 code.
As a workaround, I'm doing this:
Edit: I was wrong. It looks like the query params do get used but what is happening is my pre-signed URL to Amazon S3 is only meant to be used with GET but the library does a HEAD request.