From 9745b3f34e1439c17c85bf96067c13a6987e4eb6 Mon Sep 17 00:00:00 2001 From: FrostyPowerUp Date: Fri, 8 Jul 2022 07:49:15 +1000 Subject: [PATCH 1/2] Update main.py Fix for specific regions bug due to redirection by lolesports.com improved compatibility for all regions. --- main.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index e9622ba..dd1ec7a 100644 --- a/main.py +++ b/main.py @@ -25,7 +25,7 @@ def getLiveMatches(driver): matches = [] - elements = driver.find_elements(by=By.CSS_SELECTOR, value="a.match.live") + elements = driver.find_elements(by=By.CSS_SELECTOR, value=".live.event") for element in elements: matches.append(element.get_attribute("href")) return matches @@ -35,7 +35,7 @@ def readConfig(filepath): return yaml.safe_load(f) def logIn(driver, username, password): - driver.get("https://lolesports.com/") + driver.get("https://lolesports.com/schedule") time.sleep(2) log.info("Moving to log in page") @@ -99,7 +99,7 @@ def setTwitchQuality(driver): if isHeadless and hasAutoLogin: options.add_argument("--headless") driver = webdriver.Chrome(options=options) -driver.get("https://lolesports.com/") +driver.get("https://lolesports.com/schedule") if hasAutoLogin: try: @@ -125,7 +125,7 @@ def setTwitchQuality(driver): while True: driver.switch_to.window(originalWindow) # just to be sure time.sleep(2) - driver.get("https://lolesports.com/") + driver.get("https://lolesports.com/schedule") time.sleep(5) liveMatches = getLiveMatches(driver) log.info(f"{len(liveMatches)} matches live") @@ -166,6 +166,3 @@ def setTwitchQuality(driver): driver.switch_to.window(originalWindow) time.sleep(900) - - - From adecba7bf3d294599a4c7757e417ca2182e82b2a Mon Sep 17 00:00:00 2001 From: League of Poro <95635582+LeagueOfPoro@users.noreply.github.com> Date: Fri, 8 Jul 2022 09:55:19 +0200 Subject: [PATCH 2/2] Update main.py Removed INFO message that is confusing some users --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index dd1ec7a..945045a 100644 --- a/main.py +++ b/main.py @@ -145,7 +145,7 @@ def setTwitchQuality(driver): # Open new live matches newLiveMatches = set(liveMatches) - set(currentWindows.keys()) - log.info(f"{len(newLiveMatches)} new matches") + # log.info(f"{len(newLiveMatches)} new matches") for match in newLiveMatches: driver.switch_to.new_window('tab') time.sleep(2)