C# Class YoutubeExtractor.DownloadUrlResolver

Provides a method to get the download link of a YouTube video.
显示文件 Open project: flagbug/YoutubeExtractor Class Usage Examples

Public Methods

Method Description
DecryptDownloadUrl ( VideoInfo videoInfo ) : void

Decrypts the signature in the VideoInfo.DownloadUrl property and sets it to the decrypted URL. Use this method, if you have decryptSignature in the method set to false.

GetDownloadUrls ( string videoUrl, bool decryptSignature = true ) : IEnumerable

Gets a list of VideoInfos for the specified URL.

GetDownloadUrlsAsync ( string videoUrl, bool decryptSignature = true ) : System.Threading.Tasks.Task>
TryNormalizeYoutubeUrl ( string url, string &normalizedUrl ) : bool

Normalizes the given YouTube URL to the format http://youtube.com/watch?v={youtube-id} and returns whether the normalization was successful or not.

Private Methods

Method Description
ExtractDownloadUrls ( JObject json ) : IEnumerable
GetAdaptiveStreamMap ( JObject json ) : string
GetDecipheredSignature ( string htmlPlayerVersion, string signature ) : string
GetHtml5PlayerVersion ( JObject json ) : string
GetStreamMap ( JObject json ) : string
GetVideoInfos ( IEnumerable extractionInfos, string videoTitle ) : IEnumerable
GetVideoTitle ( JObject json ) : string
IsVideoUnavailable ( string pageSource ) : bool
LoadJson ( string url ) : JObject
ThrowYoutubeParseException ( Exception innerException, string videoUrl ) : void

Method Details

DecryptDownloadUrl() public static method

Decrypts the signature in the VideoInfo.DownloadUrl property and sets it to the decrypted URL. Use this method, if you have decryptSignature in the method set to false.
/// There was an error while deciphering the signature. ///
public static DecryptDownloadUrl ( VideoInfo videoInfo ) : void
videoInfo VideoInfo The video info which's downlaod URL should be decrypted.
return void

GetDownloadUrls() public static method

Gets a list of VideoInfos for the specified URL.
/// The parameter is null. /// /// The parameter is not a valid YouTube URL. /// The video is not available. /// An error occurred while downloading the YouTube page html. /// The Youtube page could not be parsed.
public static GetDownloadUrls ( string videoUrl, bool decryptSignature = true ) : IEnumerable
videoUrl string The URL of the YouTube video.
decryptSignature bool /// A value indicating whether the video signatures should be decrypted or not. Decrypting /// consists of a HTTP request for each , so you may want to set /// this to false and call on your selected later. ///
return IEnumerable

GetDownloadUrlsAsync() public static method

public static GetDownloadUrlsAsync ( string videoUrl, bool decryptSignature = true ) : System.Threading.Tasks.Task>
videoUrl string
decryptSignature bool
return System.Threading.Tasks.Task>

TryNormalizeYoutubeUrl() public static method

Normalizes the given YouTube URL to the format http://youtube.com/watch?v={youtube-id} and returns whether the normalization was successful or not.
public static TryNormalizeYoutubeUrl ( string url, string &normalizedUrl ) : bool
url string The YouTube URL to normalize.
normalizedUrl string The normalized YouTube URL.
return bool