xbox_video 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2fc823683ea6daa4ae95f4c464d69114cb6e95c8
4
- data.tar.gz: 8ddd8253448e79de97a19dbeddd80dcdf1527e5b
3
+ metadata.gz: fe0588be5bb6384a8319657a1202b45e7f617762
4
+ data.tar.gz: a4d8088de995cd388e6f43c65285fa335975e29c
5
5
  SHA512:
6
- metadata.gz: 387999636f196a5b18b88b386187bb98ef7f793faaf8edeff824a926104aa935e8656e68e5b996659e0de33d7508d6c64dff822b743936eed101909f8e9cae58
7
- data.tar.gz: 5b14727c5811729da5daf4264a17bc17962aece49e8ff38d7d6a61db7f4e1995531d5d58f27d992876fa404b813036645b61cd8a6e5f477bd1d3c6d0f01798e3
6
+ metadata.gz: c57d1882937be96accb37ca81d5c8affa38b913d11b15878ef22d7c1a9330e5e50f44305be4fa438a049637926cdb09622f9d2b915b3f4bd3a77a12c9f6f231c
7
+ data.tar.gz: 76f90604bd628e8c60ffa61d4696fe8aa83fbafcfc878b0c08596c7d9aff88c42ef2200d959ad154cd221f2c992b4a963349468faa0c0d64cbe127374ec185c4
@@ -24,20 +24,22 @@ module XboxVideo
24
24
  end
25
25
 
26
26
  uri = "#{BASE_URL}/public/titles/#{game_id}/clips?qualifier=created&type=userGenerated"
27
- puts uri
28
27
  response = RestClient.get(uri, :'Authorization' => @key, :'contract_version' => 2)
29
28
  parsed = JSON.parse(response)
30
29
  videos = create_videos(parsed)
31
30
  end
32
31
 
33
- # download a clip. Pass in a video object and a pathname.
32
+ # download a clip. Pass in a video object and a pathname. Returns pathname
34
33
  def download(video:,path:)
35
- path = "#{video.game} #{video.title} #{video.clip_id}"
36
- File.open("#{path}.mp4",'wb') do |save_file|
34
+ path = "#{path}/#{video.game} #{video.title} #{video.clip_id}.mp4"
35
+ File.open(path,'wb') do |save_file|
37
36
  open(video.clips.first.uri, 'rb') do |read_file|
38
37
  save_file.write(read_file.read)
39
38
  end
40
39
  end
40
+
41
+ path
42
+
41
43
  end
42
44
 
43
45
  def download_random(path: )
@@ -1,3 +1,3 @@
1
1
  module XboxVideo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xbox_video
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - doomy