/// <summary> /// Initializes an instance of <see cref="VideoClient"/>. /// </summary> internal VideoClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; Streams = new StreamsClient(httpClient); ClosedCaptions = new ClosedCaptionClient(httpClient); }
public SegmentedHttpStream(YoutubeHttpClient httpClient, string url, long length, long segmentSize) { _url = url; _httpClient = httpClient; Length = length; _segmentSize = segmentSize; }
/// <summary> /// Initializes an instance of <see cref="YoutubeClient"/>. /// </summary> internal YoutubeClient(YoutubeHttpClient httpClient) { Videos = new VideoClient(httpClient); Playlists = new PlaylistClient(httpClient); Channels = new ChannelClient(httpClient); Search = new SearchClient(httpClient); }
public static async Task <ChannelPage> GetByUserNameAsync(YoutubeHttpClient httpClient, string userName) => await Retry.WrapAsync(async() => { var url = $"https://www.youtube.com/user/{userName}?hl=en"; var raw = await httpClient.GetStringAsync(url); var result = Parse(raw); if (!result.IsOk()) { throw TransientFailureException.Generic("Channel page is broken."); } return(result); });
/// <summary> /// Initializes an instance of <see cref="StreamsClient"/>. /// </summary> internal StreamsClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; }
/// <summary> /// Initializes an instance of <see cref="ClosedCaptionClient"/>. /// </summary> internal ClosedCaptionClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; }
/// <summary> /// Initializes an instance of <see cref="SearchClient"/>. /// </summary> internal SearchClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; }
public static async Task <PlayerSource> GetAsync(YoutubeHttpClient httpClient, string url) => await Retry.WrapAsync(async() => { var raw = await httpClient.GetStringAsync(url); return(Parse(raw)); });
/// <summary> /// Initializes an instance of <see cref="PlaylistClient" />. /// </summary> internal PlaylistClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; }
/// <summary> /// Initializes an instance of <see cref="YoutubeClient" />. /// </summary> internal YoutubeClient(YoutubeHttpClient httpClient) { Videos = new VideoClient(httpClient); Playlists = new PlaylistClient(httpClient); }
/// <summary> /// Initializes an instance of <see cref="VideoClient" />. /// </summary> internal VideoClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; Streams = new StreamsClient(httpClient); }
/// <summary> /// Initializes an instance of <see cref="ChannelClient"/>. /// </summary> internal ChannelClient(YoutubeHttpClient httpClient) { _httpClient = httpClient; }