Fullscreen is not working on the web video player

This commit is contained in:
Eljakim Herrewijnen 2022-07-27 22:31:16 +02:00
parent 004d913520
commit 58d538183b
3 changed files with 13 additions and 2 deletions

View File

@ -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:

View File

@ -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:

View File

@ -1,5 +1,5 @@
[main]
streaming_method = video
streaming_method = web
streaming_service = youtube
[kerk]