-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui_extractor.pyw
More file actions
84 lines (73 loc) · 3.69 KB
/
gui_extractor.pyw
File metadata and controls
84 lines (73 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import tkinter as tk
from tkinter import filedialog, messagebox
class ComboExtractorGUI:
def __init__(self, root):
self.root = root
self.root.title("Combo List Extractor")
self.root.geometry("500x250")
self.combo_path = None
self.keywords_path = None
self.output_path = None
self.keywords = []
# Button: Load Combo List
btn_combo = tk.Button(root, text="Load Combo List", width=20, command=self.load_combolist)
btn_combo.pack(pady=(20, 5))
self.lbl_combo = tk.Label(root, text="No file selected", fg="grey")
self.lbl_combo.pack()
# Button: Load Keywords File
btn_keywords = tk.Button(root, text="Load Keywords File", width=20, command=self.load_keywords)
btn_keywords.pack(pady=5)
self.lbl_keywords = tk.Label(root, text="No file selected", fg="grey")
self.lbl_keywords.pack()
# Button: Select Output File
btn_output = tk.Button(root, text="Select Output File", width=20, command=self.select_output)
btn_output.pack(pady=5)
self.lbl_output = tk.Label(root, text="No file selected", fg="grey")
self.lbl_output.pack()
# Button: Run Extraction
btn_run = tk.Button(root, text="Run Extraction", width=20, command=self.run_extraction)
btn_run.pack(pady=(15, 5))
def load_combolist(self):
path = filedialog.askopenfilename(title="Select Combo List", filetypes=[("Text Files", "*.txt"), ("All Files", "*")])
if path:
self.combo_path = path
self.lbl_combo.config(text=path, fg="black")
def load_keywords(self):
path = filedialog.askopenfilename(title="Select Keywords File", filetypes=[("Text Files", "*.txt"), ("All Files", "*")])
if path:
self.keywords_path = path
self.lbl_keywords.config(text=path, fg="black")
# Load keywords into memory
try:
with open(path, 'r', encoding='utf-8', errors='ignore') as f:
self.keywords = [line.strip().lower() for line in f if line.strip()]
messagebox.showinfo("Keywords Loaded", f"Loaded {len(self.keywords)} keywords.")
except Exception as e:
messagebox.showerror("Error", f"Failed to load keywords: {e}")
def select_output(self):
path = filedialog.asksaveasfilename(defaultextension=".txt", title="Select Output File", filetypes=[("Text Files", "*.txt"), ("All Files", "*")])
if path:
self.output_path = path
self.lbl_output.config(text=path, fg="black")
def run_extraction(self):
if not self.combo_path or not self.keywords or not self.output_path:
messagebox.showerror("Missing Information", "Please load combo list, keywords file, and select an output file.")
return
try:
with open(self.combo_path, 'r', encoding='utf-8', errors='ignore') as infile, \
open(self.output_path, 'w', encoding='utf-8') as outfile:
for line in infile:
parts = line.strip().split(':')
for i in range(0, len(parts) - 1, 2):
email = parts[i]
password = parts[i + 1]
combo = f"{email}:{password}"
if any(keyword in email.lower() for keyword in self.keywords):
outfile.write(combo + '\n')
messagebox.showinfo("Success", "Extraction completed successfully!")
except Exception as e:
messagebox.showerror("Error", f"An error occurred: {e}")
if __name__ == "__main__":
root = tk.Tk()
app = ComboExtractorGUI(root)
root.mainloop()