diff --git a/streaming/base_stream.py b/streaming/base_stream.py index 47c6326..fa3c4be 100644 --- a/streaming/base_stream.py +++ b/streaming/base_stream.py @@ -2,6 +2,7 @@ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver import ActionChains import time class Web_StreamService: diff --git a/streaming/youtube.py b/streaming/youtube.py index 2d3a3bd..2940425 100644 --- a/streaming/youtube.py +++ b/streaming/youtube.py @@ -1,4 +1,3 @@ -from fcntl import F_SEAL_SEAL import requests from streaming.base_stream import * import os, time @@ -52,6 +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 + + 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) + # video.click();time.sleep(.1);video.click() def bypass_cookies(self, driver): if 'consent.youtube.com' in driver.current_url: diff --git a/tests/teststream.ini b/tests/teststream.ini index e163d63..549d34a 100644 --- a/tests/teststream.ini +++ b/tests/teststream.ini @@ -1,5 +1,5 @@ [main] -streaming_method = video +streaming_method = web streaming_service = youtube [kerk]