Skip to content

Commit

Permalink
Merge branch 'master' of github.com:greatseth/mediainfo
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Mar 21, 2019
2 parents 0b75f0d + dd6df54 commit 9e8ce60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/mediainfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions spec/spec_shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e8ce60

Please sign in to comment.