Exemple #1
0
        private static string GetTParam(string yt_video_uri)
        {
            string    t_param;
            DataFetch df = new DataFetch();
            string    watch_page_contents = df.GetWatchPageContents(yt_video_uri);

            if (String.IsNullOrEmpty(watch_page_contents))
            {
                return(null);
            }

            Regex regex = new Regex("swfHTML = .*&t=([^&]+)&");
            Match match = regex.Match(watch_page_contents);

            if (!match.Success)
            {
                return(null);
            }

            t_param = Regex.Unescape(match.Result("$1"));
            if (t_param == null)
            {
                t_param = match.Result("$1");
            }

            return(t_param);
        }