late-sdk 0.0.780 → 0.0.782
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 +4 -4
- data/README.md +4 -0
- data/docs/ConnectApi.md +80 -0
- data/docs/GetYoutubeCaptions200Response.md +38 -0
- data/docs/GetYoutubeCaptions200ResponseAvailableTracksInner.md +24 -0
- data/docs/GetYoutubeCaptions200ResponseCuesInner.md +22 -0
- data/lib/zernio-sdk/api/connect_api.rb +83 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response.rb +296 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response_available_tracks_inner.rb +209 -0
- data/lib/zernio-sdk/models/get_youtube_captions200_response_cues_inner.rb +166 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -0
- data/openapi.yaml +116 -0
- data/spec/api/connect_api_spec.rb +16 -0
- data/spec/models/get_youtube_captions200_response_available_tracks_inner_spec.rb +58 -0
- data/spec/models/get_youtube_captions200_response_cues_inner_spec.rb +48 -0
- data/spec/models/get_youtube_captions200_response_spec.rb +104 -0
- data/zernio-sdk-0.0.782.gem +0 -0
- metadata +15 -3
- data/zernio-sdk-0.0.780.gem +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class GetYoutubeCaptions200ResponseAvailableTracksInner < ApiModelBase
|
|
18
|
+
attr_accessor :track_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :language
|
|
21
|
+
|
|
22
|
+
attr_accessor :track_kind
|
|
23
|
+
|
|
24
|
+
# The track's display name. Empty for auto-generated tracks.
|
|
25
|
+
attr_accessor :name
|
|
26
|
+
|
|
27
|
+
class EnumAttributeValidator
|
|
28
|
+
attr_reader :datatype
|
|
29
|
+
attr_reader :allowable_values
|
|
30
|
+
|
|
31
|
+
def initialize(datatype, allowable_values)
|
|
32
|
+
@allowable_values = allowable_values.map do |value|
|
|
33
|
+
case datatype.to_s
|
|
34
|
+
when /Integer/i
|
|
35
|
+
value.to_i
|
|
36
|
+
when /Float/i
|
|
37
|
+
value.to_f
|
|
38
|
+
else
|
|
39
|
+
value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def valid?(value)
|
|
45
|
+
!value || allowable_values.include?(value)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
|
+
def self.attribute_map
|
|
51
|
+
{
|
|
52
|
+
:'track_id' => :'trackId',
|
|
53
|
+
:'language' => :'language',
|
|
54
|
+
:'track_kind' => :'trackKind',
|
|
55
|
+
:'name' => :'name'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns attribute mapping this model knows about
|
|
60
|
+
def self.acceptable_attribute_map
|
|
61
|
+
attribute_map
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns all the JSON keys this model knows about
|
|
65
|
+
def self.acceptable_attributes
|
|
66
|
+
acceptable_attribute_map.values
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Attribute type mapping.
|
|
70
|
+
def self.openapi_types
|
|
71
|
+
{
|
|
72
|
+
:'track_id' => :'String',
|
|
73
|
+
:'language' => :'String',
|
|
74
|
+
:'track_kind' => :'String',
|
|
75
|
+
:'name' => :'String'
|
|
76
|
+
}
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# List of attributes with nullable: true
|
|
80
|
+
def self.openapi_nullable
|
|
81
|
+
Set.new([
|
|
82
|
+
])
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Initializes the object
|
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
|
+
def initialize(attributes = {})
|
|
88
|
+
if (!attributes.is_a?(Hash))
|
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner` initialize method"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
93
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
95
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
97
|
+
end
|
|
98
|
+
h[k.to_sym] = v
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'track_id')
|
|
102
|
+
self.track_id = attributes[:'track_id']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'language')
|
|
106
|
+
self.language = attributes[:'language']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'track_kind')
|
|
110
|
+
self.track_kind = attributes[:'track_kind']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'name')
|
|
114
|
+
self.name = attributes[:'name']
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
invalid_properties
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Check to see if the all the properties in the model are valid
|
|
127
|
+
# @return true if the model is valid
|
|
128
|
+
def valid?
|
|
129
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
130
|
+
track_kind_validator = EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
131
|
+
return false unless track_kind_validator.valid?(@track_kind)
|
|
132
|
+
true
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
136
|
+
# @param [Object] track_kind Object to be assigned
|
|
137
|
+
def track_kind=(track_kind)
|
|
138
|
+
validator = EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
139
|
+
unless validator.valid?(track_kind)
|
|
140
|
+
fail ArgumentError, "invalid value for \"track_kind\", must be one of #{validator.allowable_values}."
|
|
141
|
+
end
|
|
142
|
+
@track_kind = track_kind
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Checks equality by comparing each attribute.
|
|
146
|
+
# @param [Object] Object to be compared
|
|
147
|
+
def ==(o)
|
|
148
|
+
return true if self.equal?(o)
|
|
149
|
+
self.class == o.class &&
|
|
150
|
+
track_id == o.track_id &&
|
|
151
|
+
language == o.language &&
|
|
152
|
+
track_kind == o.track_kind &&
|
|
153
|
+
name == o.name
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# @see the `==` method
|
|
157
|
+
# @param [Object] Object to be compared
|
|
158
|
+
def eql?(o)
|
|
159
|
+
self == o
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Calculates hash code according to all attributes.
|
|
163
|
+
# @return [Integer] Hash code
|
|
164
|
+
def hash
|
|
165
|
+
[track_id, language, track_kind, name].hash
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Builds the object from hash
|
|
169
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
170
|
+
# @return [Object] Returns the model itself
|
|
171
|
+
def self.build_from_hash(attributes)
|
|
172
|
+
return nil unless attributes.is_a?(Hash)
|
|
173
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
174
|
+
transformed_hash = {}
|
|
175
|
+
openapi_types.each_pair do |key, type|
|
|
176
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = nil
|
|
178
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
179
|
+
# check to ensure the input is an array given that the attribute
|
|
180
|
+
# is documented as an array but the input is not
|
|
181
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
182
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
183
|
+
end
|
|
184
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
185
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
new(transformed_hash)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Returns the object in the form of hash
|
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
|
193
|
+
def to_hash
|
|
194
|
+
hash = {}
|
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
196
|
+
value = self.send(attr)
|
|
197
|
+
if value.nil?
|
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
hash[param] = _to_hash(value)
|
|
203
|
+
end
|
|
204
|
+
hash
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class GetYoutubeCaptions200ResponseCuesInner < ApiModelBase
|
|
18
|
+
# Seconds from the start of the video.
|
|
19
|
+
attr_accessor :start
|
|
20
|
+
|
|
21
|
+
attr_accessor :_end
|
|
22
|
+
|
|
23
|
+
attr_accessor :text
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'start' => :'start',
|
|
29
|
+
:'_end' => :'end',
|
|
30
|
+
:'text' => :'text'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns attribute mapping this model knows about
|
|
35
|
+
def self.acceptable_attribute_map
|
|
36
|
+
attribute_map
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns all the JSON keys this model knows about
|
|
40
|
+
def self.acceptable_attributes
|
|
41
|
+
acceptable_attribute_map.values
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute type mapping.
|
|
45
|
+
def self.openapi_types
|
|
46
|
+
{
|
|
47
|
+
:'start' => :'Float',
|
|
48
|
+
:'_end' => :'Float',
|
|
49
|
+
:'text' => :'String'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# List of attributes with nullable: true
|
|
54
|
+
def self.openapi_nullable
|
|
55
|
+
Set.new([
|
|
56
|
+
])
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Initializes the object
|
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
61
|
+
def initialize(attributes = {})
|
|
62
|
+
if (!attributes.is_a?(Hash))
|
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetYoutubeCaptions200ResponseCuesInner` initialize method"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
67
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
69
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetYoutubeCaptions200ResponseCuesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
71
|
+
end
|
|
72
|
+
h[k.to_sym] = v
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'start')
|
|
76
|
+
self.start = attributes[:'start']
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'_end')
|
|
80
|
+
self._end = attributes[:'_end']
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'text')
|
|
84
|
+
self.text = attributes[:'text']
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
89
|
+
# @return Array for valid properties with the reasons
|
|
90
|
+
def list_invalid_properties
|
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
92
|
+
invalid_properties = Array.new
|
|
93
|
+
invalid_properties
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Check to see if the all the properties in the model are valid
|
|
97
|
+
# @return true if the model is valid
|
|
98
|
+
def valid?
|
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
start == o.start &&
|
|
109
|
+
_end == o._end &&
|
|
110
|
+
text == o.text
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see the `==` method
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def eql?(o)
|
|
116
|
+
self == o
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Calculates hash code according to all attributes.
|
|
120
|
+
# @return [Integer] Hash code
|
|
121
|
+
def hash
|
|
122
|
+
[start, _end, text].hash
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Builds the object from hash
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
# @return [Object] Returns the model itself
|
|
128
|
+
def self.build_from_hash(attributes)
|
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
|
130
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
131
|
+
transformed_hash = {}
|
|
132
|
+
openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = nil
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
136
|
+
# check to ensure the input is an array given that the attribute
|
|
137
|
+
# is documented as an array but the input is not
|
|
138
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
139
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
140
|
+
end
|
|
141
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
142
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
new(transformed_hash)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Returns the object in the form of hash
|
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
|
150
|
+
def to_hash
|
|
151
|
+
hash = {}
|
|
152
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
153
|
+
value = self.send(attr)
|
|
154
|
+
if value.nil?
|
|
155
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
156
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
hash[param] = _to_hash(value)
|
|
160
|
+
end
|
|
161
|
+
hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -804,6 +804,9 @@ require 'zernio-sdk/models/get_you_tube_daily_views500_response'
|
|
|
804
804
|
require 'zernio-sdk/models/get_you_tube_demographics412_response'
|
|
805
805
|
require 'zernio-sdk/models/get_you_tube_demographics412_response_scope_status'
|
|
806
806
|
require 'zernio-sdk/models/get_you_tube_video_retention404_response'
|
|
807
|
+
require 'zernio-sdk/models/get_youtube_captions200_response'
|
|
808
|
+
require 'zernio-sdk/models/get_youtube_captions200_response_available_tracks_inner'
|
|
809
|
+
require 'zernio-sdk/models/get_youtube_captions200_response_cues_inner'
|
|
807
810
|
require 'zernio-sdk/models/get_youtube_playlists200_response'
|
|
808
811
|
require 'zernio-sdk/models/get_youtube_playlists200_response_playlists_inner'
|
|
809
812
|
require 'zernio-sdk/models/google_business_platform_data'
|
data/openapi.yaml
CHANGED
|
@@ -22513,6 +22513,122 @@ paths:
|
|
|
22513
22513
|
'404': { description: Account not found }
|
|
22514
22514
|
'502': { description: Pinterest rejected the request (e.g. duplicate board name) }
|
|
22515
22515
|
|
|
22516
|
+
/v1/accounts/{accountId}/youtube-captions:
|
|
22517
|
+
get:
|
|
22518
|
+
x-resource-group: "accounts"
|
|
22519
|
+
operationId: getYoutubeCaptions
|
|
22520
|
+
tags: [Connect]
|
|
22521
|
+
summary: Get a YouTube video transcript
|
|
22522
|
+
description: |
|
|
22523
|
+
Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself.
|
|
22524
|
+
|
|
22525
|
+
Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language.
|
|
22526
|
+
|
|
22527
|
+
Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. `source` tells you which happened (`youtube` on the first read, `cache` after). Pass `refresh=true` only when the captions actually changed on YouTube, since that re-downloads.
|
|
22528
|
+
|
|
22529
|
+
Notes:
|
|
22530
|
+
- Only videos owned by this connected channel. Anything else returns 404.
|
|
22531
|
+
- `contentDetails.caption` in YouTube's own API reads `false` on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404.
|
|
22532
|
+
- YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.
|
|
22533
|
+
parameters:
|
|
22534
|
+
- name: accountId
|
|
22535
|
+
in: path
|
|
22536
|
+
required: true
|
|
22537
|
+
schema: { type: string }
|
|
22538
|
+
description: The connected YouTube account.
|
|
22539
|
+
- name: videoId
|
|
22540
|
+
in: query
|
|
22541
|
+
required: true
|
|
22542
|
+
schema: { type: string }
|
|
22543
|
+
description: 'The YouTube video id (the `platformPostId` on a synced external post).'
|
|
22544
|
+
- name: language
|
|
22545
|
+
in: query
|
|
22546
|
+
schema: { type: string }
|
|
22547
|
+
description: 'BCP-47 language tag as YouTube labels the track. `en` also matches an `en-GB` track. Omit to take the best available track.'
|
|
22548
|
+
- name: format
|
|
22549
|
+
in: query
|
|
22550
|
+
schema: { type: string, enum: [json, srt], default: json }
|
|
22551
|
+
description: '`json` returns timed `cues`; `srt` returns the raw SubRip body instead. `text` is present either way.'
|
|
22552
|
+
- name: refresh
|
|
22553
|
+
in: query
|
|
22554
|
+
schema: { type: boolean, default: false }
|
|
22555
|
+
description: 'Re-download from YouTube instead of serving the stored copy. Spends 200 quota units.'
|
|
22556
|
+
responses:
|
|
22557
|
+
'200':
|
|
22558
|
+
description: The transcript.
|
|
22559
|
+
content:
|
|
22560
|
+
application/json:
|
|
22561
|
+
schema:
|
|
22562
|
+
type: object
|
|
22563
|
+
properties:
|
|
22564
|
+
accountId: { type: string }
|
|
22565
|
+
videoId: { type: string }
|
|
22566
|
+
language: { type: string, description: The language of the returned track. }
|
|
22567
|
+
trackId: { type: string, description: YouTube's own caption track id. }
|
|
22568
|
+
trackKind:
|
|
22569
|
+
type: string
|
|
22570
|
+
enum: [asr, standard]
|
|
22571
|
+
description: '`asr` is YouTube''s auto-generated track; `standard` was uploaded by the channel.'
|
|
22572
|
+
source:
|
|
22573
|
+
type: string
|
|
22574
|
+
enum: [cache, youtube]
|
|
22575
|
+
description: '`cache` when served from our stored copy, `youtube` when this call spent the quota units.'
|
|
22576
|
+
fetchedAt: { type: string, format: date-time, description: When the stored copy was downloaded from YouTube. }
|
|
22577
|
+
text: { type: string, description: 'The whole transcript as one paragraph, no timings.' }
|
|
22578
|
+
cues:
|
|
22579
|
+
type: array
|
|
22580
|
+
description: 'Timed cues. Present when format is json. Auto-generated cues overlap in time by design (captions roll), so `start` can precede the previous cue''s `end`.'
|
|
22581
|
+
items:
|
|
22582
|
+
type: object
|
|
22583
|
+
properties:
|
|
22584
|
+
start: { type: number, description: 'Seconds from the start of the video.' }
|
|
22585
|
+
end: { type: number }
|
|
22586
|
+
text: { type: string }
|
|
22587
|
+
srt: { type: string, description: Raw SubRip body. Present when format is srt. }
|
|
22588
|
+
availableTracks:
|
|
22589
|
+
type: array
|
|
22590
|
+
description: 'Every track on the video, so you can re-request another language. On a cached read this is the listing as it stood when we downloaded, so a language added to the video since then appears only after a `refresh=true` or when you request that language directly.'
|
|
22591
|
+
items:
|
|
22592
|
+
type: object
|
|
22593
|
+
properties:
|
|
22594
|
+
trackId: { type: string }
|
|
22595
|
+
language: { type: string }
|
|
22596
|
+
trackKind: { type: string, enum: [asr, standard] }
|
|
22597
|
+
name: { type: string, description: 'The track''s display name. Empty for auto-generated tracks.' }
|
|
22598
|
+
example:
|
|
22599
|
+
accountId: "68a1f2c3d4e5f6a7b8c9d0e1"
|
|
22600
|
+
videoId: "sdw1FML60tM"
|
|
22601
|
+
language: "en"
|
|
22602
|
+
trackId: "AUieDaanCEjmJQdL7wfZbe1QDQTbseX-hToYw99pmOJitlJz868"
|
|
22603
|
+
trackKind: "asr"
|
|
22604
|
+
source: "cache"
|
|
22605
|
+
fetchedAt: "2026-08-27T21:09:54.000Z"
|
|
22606
|
+
text: "Hey, this is Mickey. I'm the founder of this portfolio of three websites which are mainly monetized via AdSense."
|
|
22607
|
+
cues:
|
|
22608
|
+
- start: 1.6
|
|
22609
|
+
end: 8.88
|
|
22610
|
+
text: "Hey, this is Mickey. I'm the founder of"
|
|
22611
|
+
- start: 5.04
|
|
22612
|
+
end: 12.8
|
|
22613
|
+
text: "this portfolio of three websites"
|
|
22614
|
+
availableTracks:
|
|
22615
|
+
- trackId: "AUieDaanCEjmJQdL7wfZbe1QDQTbseX-hToYw99pmOJitlJz868"
|
|
22616
|
+
language: "en"
|
|
22617
|
+
trackKind: "asr"
|
|
22618
|
+
name: ""
|
|
22619
|
+
'400': { $ref: '#/components/responses/BadRequest' }
|
|
22620
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
22621
|
+
'404':
|
|
22622
|
+
description: 'Account not found, the video does not belong to this channel (`video_not_found`), or the video has no caption track in the requested language (`captions_not_found`).'
|
|
22623
|
+
content:
|
|
22624
|
+
application/json:
|
|
22625
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
22626
|
+
example:
|
|
22627
|
+
error: "This video has no caption tracks. YouTube generates them only for videos with recognisable speech, and it can take a few hours after upload."
|
|
22628
|
+
type: "not_found"
|
|
22629
|
+
code: "captions_not_found"
|
|
22630
|
+
param: "videoId"
|
|
22631
|
+
|
|
22516
22632
|
/v1/accounts/{accountId}/youtube-playlists:
|
|
22517
22633
|
get:
|
|
22518
22634
|
x-resource-group: "accounts"
|
|
@@ -343,6 +343,22 @@ describe 'ConnectApi' do
|
|
|
343
343
|
end
|
|
344
344
|
end
|
|
345
345
|
|
|
346
|
+
# unit tests for get_youtube_captions
|
|
347
|
+
# Get a YouTube video transcript
|
|
348
|
+
# Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself. Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language. Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. `source` tells you which happened (`youtube` on the first read, `cache` after). Pass `refresh=true` only when the captions actually changed on YouTube, since that re-downloads. Notes: - Only videos owned by this connected channel. Anything else returns 404. - `contentDetails.caption` in YouTube's own API reads `false` on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404. - YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.
|
|
349
|
+
# @param account_id The connected YouTube account.
|
|
350
|
+
# @param video_id The YouTube video id (the `platformPostId` on a synced external post).
|
|
351
|
+
# @param [Hash] opts the optional parameters
|
|
352
|
+
# @option opts [String] :language BCP-47 language tag as YouTube labels the track. `en` also matches an `en-GB` track. Omit to take the best available track.
|
|
353
|
+
# @option opts [String] :format `json` returns timed `cues`; `srt` returns the raw SubRip body instead. `text` is present either way.
|
|
354
|
+
# @option opts [Boolean] :refresh Re-download from YouTube instead of serving the stored copy. Spends 200 quota units.
|
|
355
|
+
# @return [GetYoutubeCaptions200Response]
|
|
356
|
+
describe 'get_youtube_captions test' do
|
|
357
|
+
it 'should work' do
|
|
358
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
359
|
+
end
|
|
360
|
+
end
|
|
361
|
+
|
|
346
362
|
# unit tests for get_youtube_playlists
|
|
347
363
|
# List YouTube playlists
|
|
348
364
|
# Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner do
|
|
21
|
+
#let(:instance) { Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of GetYoutubeCaptions200ResponseAvailableTracksInner' do
|
|
24
|
+
it 'should create an instance of GetYoutubeCaptions200ResponseAvailableTracksInner' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::GetYoutubeCaptions200ResponseAvailableTracksInner)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "track_id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "language"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "track_kind"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["asr", "standard"])
|
|
46
|
+
# validator.allowable_values.each do |value|
|
|
47
|
+
# expect { instance.track_kind = value }.not_to raise_error
|
|
48
|
+
# end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "name"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::GetYoutubeCaptions200ResponseCuesInner
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::GetYoutubeCaptions200ResponseCuesInner do
|
|
21
|
+
#let(:instance) { Zernio::GetYoutubeCaptions200ResponseCuesInner.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of GetYoutubeCaptions200ResponseCuesInner' do
|
|
24
|
+
it 'should create an instance of GetYoutubeCaptions200ResponseCuesInner' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::GetYoutubeCaptions200ResponseCuesInner)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "start"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "_end"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "text"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|