xbox_video 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xbox_video/client.rb +6 -4
- data/lib/xbox_video/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe0588be5bb6384a8319657a1202b45e7f617762
|
4
|
+
data.tar.gz: a4d8088de995cd388e6f43c65285fa335975e29c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c57d1882937be96accb37ca81d5c8affa38b913d11b15878ef22d7c1a9330e5e50f44305be4fa438a049637926cdb09622f9d2b915b3f4bd3a77a12c9f6f231c
|
7
|
+
data.tar.gz: 76f90604bd628e8c60ffa61d4696fe8aa83fbafcfc878b0c08596c7d9aff88c42ef2200d959ad154cd221f2c992b4a963349468faa0c0d64cbe127374ec185c4
|
data/lib/xbox_video/client.rb
CHANGED
@@ -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(
|
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: )
|
data/lib/xbox_video/version.rb
CHANGED