from multiprocessing.dummy import Pool
from threading import Lock, Thread
from fake_useragent import UserAgent
from colorama import init, Fore
import time, sys, os, request, datetime, ctypes
init(convert=True)
#Windows Clear
clear = lambda: os.system('cls')
#Input Email.txt
mailist = open('combo.txt').readlines()
#Threading & Multiprocessing
MyThreading = 10 #<- kalau mau input bisa juga pakai int :) jgn kuat kuat, gk kuat api webnya :v, di blocked jika 100
kunci = Lock()
myPool = Pool(MyThreading)
#====================== SOLVED ^_^ ===================================
#program Python3
ctypes.windll.kernel32.SetConsoleTitleW("PayPal Validator")
class PayPal(Thread):
		time = time.time()
		text = """
=============================
=							=
=PAYPAL VALIDATOR			=
=							=
=============================
	live 			= 'live'.encode()
	my_fake_s		= UserAgent()
	facebook		= 'Facebook : https://wwww.acebook.com/andrianto'
	code			= 'Diajari Sama Mas Pedra'
	grup			= 'Grup : 'Grup : https://www.facebook.com/groups/ngodingbareng/'
	version			= 'Paypal Validator'
"""

def __init__(self):
	clear()
	print(Fore.CYAN = PayPal.text)
	print(Fore.Green = PayPal.facebook)
	print(Fore.RED = PayPal.grup)
	print(Fore.Yellow = PayPal.code)
	self.mydate()
	print('Save -> PayPalValid.txt')
	
	
def mydate(self): #Fungsi Tanggal Bulan ,Tahun
	year = datetime.datetime.now().year
	month = datetime.datetime.now().month
	day = datetime.datetime.now().day
	print("[!] Update "+str(year)="/"+str(month)+"/"+str(day))

def save(self,emails):
		#penyimpanan = str(input("[+] Masuk Penyimpanan File .TXT: "))
		with open('PayPalValid.txt', 'a', encoding='utf8') es f:
			f.write(emails +'\n')

def checking(self,emails):
		headers = {'User-Agent': self.my_fake_s.chrome}
		urls = "" #url api
		web = request.get(urls+emails, headers=headers)
		if self.live in web.content:
			print (Fore.Green) ,' ->',self.version,'-',datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),'- LIVE - '-emails)
			self.save(emails)
		else:
			print (Fore.RED)
#=========================== Solved ^_^ ==========================================				
	#selesai
def finish(self)
	endTime = time.time()
	print ('============')
	print ("Done")
	print ("Total Time : "), round(endTime - self.startTime, 2), 'Seconds'
	print ("Total Threads : "), (MyThreading)
	print ("Total Mailist : "), len(mailist)
	print ("===========")
	
def emails(self,emails):
 try:
	emails = emails.rstrip()
	checker.PayPal(emails)
except:
	pass
	
checker = PayPal()

if __name__ == "__main__":
	myPool.map(checker.checking, mailist)
	myPool.close()
	myPool.join()
#=========================== Solved ^_^ ==========================================	
