diff --git a/lib/mediainfo.rb b/lib/mediainfo.rb index 43fb70a..710a2ca 100644 --- a/lib/mediainfo.rb +++ b/lib/mediainfo.rb @@ -90,8 +90,8 @@ def self.from_link(input) def self.run(input = nil) raise ArgumentError, 'Your input cannot be blank.' if input.nil? command = "#{location} '#{input}' --Output=XML" - raw_response, errors, status = ::Open3.capture3(command) - unless errors.empty? && status.exitstatus == 0 + raw_response, errors, status = Open3.capture3(command) + unless status.exitstatus == 0 raise ExecutionError, "Execution of '#{command}' failed: \n #{errors.red}" end return raw_response diff --git a/spec/spec_shared_examples.rb b/spec/spec_shared_examples.rb index 8f86deb..bc88716 100644 --- a/spec/spec_shared_examples.rb +++ b/spec/spec_shared_examples.rb @@ -52,13 +52,20 @@ it 'returns an instance of MediaInfo::Tracks' do region = 'us-east-2' bucket = 'github-mediainfo' - object_key = 'small.mp4' - s3_resource = Aws::S3::Resource.new( + object_key = 'SampleVideo_1280x720_50mb.mp4' + s3_resource = Aws::S3::Resource.new( region: region, access_key_id: ENV['AWS_ACCESS_KEY_ID'], secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'] ) + # presigner = Aws::S3::Presigner.new(client: Aws::S3::Client.new( + # region: region, + # access_key_id: ENV['AWS_ACCESS_KEY_ID'], + # secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'] + # )) + # presigner.presigned_url(:get_object, bucket: bucket, key: object_key) signed_url = s3_resource.bucket(bucket).object(object_key).presigned_url(:get, expires_in: 3600) + # signed_url = s3_resource.bucket(bucket).object(object_key).public_url expect(MediaInfo.from(signed_url)).to be_an_instance_of(MediaInfo::Tracks) end end