danilotpnta commited on
Commit
48a5d9c
·
1 Parent(s): 1b742cb
Files changed (1) hide show
  1. download_video.py +2 -13
download_video.py CHANGED
@@ -14,23 +14,12 @@ def download_mp3_selenium(youtube_url):
14
  options.add_argument("--no-sandbox")
15
  options.add_argument('--disable-dev-shm-usage')
16
  options.add_argument('--disable-gpu') # Disable GPU to ensure it runs in cloud environments
17
- options.add_argument('--verbose')
18
- options.add_argument('--log-path=/tmp/chromedriver.log')
19
- options.add_argument('--disable-software-rasterizer') # Disable software rasterizer
20
- options.add_argument('--remote-debugging-port=9222') # Enable remote debugging
21
- options = webdriver.ChromeOptions()
22
-
23
 
24
  log_contents = "" # Initialize log_contents
25
-
26
- # Use the Service class to specify the path to the ChromeDriver binary
27
- service = Service(executable_path="/usr/bin/chromedriver")
28
-
29
- # Pass the service and options to the WebDriver
30
- driver = webdriver.Chrome(service=service, options=options)
31
 
32
  # Set up WebDriverWait (with a timeout of 10 seconds)
33
- wait = WebDriverWait(driver, 10)
34
 
35
  # Open the YouTube video page
36
  driver.get(youtube_url)
 
14
  options.add_argument("--no-sandbox")
15
  options.add_argument('--disable-dev-shm-usage')
16
  options.add_argument('--disable-gpu') # Disable GPU to ensure it runs in cloud environments
 
 
 
 
 
 
17
 
18
  log_contents = "" # Initialize log_contents
19
+ driver = webdriver.Chrome(options=options)
 
 
 
 
 
20
 
21
  # Set up WebDriverWait (with a timeout of 10 seconds)
22
+ wait = WebDriverWait(driver, 20)
23
 
24
  # Open the YouTube video page
25
  driver.get(youtube_url)