From 7e7b161215469df54e4098991f532a35582b11bd Mon Sep 17 00:00:00 2001 From: ToasterUwU Date: Sun, 14 Mar 2021 20:20:37 +0100 Subject: [PATCH] no geckodriver log, new goals in readme --- README.md | 5 ++++- anti-scalp.pyw | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index df8ec68..f704e32 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Everyone should be able to use it just fine. - Linux: - Instead of downloading the installer, you download the linux.zip file - Unpack the zip - - Open a console in the folder of Anti-Scalp + - Open a console in the new folder of Anti-Scalp - "sudo apt install firefox-geckodriver" - "sudo apt install python3-pip" - "sudo pip3 install -r requirements.txt" @@ -82,7 +82,10 @@ If you need any help with using Anti-Scalp, join the [discord server](https://di ## What comes in the future +- [ ] Autoupdate selectors.json +- [ ] Tutorial video for the ones that are not so good with tech - [ ] Easier way to add links then making a .txt file in a folder +- [ ] Alternative ways of notification from sound and opening (For example: Discord Webhooks, SMS, Email) - [ ] Auto configuration for new shops diff --git a/anti-scalp.pyw b/anti-scalp.pyw index d88fcf2..a3cb8f4 100644 --- a/anti-scalp.pyw +++ b/anti-scalp.pyw @@ -11,7 +11,7 @@ import time import webbrowser from difflib import SequenceMatcher from itertools import cycle -from typing import Callable, Iterable, List +from typing import Callable, Iterable import playsound import requests @@ -110,7 +110,7 @@ class Broswer(): self.options.headless = headless if bin_path: self.options.binary_location = bin_path - test_driver = webdriver.Firefox(options=self.options) + test_driver = webdriver.Firefox(options=self.options, service_log_path=os.devnull) except: if not chrome_failed: self.browser = "chrome" @@ -196,7 +196,7 @@ class Broswer(): profile = webdriver.FirefoxProfile() profile.set_preference("permissions.default.image", 2) - self.driver = webdriver.Firefox(options=self.options, firefox_profile=profile) + self.driver = webdriver.Firefox(options=self.options, firefox_profile=profile, service_log_path=os.devnull) elif self.browser == "chrome": chrome_prefs = {} @@ -699,8 +699,11 @@ class GUI(): playsound.playsound("alert.wav", block=False) def change_sound(self): - filename = QFileDialog().getOpenFileName(filter="*.mp3 *.wav")[0] - shutil.copy2(PATH+filename, PATH+"alert."+filename.rsplit(".", 1)[1]) + try: + filename = QFileDialog().getOpenFileName(filter="*.mp3 *.wav")[0] + shutil.copy2(PATH+filename, PATH+"alert."+filename.rsplit(".", 1)[1]) + except: + pass def reset_sound(self): if os.path.exists(PATH+"alert.mp3"): @@ -732,6 +735,7 @@ class GUI(): for name, p_box in self.product_check_boxes.items(): if name not in ap: p_box.setDisabled(True) + p_box.setChecked(False) else: p_box.setDisabled(False) @@ -781,7 +785,7 @@ class GUI(): webbrowser.open("https://github.com/ToasterUwU/Anti-Scalp") def open_links_folder(self): - webbrowser.open(__file__.replace("\\", "/").rsplit("/", 1)[0]+"/links") + webbrowser.open(PATH+"/links") gui = GUI() gui.mainloop() \ No newline at end of file