Skip to content

Commit

Permalink
feat(uc): added undetected chromedriver (#515)
Browse files Browse the repository at this point in the history
* - Fix creation of random code (#499)

Co-authored-by: Juri <j.robl@osram.com>

* feat(uc): Use undetected chromedriver (#497)

* Varied sleep time for each call, to make it less predictable and more user-like

* Use a random, real useragent

* Use a random, real useragent from fake-useragent

* Wait some time between clicks

* Force some minimum sleeptime for random_sleeps

* - Use random_sleep more often
- Replace 'VACC-IPYx-xxxx' with complete random code

* # Refactored mouse movements
# Use computed movements more often
# Wiggle a bit after reaching the correct values

* # Removed fake-useragent because it was unreliant

* # First test for replacing normal chromedriver with undetected-chromedriver

* # First test for replacing normal chromedriver with undetected-chromedriver

* # Remove selenium-wire requests from selenium_code_anfordern, by @jonas

* - Removed mouse movements by @jonasmock
- Fixed annotations

* - Close driver after successfull code request

Co-authored-by: Juri <j.robl@osram.com>

* added chromedriver again (#502)

* fix(readme): Termineingrenzung Feature in Readme eingefügt. (#508)

* feat(local-chromium): replacing chromedriver binaries with google chrome or custom chromium installation (#509)

* disabled local chromedriver, replaced with google chrome or custom chromium installation

* option 3: set environment variables

* returning webdriver exectuable as a string

* fix(args): add missing configure_notifications argument (#514)

* Update README.md

* add missing configure_notifications argument

This led to errors when running `python3 main.py code --configure-only -f max-mustermann.json`.

Co-authored-by: Julius Jacobitz <47418007+JuliusJacobitz@users.noreply.github.com>

Co-authored-by: Genmutant <github@jurirobl.de>
Co-authored-by: Juri <j.robl@osram.com>
Co-authored-by: Linus Schaub <linusschaub@googlemail.com>
Co-authored-by: Christian Jülg <c.juelg+github@gmail.com>
Co-authored-by: Julius Jacobitz <47418007+JuliusJacobitz@users.noreply.github.com>
  • Loading branch information
6 people committed Jun 30, 2021
1 parent a789f5b commit 1ea701a
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 399 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Die Distributionen können im [neusten Release heruntergeladen werden](https://g
Es gibt noch ein paar Features, die cool wären. Die Ideen werden hier mal gesammelt und
werden (von uns oder euch - feel free!) irgendwann hinzukommen:

- [ ] Datum eingrenzen bei der Terminwahl
- [x] Datum eingrenzen bei der Terminwahl
- [ ] Github Pages
- [ ] Integrierter updater.
- [ ] Macosx Build / Pipeline (Mac currently blocks the app: [Branch](https://github.com/iamnotturner/vaccipy/tree/mac-intel-build))
Expand Down
17 changes: 16 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ def gen_code(kontaktdaten):

its = ImpfterminService([], {}, PATH)

# Einmal Chrome starten, um früh einen Fehler zu erzeugen, falls die
# erforderliche Software nicht installiert ist.
its.log.info("Prüfen von Chromium und Chromedriver")
its.get_chromedriver(headless=True).quit()

print("\nBitte trage nachfolgend dein Geburtsdatum im Format DD.MM.YYYY ein.\n"
"Beispiel: 02.03.1982\n")
while True:
Expand Down Expand Up @@ -404,7 +409,7 @@ def subcommand_search(args):
def subcommand_code(args):
if args.configure_only:
update_kontaktdaten_interactive(
get_kontaktdaten(args.file), "code", args.file)
get_kontaktdaten(args.file), "code", args.configure_notifications, args.file)
elif args.read_only:
gen_code(get_kontaktdaten(args.file))
else:
Expand Down Expand Up @@ -564,6 +569,16 @@ def main():
else:
print("Falscheingabe! Bitte erneut versuchen.")
print()
except TypeError as exc:
if str(exc) == "expected str, bytes or os.PathLike object, not NoneType":
print("\nChromium nicht gefunden. Drei Möglichkeiten zur Problembehebung:\n"
"1) Google Chrome installieren: https://www.google.com/intl/de_de/chrome/\n"
"2) Chromium über das Vaccipy-Menü installieren: "
"'[3] Eigene Chromium Instanz im Vaccipy Ordner installieren'\n"
"3) Pfad für Chromium und Chromedriver über Umgebungsvariablen festlegen: "
"VACCIPY_CHROME_BIN (Chromium) und VACCIPY_CHROMEDRIVER (Chromedriver)\n")
else:
print(f"\nUnbekannter TypeError:\n{str(exc)}\n")
except Exception as exc:
print(f"\nFehler:\n{str(exc)}\n")

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ PyQt5-Qt5==5.15.2
PyQt5-sip==12.9.0
requests>=2.25.1
tqdm>=4.61.0
selenium-wire>=4.3.1
selenium-wire>=4.3.1
undetected-chromedriver>=3.0.1
Loading

0 comments on commit 1ea701a

Please sign in to comment.