Пример #1
0
        private void ExecuteAction()
        {
            //Since CefSharp Evaluate "document.getElementByClasName('a_class_name')" return null so we need to use Regular Expression
            foreach (var item in URLCollection)
            {
                Executer.Load(item);
                Thread.Sleep(10000);
                string source = Executer.GetSourceAsync().Result;
                Regex  regex  = new Regex(@"<script type=""text/javascript"">var(.*?)</script>", RegexOptions.Singleline);
                string videoElementContainer = regex.Match(source).Value;
                //Google APIs
                if (videoElementContainer.IndexOf("googleapis") != -1)
                {
                    VideoUrls.Add(new VideoUrlsInformation(item, "Found Google APIs (this is old server 1 which is down in mid 2017, rip a really good server to watch anime :( ) all video (all mean video in Anime47.com) in Google APIs already be removed in mid 2017 so we can't get video from this server, The process will stop, Would you like to download from Openload.co? "));
                    OnExecute_Complete();
                    return;
                }

                //default server which is //video.xx.fbcdn.net
                Regex  getVideoURL = new Regex(@"//(.*?)'", RegexOptions.Singleline);
                string VideoURL    = getVideoURL.Match(videoElementContainer).Value.Replace("'", "");

                //Zing Tv
                if (videoElementContainer.IndexOf(".zadn.vn") != -1)
                {
                    getVideoURL = new Regex(@"//(.*?)""", RegexOptions.Singleline);
                    VideoURL    = getVideoURL.Match(videoElementContainer).Value.Replace("\"", "");
                }

                VideoUrls.Add(new VideoUrlsInformation(item, VideoURL));
            }
            OnExecute_Complete();
        }