Example #1
0
        /// <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);
        }
Example #2
0
        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
            });
        }