diff --git a/README.md b/README.md index 58905e0..4ab6536 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,20 @@ On mac/pc: `pip install -r requirements.txt` -This will install `webdriver-manager` to automatically download the correct chrome driver. If you are having issues opening having it open chrome, check https://github.com/SergeyPirogov/webdriver_manager. +This will install `webdriver-manager` to automatically download the correct chrome driver. +If you are having issues opening having it open chrome, check https://github.com/SergeyPirogov/webdriver_manager. Poppler must be installed for pdf2image. Follow the instructions at https://pdf2image.readthedocs.io/en/latest/installation.html to install. -You will also need to install ffmpeg if it is not already installed: [Mac installation guide](https://superuser.com/a/624562) [Windows installation guide](https://www.wikihow.com/Install-FFmpeg-on-Windows) +`pdflatex` must also be available. If you're unsure where to start with that, follow the [official instructions](https://www.latex-project.org/get/). +(Mac users: I'd recommend using [Homebrew](https://brew.sh/) to install [BasicTex](https://formulae.brew.sh/cask/basictex#default).). +(On linux you'll have to install the `texlive-latex-base` package on whatever package manager you use.). -LaTeX must also be installed for resume generation. If you're unsure where to start with that, follow the [official instructions](https://www.latex-project.org/get/). (Mac users: I'd recommend using [Homebrew](https://brew.sh/) to install [BasicTex](https://formulae.brew.sh/cask/basictex#default).) +If you get a `FileNotFoundError: [WinError 2] The system cannot find the file specified`, +chances are you're missing some fonts. Running +`tlmgr install collection-fontsextra` and +`tlmgr install collection-fontsrecommended` +in the terminal/command line should fix this. `python main.py` to run. It will loop until you kill the job. `ctrl + c` in your terminal to give HR a break (optional). diff --git a/constants/classNames.py b/constants/classNames.py deleted file mode 100644 index c74800d..0000000 --- a/constants/classNames.py +++ /dev/null @@ -1,2 +0,0 @@ -CAPTCHA_BOX = 'recapBorderAccessible' -AUDIO_ERROR_MESSAGE = 'rc-audiochallenge-error-message' diff --git a/constants/elementIds.py b/constants/elementIds.py index 8776c27..254d0cf 100644 --- a/constants/elementIds.py +++ b/constants/elementIds.py @@ -9,7 +9,4 @@ RELATIVE_WORKER_LABEL = '227:_select' ESSENTIAL_FUNCTIONS_LABEL = '231:_select' GENDER_LABEL = '235:_select' -RECAPTCHA_AUDIO_BUTTON = 'recaptcha-audio-button' -RECAPTCHA_ANCHOR = 'recaptcha-anchor' -AUDIO_SOURCE = 'audio-source' -AUDIO_RESPONSE = 'audio-response' + diff --git a/constants/fileNames.py b/constants/fileNames.py deleted file mode 100644 index 3888fd0..0000000 --- a/constants/fileNames.py +++ /dev/null @@ -1,2 +0,0 @@ -CAPTCHA_MP3_FILENAME = 'captchaAudio/1.mp3' -CAPTCHA_WAV_FILENAME = 'captchaAudio/2.wav' diff --git a/main.py b/main.py index 61d0293..4feff56 100644 --- a/main.py +++ b/main.py @@ -22,8 +22,6 @@ os.environ['WDM_LOG_LEVEL'] = '0' from constants.common import * -from constants.fileNames import * -from constants.classNames import * from constants.elementIds import * from constants.email import * from constants.location import * @@ -32,8 +30,6 @@ from constants.xPaths import * from constants.areaCodes import * -os.environ["PATH"] += ":/usr/local/bin" # Adds /usr/local/bin to my path which is where my ffmpeg is stored - fake = Faker() # Add printf: print with flush by default. This is for python 2 support. @@ -230,20 +226,12 @@ def random_phone(format=None): elif format==4: return '('+area_code+') '+middle_three+'-'+last_four -def main(): - while True: - random_city = random.choice(list(CITIES_TO_URLS.keys())) - try: - driver = start_driver(random_city) - except Exception as e: - printf(f"FAILED TO START DRIVER: {e}") - pass - - time.sleep(2) +def random_identity(): + fake_first_name = fake.first_name() + fake_last_name = fake.last_name() + fake_phone = random_phone() - fake_first_name = fake.first_name() - fake_last_name = fake.last_name() - fake_phone = random_phone() + try: if (args.mailtm == MAILTM_DISABLED): printf(f"USING GUERRILLA TO CREATE EMAIL") response = requests.get('https://api.guerrillamail.com/ajax.php?f=get_email_address').json() @@ -257,14 +245,30 @@ def main(): fake_email = requests.post('https://api.mail.tm/accounts', data='{"address":"'+random_email(fake_first_name+' '+fake_last_name)+'","password":" "}', headers={'Content-Type': 'application/json'}).json().get('address') mail_sid = requests.post('https://api.mail.tm/token', data='{"address":"'+fake_email+'","password":" "}', headers={'Content-Type': 'application/json'}).json().get('token') printf(f"EMAIL CREATED") + except: + args.mailtm ^= True + return random_identity() + + return { + 'first_name': fake_first_name, + 'last_name': fake_last_name, + 'email': fake_email, + 'phone': fake_phone, + 'sid' : mail_sid + } + +def main(): + while True: + random_city = random.choice(list(CITIES_TO_URLS.keys())) + try: + driver = start_driver(random_city) + except Exception as e: + printf(f"FAILED TO START DRIVER: {e}") + pass + + time.sleep(2) - fake_identity = { - 'first_name': fake_first_name, - 'last_name': fake_last_name, - 'email': fake_email, - 'phone': fake_phone, - 'sid' : mail_sid - } + fake_identity = random_identity() try: generate_account(driver, fake_identity) diff --git a/requirements.txt b/requirements.txt index 4e0e1fe..4bac68c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,4 @@ urllib3==1.26.6 Faker==9.9.1 webdriver-manager==3.5.2 pdf2image==1.16.0 -SpeechRecognition==3.8.1 pydub==0.25.1