Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #15 from LeagueOfPoro/test
Browse files Browse the repository at this point in the history
OCE fix
  • Loading branch information
LeagueOfPoro committed Jul 8, 2022
2 parents edf2680 + adecba7 commit 49c6031
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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:
Expand All @@ -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")
Expand All @@ -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)
Expand All @@ -166,6 +166,3 @@ def setTwitchQuality(driver):

driver.switch_to.window(originalWindow)
time.sleep(900)



0 comments on commit 49c6031

Please sign in to comment.