Пример #1
0
        public string Login(string username, string password)
        {
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                return("");
            }

            try
            {
                using (var client = new WebClientEx())
                {
                    var values = new NameValueCollection
                    {
                        { "username", username },
                        { "password", password },
                    };
                    // Authenticate
                    client.UploadValues("https://bakabt.me/login.php", values);
                    if (ValidateCookie(client.CookieContainer.GetCookieHeader(new Uri("https://bakabt.me"))))
                    {
                        return(client.CookieContainer.GetCookieHeader(new Uri("https://bakabt.me")));
                    }
                    else
                    {
                        return("");
                    }
                }
            }
            catch (Exception ex)
            {
                logger.ErrorException(ex.ToString(), ex);
                return("");
            }
        }
Пример #2
0
        public string Login(string username, string password)
        {
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                return("");
            }

            try
            {
                WebClientEx client = null;
                while (client == null)
                {
                    Console.WriteLine("Trying..");
                    client = CloudflareEvader.CreateBypassedWebClient("https://animebytes.tv");
                }

                try
                {
                    using (client)
                    {
                        var values = new NameValueCollection
                        {
                            { "username", username },
                            { "password", password },
                        };
                        // Authenticate
                        client.UploadValues("https://animebytes.tv/user/login", values);
                        // Download desired page

                        string temp = client.CookieContainer.GetCookieHeader(new Uri("http://animebytes.tv/index.php"));

                        if (ValidateCookie(temp))
                        {
                            return(client.CookieContainer.GetCookieHeader(new Uri("http://animebytes.tv/index.php")));
                        }
                        else
                        {
                            return("");
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.ErrorException(ex.ToString(), ex);
                    return("");
                }

                //Console.WriteLine("Solved! We're clear to go");
                //Console.WriteLine(client.DownloadString("http://anilinkz.tv/anime-list"));
            }
            catch (Exception ex)
            {
                logger.ErrorException(ex.ToString(), ex);
                return("");
            }
        }
Пример #3
0
        public string Login(string username, string password)
        {
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) return "";

            try
            {
                using (var client = new WebClientEx())
                {
                    var values = new NameValueCollection
                    {
                        { "username", username },
                        { "password", password },
                    };
                    // Authenticate
                    client.UploadValues("https://bakabt.me/login.php", values);
                    if (ValidateCookie(client.CookieContainer.GetCookieHeader(new Uri("https://bakabt.me"))))
                        return client.CookieContainer.GetCookieHeader(new Uri("https://bakabt.me"));
                    else
                        return "";
                }

            }
            catch (Exception ex)
            {
                logger.ErrorException(ex.ToString(), ex);
                return "";
            }
        }