shailshouryya / yt-videos-list

Create and **automatically** update a list of all videos on a YouTube channel (in txt/csv/md form) via YouTube bot with end-to-end web scraping - no API tokens required. Multi-threaded support for YouTube videos list updates.
Apache License 2.0
107 stars 20 forks source link

cant get this to work. #21

Closed 111100001 closed 8 months ago

111100001 commented 8 months ago

im using a code you provided in one of the issues here:

from yt_videos_list import ListCreator
lc = ListCreator(txt=False, csv=False, md=False, all_video_data_in_memory=True, video_data_returned=True)

your_url = 'https://www.youtube.com/channel/videos'

video_data, channel_info = lc.create_list_for(url=your_url)

for video in video_data:
    print(video)

it gives this error even after i added the geckodriver in path and reopened the terminal:


===>ERROR!<===
There was an error while trying to open up the remote selenium instance. The exact error was:
Message: 'geckodriver' executable needs to be in PATH.

Don't worry though, this is an easy fix!

=====> Now updating Selenium driver binaries and fixing any version incompatibility problems. <=====
This will update all corresponding Selenium drivers for browsers (which are installed in their default locations and) supported by the yt_videos_list package...
Traceback (most recent call last):
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1509, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\logic.py", line 198, in execute
    driver = open_user_driver()
             ^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\logic.py", line 55, in open_user_driver
    return supported_drivers[user_driver]()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\logic.py", line 60, in configure_firefoxdriver
    return webdriver.Firefox(options=options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
    self.service.start()
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\__init__.py", line 323, in create_list_for
    video_data, write_information = logic.execute(deque([url]), file_name, log_silently, *instance_attributes, _DummyLock())
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\logic.py", line 200, in execute
    handle_opening_webdriver_exception(error_message)
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\logic.py", line 111, in handle_opening_webdriver_exception
    download_all()
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\download\selenium_webdriver_dependencies.py", line 339, in download_all
    download_all_dependencies(user_os)
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\download\selenium_webdriver_dependencies.py", line 40, in download_all_dependencies
    download_specific_dependency(driver, user_os)
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\download\selenium_webdriver_dependencies.py", line 31, in download_specific_dependency
    full_version_number = selenium_user_os.get_browser_version(browser)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\download\selenium_windows.py", line 49, in get_browser_version
    'Opera': get_opera_version(),
             ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\fqf1f\AppData\Local\Programs\Python\Python311\Lib\site-packages\yt_videos_list\download\selenium_windows.py", line 32, in get_opera_version
    with open(rf'{DRIVE}:\Users\{USER}\AppData\Local\Programs\Opera\installation_status.json', mode='r', encoding='utf-8') as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\fqf1f\\AppData\\Local\\Programs\\Opera\\installation_status.json'
111100001 commented 8 months ago

i solved the issue