Fixed full screen mode and disabled chrome message about automated test software
This commit is contained in:
parent
58d538183b
commit
65c748866a
@ -34,6 +34,8 @@ class Streamer:
|
||||
self.options = Options()
|
||||
self.options.add_argument("start-maximized")
|
||||
self.options.add_experimental_option("detach", True)
|
||||
self.options.add_experimental_option("useAutomationExtension", False)
|
||||
self.options.add_experimental_option("excludeSwitches",["enable-automation"])
|
||||
self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=self.options)
|
||||
|
||||
#implicit wait TODO add as config
|
||||
|
@ -51,16 +51,17 @@ class Web_Youtube(Web_StreamService):
|
||||
|
||||
def post_load_actions(self, driver):
|
||||
self.bypass_cookies(driver)
|
||||
# self.double_click_fullscreen(driver) does not work
|
||||
self.double_click_fullscreen(driver)
|
||||
|
||||
def double_click_fullscreen(self, driver):
|
||||
while True:
|
||||
if len(driver.find_elements(by=By.XPATH, value='//*[@id="movie_player"]/div[1]/video')) > 0:
|
||||
video = driver.find_elements(by=By.XPATH, value='//*[@id="movie_player"]/div[1]/video')[0]
|
||||
break
|
||||
time.sleep(5)
|
||||
action = ActionChains(driver)
|
||||
action.double_click(video)
|
||||
action.perform()
|
||||
# action.send_keys("f")
|
||||
# video.click();time.sleep(.1);video.click()
|
||||
|
||||
def bypass_cookies(self, driver):
|
||||
|
Loading…
Reference in New Issue
Block a user