Ziggeo 2.29 → 2.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -14
- data/lib/Ziggeo.rb +14 -6
- data/lib/classes/ZiggeoAudioStreams.rb +8 -8
- data/lib/classes/ZiggeoAudios.rb +11 -11
- data/lib/classes/ZiggeoConfig.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 746559bffc6707c66b456a08a8d1222c54e8bfa3bd69d857387ed0201cf3d580
|
4
|
+
data.tar.gz: 8b3fea02959f00fd879b21f672533ca7d3e4a85eced7dce6f3237c87dd05b695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92f758aa8325b261b1797fd1ddcc7c1a83bf12fe9955f19cdad2fc26af6e4a6375c5f00e3a6fcf5e851e6bc9519ee75edddcf318ad1edc46ea3e2d37c0eedda2
|
7
|
+
data.tar.gz: d20c7c9aced2adf8ba61d55f95fe4c52280c965f9722128d78d7f36810866f9c71311512c124e5fc271488b111b9213dc9b8d5e6a066d114701fa1675b6e8ae4
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ziggeo's Ruby Server SDK
|
2
2
|
|
3
|
-
latest version: **2.
|
3
|
+
latest version: **2.30**
|
4
4
|
|
5
5
|
## Index
|
6
6
|
|
@@ -51,12 +51,12 @@ latest version: **2.29**
|
|
51
51
|
7. [Audios Update Bulk](#method-audios-update-bulk)
|
52
52
|
8. [Audios Delete](#method-audios-delete)
|
53
53
|
9. [Audios Create](#method-audios-create)
|
54
|
-
6. [Methods for
|
55
|
-
1. [
|
56
|
-
2. [
|
57
|
-
3. [
|
58
|
-
4. [
|
59
|
-
5. [
|
54
|
+
6. [Methods for Audio Streams](#method-audio-streams)
|
55
|
+
1. [Audio Streams Index](#method-audio-streams-index)
|
56
|
+
2. [Audio Streams Get](#method-audio-streams-get)
|
57
|
+
3. [Audio Streams Download Audio](#method-audio-streams-download-audio)
|
58
|
+
4. [Audio Streams Delete](#method-audio-streams-delete)
|
59
|
+
5. [Audio Streams Create](#method-audio-streams-create)
|
60
60
|
7. [Methods for Authtokens](#method-authtokens)
|
61
61
|
1. [Authtokens Get](#method-authtokens-get)
|
62
62
|
2. [Authtokens Update](#method-authtokens-update)
|
@@ -191,7 +191,7 @@ Currently available methods are branched off within different categories:
|
|
191
191
|
1. Videos
|
192
192
|
2. Streams
|
193
193
|
3. Audios
|
194
|
-
4.
|
194
|
+
4. Audio Streams
|
195
195
|
5. Authtokens
|
196
196
|
6. Application
|
197
197
|
7. Effect Profiles
|
@@ -622,7 +622,7 @@ ziggeo.audios().create(arguments = nil, file = nil)
|
|
622
622
|
- key: *Unique (optional) name of audio*
|
623
623
|
- volatile: *Automatically removed this video if it remains empty*
|
624
624
|
|
625
|
-
###
|
625
|
+
### Audio Streams<a name="method-audio-streams"></a>
|
626
626
|
|
627
627
|
|
628
628
|
The streams resource allows you to directly access all streams associated with a single audio.
|
@@ -632,7 +632,7 @@ The streams resource allows you to directly access all streams associated with a
|
|
632
632
|
Return all streams associated with a audio
|
633
633
|
|
634
634
|
```ruby
|
635
|
-
ziggeo.
|
635
|
+
ziggeo.audioStreams().index(audio_token_or_key, arguments = nil)
|
636
636
|
```
|
637
637
|
|
638
638
|
Arguments
|
@@ -643,7 +643,7 @@ ziggeo.audio_streams().index(audio_token_or_key, arguments = nil)
|
|
643
643
|
Get a single stream
|
644
644
|
|
645
645
|
```ruby
|
646
|
-
ziggeo.
|
646
|
+
ziggeo.audioStreams().get(audio_token_or_key, token_or_key)
|
647
647
|
```
|
648
648
|
|
649
649
|
#### Download Audio<a name="method-audio-streams-download-audio"></a>
|
@@ -651,7 +651,7 @@ ziggeo.audio_streams().get(audio_token_or_key, token_or_key)
|
|
651
651
|
Download the audio data associated with the stream
|
652
652
|
|
653
653
|
```ruby
|
654
|
-
ziggeo.
|
654
|
+
ziggeo.audioStreams().download_audio(audio_token_or_key, token_or_key)
|
655
655
|
```
|
656
656
|
|
657
657
|
#### Delete<a name="method-audio-streams-delete"></a>
|
@@ -659,7 +659,7 @@ ziggeo.audio_streams().download_audio(audio_token_or_key, token_or_key)
|
|
659
659
|
Delete the stream
|
660
660
|
|
661
661
|
```ruby
|
662
|
-
ziggeo.
|
662
|
+
ziggeo.audioStreams().delete(audio_token_or_key, token_or_key)
|
663
663
|
```
|
664
664
|
|
665
665
|
#### Create<a name="method-audio-streams-create"></a>
|
@@ -667,7 +667,7 @@ ziggeo.audio_streams().delete(audio_token_or_key, token_or_key)
|
|
667
667
|
Create a new stream
|
668
668
|
|
669
669
|
```ruby
|
670
|
-
ziggeo.
|
670
|
+
ziggeo.audioStreams().create(audio_token_or_key, arguments = nil, file = nil)
|
671
671
|
```
|
672
672
|
|
673
673
|
Arguments
|
data/lib/Ziggeo.rb
CHANGED
@@ -9,7 +9,7 @@ require_relative "classes/ZiggeoAuth"
|
|
9
9
|
require_relative "classes/ZiggeoVideos"
|
10
10
|
require_relative "classes/ZiggeoStreams"
|
11
11
|
require_relative "classes/ZiggeoAudios"
|
12
|
-
require_relative "classes/
|
12
|
+
require_relative "classes/ZiggeoAudioStreams"
|
13
13
|
require_relative "classes/ZiggeoAuthtokens"
|
14
14
|
require_relative "classes/ZiggeoApplication"
|
15
15
|
require_relative "classes/ZiggeoEffectProfiles"
|
@@ -21,7 +21,7 @@ require_relative "classes/ZiggeoAnalytics"
|
|
21
21
|
|
22
22
|
class Ziggeo
|
23
23
|
|
24
|
-
attr_accessor :token, :private_key, :encryption_key, :config, :connect, :api_connect, :cdn_connect
|
24
|
+
attr_accessor :token, :private_key, :encryption_key, :config, :connect, :api_connect, :cdn_connect, :js_cdn_connect
|
25
25
|
|
26
26
|
def initialize(token = nil, private_key = nil, encryption_key = nil)
|
27
27
|
@token = token
|
@@ -52,11 +52,19 @@ class Ziggeo
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
@cdn_connect = ZiggeoConnect.new(self, cdn_url)
|
55
|
+
js_cdn_url = @config.js_cdn_url
|
56
|
+
js_cdn_regions = @config.js_cdn_regions
|
57
|
+
js_cdn_regions.each do |key, value|
|
58
|
+
if (@token.start_with?(key))
|
59
|
+
js_cdn_url = value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
@js_cdn_connect = ZiggeoConnect.new(self, js_cdn_url)
|
55
63
|
@auth = nil
|
56
64
|
@videos = nil
|
57
65
|
@streams = nil
|
58
66
|
@audios = nil
|
59
|
-
@
|
67
|
+
@audioStreams = nil
|
60
68
|
@authtokens = nil
|
61
69
|
@application = nil
|
62
70
|
@effectProfiles = nil
|
@@ -95,9 +103,9 @@ class Ziggeo
|
|
95
103
|
return @audios
|
96
104
|
end
|
97
105
|
|
98
|
-
def
|
99
|
-
@
|
100
|
-
return @
|
106
|
+
def audioStreams()
|
107
|
+
@audioStreams = @audioStreams || ZiggeoAudioStreams.new(self)
|
108
|
+
return @audioStreams
|
101
109
|
end
|
102
110
|
|
103
111
|
def authtokens()
|
@@ -1,32 +1,32 @@
|
|
1
|
-
class
|
1
|
+
class ZiggeoAudioStreams
|
2
2
|
|
3
3
|
def initialize(application)
|
4
4
|
@application = application
|
5
5
|
end
|
6
6
|
|
7
7
|
def index(audio_token_or_key, data = nil)
|
8
|
-
return @application.api_connect.getJSON('/
|
8
|
+
return @application.api_connect.getJSON('/v1/audios/' + audio_token_or_key + '/streams', data)
|
9
9
|
end
|
10
10
|
|
11
11
|
def get(audio_token_or_key, token_or_key)
|
12
|
-
return @application.api_connect.getJSON('/
|
12
|
+
return @application.api_connect.getJSON('/v1/audios/' + audio_token_or_key + '/streams/' + token_or_key + '')
|
13
13
|
end
|
14
14
|
|
15
15
|
def download_audio(audio_token_or_key, token_or_key)
|
16
|
-
return @application.
|
16
|
+
return @application.js_cdn_connect.get('/v1/audios/' + audio_token_or_key + '/streams/' + token_or_key + '/audio')
|
17
17
|
end
|
18
18
|
|
19
19
|
def delete(audio_token_or_key, token_or_key)
|
20
|
-
return @application.api_connect.delete('/
|
20
|
+
return @application.api_connect.delete('/v1/audios/' + audio_token_or_key + '/streams/' + token_or_key + '')
|
21
21
|
end
|
22
22
|
|
23
23
|
def create(audio_token_or_key, data = nil, file = nil)
|
24
24
|
unless file.nil?
|
25
|
-
result = @application.connect.postUploadJSON('/
|
26
|
-
result = @application.connect.postJSON('/
|
25
|
+
result = @application.connect.postUploadJSON('/v1/audios/' + audio_token_or_key + '/streams-upload-url', 'stream', data, file, 'audio_type')
|
26
|
+
result = @application.connect.postJSON('/v1/audios/' + audio_token_or_key + '/streams/' + result["token"] + '/confirm-audio');
|
27
27
|
return result
|
28
28
|
else
|
29
|
-
return @application.api_connect.postJSON('/
|
29
|
+
return @application.api_connect.postJSON('/v1/audios/' + audio_token_or_key + '/streams', data, file)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/lib/classes/ZiggeoAudios.rb
CHANGED
@@ -5,44 +5,44 @@ class ZiggeoAudios
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def index(data = nil)
|
8
|
-
return @application.api_connect.getJSON('/
|
8
|
+
return @application.api_connect.getJSON('/v1/audios/', data)
|
9
9
|
end
|
10
10
|
|
11
11
|
def count(data = nil)
|
12
|
-
return @application.api_connect.getJSON('/
|
12
|
+
return @application.api_connect.getJSON('/v1/audios/count', data)
|
13
13
|
end
|
14
14
|
|
15
15
|
def get(token_or_key)
|
16
|
-
return @application.api_connect.getJSON('/
|
16
|
+
return @application.api_connect.getJSON('/v1/audios/' + token_or_key + '')
|
17
17
|
end
|
18
18
|
|
19
19
|
def get_bulk(data = nil)
|
20
|
-
return @application.api_connect.postJSON('/
|
20
|
+
return @application.api_connect.postJSON('/v1/audios/get-bulk', data)
|
21
21
|
end
|
22
22
|
|
23
23
|
def download_audio(token_or_key)
|
24
|
-
return @application.
|
24
|
+
return @application.js_cdn_connect.get('/v1/audios/' + token_or_key + '/audio')
|
25
25
|
end
|
26
26
|
|
27
27
|
def update(token_or_key, data = nil)
|
28
|
-
return @application.api_connect.postJSON('/
|
28
|
+
return @application.api_connect.postJSON('/v1/audios/' + token_or_key + '', data)
|
29
29
|
end
|
30
30
|
|
31
31
|
def update_bulk(data = nil)
|
32
|
-
return @application.api_connect.postJSON('/
|
32
|
+
return @application.api_connect.postJSON('/v1/audios/update-bulk', data)
|
33
33
|
end
|
34
34
|
|
35
35
|
def delete(token_or_key)
|
36
|
-
return @application.api_connect.delete('/
|
36
|
+
return @application.api_connect.delete('/v1/audios/' + token_or_key + '')
|
37
37
|
end
|
38
38
|
|
39
39
|
def create(data = nil, file = nil)
|
40
40
|
unless file.nil?
|
41
|
-
result = @application.connect.postUploadJSON('/
|
42
|
-
result["default_stream"] = @application.connect.postJSON('/
|
41
|
+
result = @application.connect.postUploadJSON('/v1/audios-upload-url', 'audio', data, file, 'audio_type')
|
42
|
+
result["default_stream"] = @application.connect.postJSON('/v1/audios/' + result["token"] + '/streams/' + result["default_stream"]["token"] + '/confirm-audio');
|
43
43
|
return result
|
44
44
|
else
|
45
|
-
return @application.api_connect.postJSON('/
|
45
|
+
return @application.api_connect.postJSON('/v1/audios/', data, file)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
data/lib/classes/ZiggeoConfig.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
class ZiggeoConfig
|
3
|
-
attr_accessor :request_timeout, :request_timeout_per_mb, :server_api_url, :api_url, :cdn_url, :regions, :api_regions, :cdn_regions, :resilience_factor, :resilience_on_fail
|
3
|
+
attr_accessor :request_timeout, :request_timeout_per_mb, :server_api_url, :api_url, :cdn_url, :js_cdn_url, :regions, :api_regions, :cdn_regions, :js_cdn_regions, :resilience_factor, :resilience_on_fail
|
4
4
|
|
5
5
|
def initialize()
|
6
6
|
@request_timeout = 30 # seconds
|
@@ -8,9 +8,11 @@ class ZiggeoConfig
|
|
8
8
|
@server_api_url = "https://srv-api.ziggeo.com"
|
9
9
|
@api_url = "https://api-us-east-1.ziggeo.com"
|
10
10
|
@cdn_url = "https://video-cdn.ziggeo.com"
|
11
|
+
@js_cdn_url = "https://media-cdn.ziggeo.com"
|
11
12
|
@regions = {"r1" => "https://srv-api-eu-west-1.ziggeo.com", }
|
12
13
|
@api_regions = {"r1" => "https://api-eu-west-1.ziggeo.com", }
|
13
14
|
@cdn_regions = {"r1" => "https://video-cdn-eu-west-1.ziggeo.com", }
|
15
|
+
@js_cdn_regions = {"r1" => "https://media-cdn-eu-west-1.ziggeo.com", }
|
14
16
|
@resilience_factor = 5
|
15
17
|
@resilience_on_fail = {"error" => "Too many failed attempts"}
|
16
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Ziggeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.30'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ziggeo, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|