/// <summary> /// Parse requestPathString to YoutubePlaybackRequestPath /// </summary> /// <param name="requestPathString"></param> /// <returns></returns> public static YoutubePlaybackRequestPath ParseRequestPathString(string requestPathString) { string[] pathAndQueryStringSplitted = requestPathString.Split(new[] { "?" }, StringSplitOptions.None); var result = new YoutubePlaybackRequestPath(); result.Path = pathAndQueryStringSplitted[0]; result.QueryString = new QueryString(pathAndQueryStringSplitted[1]); return(result); }
private YoutubeRequestURL requestURLFromSession(SessionEventArgs session) { YoutubePlaybackRequestPath youtubeRequestPath = YoutubePlaybackRequestPathParser.ParseRequestPathString(session.HttpClient.Request.RequestUri.PathAndQuery); string host = session.HttpClient.Request.Host; return(new YoutubeRequestURL() { RequestPath = youtubeRequestPath, Host = host }); }