C# Класс Business.DownloadBusiness

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DownloadedExtensions string[]

Открытые методы

Метод Описание
DownloadVideoAsync ( Media video, int queuePos, EventHandler callback ) : Task

Downloads specified video from YouTube.

DownloadVideoAsync ( Media video, int queuePos, bool upgradeAudio, EventHandler callback ) : Task

Downloads specified video from YouTube.

GetAudioExtension ( AudioType audio ) : string

Returns the file extension for specified audio type.

GetCodecExtension ( VideoType video ) : string

Returns the file extension for specified video codec type. To avoid conflicting file names, the codec extension must be different than the final extension.

GetDownloadUrlsAsync ( string url ) : Task>

Returns the list of download URLs from YouTube.

GetFinalExtension ( VideoType video, AudioType audio ) : string

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.

GetFinalExtension ( string video, string audio ) : string

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.

IsDownloadDuplicate ( Media request ) : bool
SelectBestAudio ( IEnumerable list ) : VideoInfo

Selects OGG (Vorbis) audio if available, otherwise AAC.

SelectBestFormat ( IEnumerable list ) : BestFormatInfo

Returns the best format from the list in this order of availability: WebM, Mp4 or Flash. Mp4 will be chosen if WebM is over 35% smaller.

Приватные методы

Метод Описание
DownloadCanceled ( Business.DownloadItem downloadInfo ) : void
DownloadCompletedAsync ( Business.DownloadItem downloadInfo ) : Task
DownloadFilesAsync ( Business.DownloadItem downloadInfo, EventHandler callback ) : Task

Downloads the specified list of files.

DownloadVideoAsync ( Business.DownloadItem downloadInfo, Business.DownloadItem fileInfo, EventHandler callback ) : Task
FileHasContent ( string fileName ) : bool

Returns whether specified file exists and contains data (at least 500KB).

RaiseCallback ( Business.DownloadItem downloadInfo ) : void
StartDownloadAsync ( Business.DownloadItem downloadInfo ) : Task
StartNextDownloadAsync ( ) : Task

Описание методов

DownloadVideoAsync() публичный Метод

Downloads specified video from YouTube.
public DownloadVideoAsync ( Media video, int queuePos, EventHandler callback ) : Task
video DataAccess.Media The video to download.
queuePos int The position in the queue to auto-play, or -1.
callback EventHandler The method to call once download is completed.
Результат Task

DownloadVideoAsync() публичный Метод

Downloads specified video from YouTube.
public DownloadVideoAsync ( Media video, int queuePos, bool upgradeAudio, EventHandler callback ) : Task
video DataAccess.Media The video to download.
queuePos int The position in the queue to auto-play, or -1.
upgradeAudio bool If true, only the audio will be downloaded and it will be merged with the local video file.
callback EventHandler The method to call once download is completed.
Результат Task

GetAudioExtension() публичный Метод

Returns the file extension for specified audio type.
public GetAudioExtension ( AudioType audio ) : string
audio AudioType The audio type to get file extension for.
Результат string

GetCodecExtension() публичный Метод

Returns the file extension for specified video codec type. To avoid conflicting file names, the codec extension must be different than the final extension.
public GetCodecExtension ( VideoType video ) : string
video VideoType The video type to get file extension for.
Результат string

GetDownloadUrlsAsync() публичный статический Метод

Returns the list of download URLs from YouTube.
public static GetDownloadUrlsAsync ( string url ) : Task>
url string The YouTube video URL to query.
Результат Task>

GetFinalExtension() публичный Метод

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.
public GetFinalExtension ( VideoType video, AudioType audio ) : string
video VideoType The video type to get file extension for.
audio AudioType
Результат string

GetFinalExtension() публичный Метод

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.
public GetFinalExtension ( string video, string audio ) : string
video string The video type to get file extension for.
audio string
Результат string

IsDownloadDuplicate() публичный Метод

public IsDownloadDuplicate ( Media request ) : bool
request DataAccess.Media
Результат bool

SelectBestAudio() публичный статический Метод

Selects OGG (Vorbis) audio if available, otherwise AAC.
public static SelectBestAudio ( IEnumerable list ) : VideoInfo
list IEnumerable The list of available audios.
Результат VideoInfo

SelectBestFormat() публичный статический Метод

Returns the best format from the list in this order of availability: WebM, Mp4 or Flash. Mp4 will be chosen if WebM is over 35% smaller.
public static SelectBestFormat ( IEnumerable list ) : BestFormatInfo
list IEnumerable The list of videos to chose from.
Результат BestFormatInfo

Описание свойств

DownloadedExtensions публичное статическое свойство

public static string[] DownloadedExtensions
Результат string[]