-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (50 loc) · 1.52 KB
/
main.py
File metadata and controls
56 lines (50 loc) · 1.52 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
from follow_bot import spotify
import threading, os, time
lock = threading.Lock()
counter = 0
proxies = []
proxy_counter = 0
spotify_profile = str(input("Spotify Link or Username: "))
threads = int(input("\nThreads: "))
def load_proxies():
if not os.path.exists("proxies.txt"):
print("\nFile proxies.txt not found")
time.sleep(10)
os._exit(0)
with open("proxies.txt", "r", encoding = "UTF-8") as f:
for line in f.readlines():
line = line.replace("\n", "")
proxies.append(line)
if not len(proxies):
print("\nNo proxies loaded in proxies.txt")
time.sleep(10)
os._exit(0)
print("\n[1] Proxies\n[2] Proxyless")
option = int(input("\n> "))
if option == 1:
load_proxies()
def safe_print(arg):
lock.acquire()
print(arg)
lock.release()
def thread_starter():
global counter
if option == 1:
obj = spotify(spotify_profile, proxies[proxy_counter])
else:
obj = spotify(spotify_profile)
result, error = obj.follow()
if result == True:
counter += 1
safe_print("Followed {}".format(counter))
else:
safe_print(f"Error {error}")
while True:
if threading.active_count() <= threads:
try:
threading.Thread(target = thread_starter).start()
proxy_counter += 1
except:
pass
if len(proxies) <= proxy_counter: #Loops through proxy file
proxy_counter = 0