Class CaptionsResource.DownloadRequest
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.
Inheritance
Inherited Members
Namespace: Google.Apis.YouTube.v3
Assembly: Google.Apis.YouTube.v3.dll
Syntax
public class DownloadRequest : YouTubeBaseServiceRequest<string>, IClientServiceRequest<string>, IClientServiceRequest
Constructors
DownloadRequest(IClientService, String)
Constructs a new Download request.
Declaration
public DownloadRequest(IClientService service, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| IClientService | service | |
| System.String | id |
Properties
HttpMethod
Gets the HTTP method.
Declaration
public override string HttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
Id
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.
Declaration
[RequestParameter("id", RequestParameterType.Path)]
public virtual string Id { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
MediaDownloader
Gets the media downloader.
Declaration
public IMediaDownloader MediaDownloader { get; }
Property Value
| Type | Description |
|---|---|
| IMediaDownloader |
MethodName
Gets the method name.
Declaration
public override string MethodName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
OnBehalfOf
ID of the Google+ Page for the channel that the request is be on behalf of
Declaration
[RequestParameter("onBehalfOf", RequestParameterType.Query)]
public virtual string OnBehalfOf { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
OnBehalfOfContentOwner
Note: This parameter is intended exclusively for YouTube content partners.
The 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.
Declaration
[RequestParameter("onBehalfOfContentOwner", RequestParameterType.Query)]
public virtual string OnBehalfOfContentOwner { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RestPath
Gets the REST path.
Declaration
public override string RestPath { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
Tfmt
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.
Declaration
[RequestParameter("tfmt", RequestParameterType.Query)]
public virtual CaptionsResource.DownloadRequest.TfmtEnum? Tfmt { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<CaptionsResource.DownloadRequest.TfmtEnum> |
Tlang
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.
Declaration
[RequestParameter("tlang", RequestParameterType.Query)]
public virtual string Tlang { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Download(Stream)
Synchronously download the media into the given stream.
Warning: This method hides download errors; use DownloadWithStatus(Stream) instead.
Declaration
public virtual void Download(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream |
DownloadAsync(Stream)
Asynchronously download the media into the given stream.
Declaration
public virtual Task<IDownloadProgress> DownloadAsync(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IDownloadProgress> |
DownloadAsync(Stream, CancellationToken)
Asynchronously download the media into the given stream.
Declaration
public virtual Task<IDownloadProgress> DownloadAsync(Stream stream, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | |
| System.Threading.CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IDownloadProgress> |
DownloadRange(Stream, RangeHeaderValue)
Synchronously download a range of the media into the given stream.
Declaration
public virtual IDownloadProgress DownloadRange(Stream stream, RangeHeaderValue range)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | |
| System.Net.Http.Headers.RangeHeaderValue | range |
Returns
| Type | Description |
|---|---|
| IDownloadProgress |
DownloadRangeAsync(Stream, RangeHeaderValue, CancellationToken)
Asynchronously download a range of the media into the given stream.
Declaration
public virtual Task<IDownloadProgress> DownloadRangeAsync(Stream stream, RangeHeaderValue range, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | |
| System.Net.Http.Headers.RangeHeaderValue | range | |
| System.Threading.CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IDownloadProgress> |
DownloadWithStatus(Stream)
Synchronously download the media into the given stream.
Declaration
public virtual IDownloadProgress DownloadWithStatus(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream |
Returns
| Type | Description |
|---|---|
| IDownloadProgress | The final status of the download; including whether the download succeeded or failed. |
InitParameters()
Initializes Download parameter list.
Declaration
protected override void InitParameters()