blob: a7ea63e7707eee701cde3714f8bd7e248d96d3b8 [file] [log] [blame]
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="youtube_v3.html">YouTube Data API</a> . <a href="youtube_v3.captions.html">captions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(id, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None)</a></code></p>
79<p class="firstline">Deletes a specified caption track.</p>
80<p class="toc_element">
81 <code><a href="#download">download(id, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None, tfmt=None, tlang=None)</a></code></p>
82<p class="firstline">Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.</p>
83<p class="toc_element">
84 <code><a href="#download_media">download_media(id, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None, tfmt=None, tlang=None)</a></code></p>
85<p class="firstline">Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.</p>
86<p class="toc_element">
87 <code><a href="#insert">insert(part, body=None, media_body=None, onBehalfOf=None, sync=None, debugProjectIdOverride=None, onBehalfOfContentOwner=None)</a></code></p>
88<p class="firstline">Uploads a caption track.</p>
89<p class="toc_element">
90 <code><a href="#list">list(part, videoId, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None, id=None)</a></code></p>
91<p class="firstline">Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.</p>
92<p class="toc_element">
93 <code><a href="#update">update(part, body=None, media_body=None, onBehalfOf=None, sync=None, debugProjectIdOverride=None, onBehalfOfContentOwner=None)</a></code></p>
94<p class="firstline">Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="delete">delete(id, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None)</code>
98 <pre>Deletes a specified caption track.
99
100Args:
101 id: string, The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. (required)
102 onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.
103
104The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.
105 onBehalfOf: string, ID of the Google+ Page for the channel that the request is be on behalf of
106 debugProjectIdOverride: string, The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID
107</pre>
108</div>
109
110<div class="method">
111 <code class="details" id="download">download(id, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None, tfmt=None, tlang=None)</code>
112 <pre>Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.
113
114Args:
115 id: string, The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource. (required)
116 onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.
117
118The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.
119 onBehalfOf: string, ID of the Google+ Page for the channel that the request is be on behalf of
120 debugProjectIdOverride: string, The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID
121 tfmt: string, The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.
122 Allowed values
123 sbv - SubViewer subtitle.
124 scc - Scenarist Closed Caption format.
125 srt - SubRip subtitle.
126 ttml - Timed Text Markup Language caption.
127 vtt - Web Video Text Tracks caption.
128 tlang: string, The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate.
129</pre>
130</div>
131
132<div class="method">
133 <code class="details" id="download_media">download_media(id, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None, tfmt=None, tlang=None)</code>
134 <pre>Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.
135
136Args:
137 id: string, The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource. (required)
138 onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.
139
140The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.
141 onBehalfOf: string, ID of the Google+ Page for the channel that the request is be on behalf of
142 debugProjectIdOverride: string, The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID
143 tfmt: string, The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.
144 Allowed values
145 sbv - SubViewer subtitle.
146 scc - Scenarist Closed Caption format.
147 srt - SubRip subtitle.
148 ttml - Timed Text Markup Language caption.
149 vtt - Web Video Text Tracks caption.
150 tlang: string, The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate.
151</pre>
152</div>
153
154<div class="method">
155 <code class="details" id="insert">insert(part, body=None, media_body=None, onBehalfOf=None, sync=None, debugProjectIdOverride=None, onBehalfOfContentOwner=None)</code>
156 <pre>Uploads a caption track.
157
158Args:
159 part: string, The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet. (required)
160 body: object, The request body.
161 The object takes the form of:
162
163{ # A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.
164 "snippet": { # Basic details about a caption track, such as its language and name. # The snippet object contains basic details about the caption.
165 "status": "A String", # The caption track's status.
166 "audioTrackType": "A String", # The type of audio track associated with the caption track.
167 "language": "A String", # The language of the caption track. The property value is a BCP-47 language tag.
168 "name": "A String", # The name of the caption track. The name is intended to be visible to the user as an option during playback.
169 "videoId": "A String", # The ID that YouTube uses to uniquely identify the video associated with the caption track.
170 "isDraft": True or False, # Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false.
171 "isAutoSynced": True or False, # Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions.
172 "trackKind": "A String", # The caption track's type.
173 "lastUpdated": "A String", # The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
174 "isCC": True or False, # Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false.
175 "isEasyReader": True or False, # Indicates whether caption track is formatted for "easy reader," meaning it is at a third-grade level for language learners. The default value is false.
176 "isLarge": True or False, # Indicates whether the caption track uses large text for the vision-impaired. The default value is false.
177 "failureReason": "A String", # The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.
178 },
179 "kind": "youtube#caption", # Identifies what kind of resource this is. Value: the fixed string "youtube#caption".
180 "etag": "A String", # Etag of this resource.
181 "id": "A String", # The ID that YouTube uses to uniquely identify the caption track.
182 }
183
184 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
185 onBehalfOf: string, ID of the Google+ Page for the channel that the request is be on behalf of
186 sync: boolean, The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions.
187
188You should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them.
189 debugProjectIdOverride: string, The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID.
190 onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.
191
192The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.
193
194Returns:
195 An object of the form:
196
197 { # A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.
198 "snippet": { # Basic details about a caption track, such as its language and name. # The snippet object contains basic details about the caption.
199 "status": "A String", # The caption track's status.
200 "audioTrackType": "A String", # The type of audio track associated with the caption track.
201 "language": "A String", # The language of the caption track. The property value is a BCP-47 language tag.
202 "name": "A String", # The name of the caption track. The name is intended to be visible to the user as an option during playback.
203 "videoId": "A String", # The ID that YouTube uses to uniquely identify the video associated with the caption track.
204 "isDraft": True or False, # Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false.
205 "isAutoSynced": True or False, # Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions.
206 "trackKind": "A String", # The caption track's type.
207 "lastUpdated": "A String", # The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
208 "isCC": True or False, # Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false.
209 "isEasyReader": True or False, # Indicates whether caption track is formatted for "easy reader," meaning it is at a third-grade level for language learners. The default value is false.
210 "isLarge": True or False, # Indicates whether the caption track uses large text for the vision-impaired. The default value is false.
211 "failureReason": "A String", # The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.
212 },
213 "kind": "youtube#caption", # Identifies what kind of resource this is. Value: the fixed string "youtube#caption".
214 "etag": "A String", # Etag of this resource.
215 "id": "A String", # The ID that YouTube uses to uniquely identify the caption track.
216 }</pre>
217</div>
218
219<div class="method">
220 <code class="details" id="list">list(part, videoId, onBehalfOfContentOwner=None, onBehalfOf=None, debugProjectIdOverride=None, id=None)</code>
221 <pre>Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.
222
223Args:
224 part: string, The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet. (required)
225 videoId: string, The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks. (required)
226 onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.
227
228The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.
229 onBehalfOf: string, ID of the Google+ Page for the channel that the request is on behalf of.
230 debugProjectIdOverride: string, The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID.
231 id: string, The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video.
232
233Returns:
234 An object of the form:
235
236 {
237 "eventId": "A String", # Serialized EventId of the request which produced this response.
238 "items": [ # A list of captions that match the request criteria.
239 { # A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.
240 "snippet": { # Basic details about a caption track, such as its language and name. # The snippet object contains basic details about the caption.
241 "status": "A String", # The caption track's status.
242 "audioTrackType": "A String", # The type of audio track associated with the caption track.
243 "language": "A String", # The language of the caption track. The property value is a BCP-47 language tag.
244 "name": "A String", # The name of the caption track. The name is intended to be visible to the user as an option during playback.
245 "videoId": "A String", # The ID that YouTube uses to uniquely identify the video associated with the caption track.
246 "isDraft": True or False, # Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false.
247 "isAutoSynced": True or False, # Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions.
248 "trackKind": "A String", # The caption track's type.
249 "lastUpdated": "A String", # The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
250 "isCC": True or False, # Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false.
251 "isEasyReader": True or False, # Indicates whether caption track is formatted for "easy reader," meaning it is at a third-grade level for language learners. The default value is false.
252 "isLarge": True or False, # Indicates whether the caption track uses large text for the vision-impaired. The default value is false.
253 "failureReason": "A String", # The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.
254 },
255 "kind": "youtube#caption", # Identifies what kind of resource this is. Value: the fixed string "youtube#caption".
256 "etag": "A String", # Etag of this resource.
257 "id": "A String", # The ID that YouTube uses to uniquely identify the caption track.
258 },
259 ],
260 "kind": "youtube#captionListResponse", # Identifies what kind of resource this is. Value: the fixed string "youtube#captionListResponse".
261 "etag": "A String", # Etag of this resource.
262 "visitorId": "A String", # The visitorId identifies the visitor.
263 }</pre>
264</div>
265
266<div class="method">
267 <code class="details" id="update">update(part, body=None, media_body=None, onBehalfOf=None, sync=None, debugProjectIdOverride=None, onBehalfOfContentOwner=None)</code>
268 <pre>Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.
269
270Args:
271 part: string, The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id. (required)
272 body: object, The request body.
273 The object takes the form of:
274
275{ # A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.
276 "snippet": { # Basic details about a caption track, such as its language and name. # The snippet object contains basic details about the caption.
277 "status": "A String", # The caption track's status.
278 "audioTrackType": "A String", # The type of audio track associated with the caption track.
279 "language": "A String", # The language of the caption track. The property value is a BCP-47 language tag.
280 "name": "A String", # The name of the caption track. The name is intended to be visible to the user as an option during playback.
281 "videoId": "A String", # The ID that YouTube uses to uniquely identify the video associated with the caption track.
282 "isDraft": True or False, # Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false.
283 "isAutoSynced": True or False, # Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions.
284 "trackKind": "A String", # The caption track's type.
285 "lastUpdated": "A String", # The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
286 "isCC": True or False, # Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false.
287 "isEasyReader": True or False, # Indicates whether caption track is formatted for "easy reader," meaning it is at a third-grade level for language learners. The default value is false.
288 "isLarge": True or False, # Indicates whether the caption track uses large text for the vision-impaired. The default value is false.
289 "failureReason": "A String", # The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.
290 },
291 "kind": "youtube#caption", # Identifies what kind of resource this is. Value: the fixed string "youtube#caption".
292 "etag": "A String", # Etag of this resource.
293 "id": "A String", # The ID that YouTube uses to uniquely identify the caption track.
294 }
295
296 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
297 onBehalfOf: string, ID of the Google+ Page for the channel that the request is be on behalf of
298 sync: boolean, Note: The API server only processes the parameter value if the request contains an updated caption file.
299
300The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track.
301 debugProjectIdOverride: string, The debugProjectIdOverride parameter should be used for mimicking a request for a certain project ID.
302 onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.
303
304The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.
305
306Returns:
307 An object of the form:
308
309 { # A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.
310 "snippet": { # Basic details about a caption track, such as its language and name. # The snippet object contains basic details about the caption.
311 "status": "A String", # The caption track's status.
312 "audioTrackType": "A String", # The type of audio track associated with the caption track.
313 "language": "A String", # The language of the caption track. The property value is a BCP-47 language tag.
314 "name": "A String", # The name of the caption track. The name is intended to be visible to the user as an option during playback.
315 "videoId": "A String", # The ID that YouTube uses to uniquely identify the video associated with the caption track.
316 "isDraft": True or False, # Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false.
317 "isAutoSynced": True or False, # Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions.
318 "trackKind": "A String", # The caption track's type.
319 "lastUpdated": "A String", # The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
320 "isCC": True or False, # Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false.
321 "isEasyReader": True or False, # Indicates whether caption track is formatted for "easy reader," meaning it is at a third-grade level for language learners. The default value is false.
322 "isLarge": True or False, # Indicates whether the caption track uses large text for the vision-impaired. The default value is false.
323 "failureReason": "A String", # The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.
324 },
325 "kind": "youtube#caption", # Identifies what kind of resource this is. Value: the fixed string "youtube#caption".
326 "etag": "A String", # Etag of this resource.
327 "id": "A String", # The ID that YouTube uses to uniquely identify the caption track.
328 }</pre>
329</div>
330
331</body></html>