offish / twitchtube

Twitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.
MIT License
538 stars 77 forks source link

Selenium failed to find xpath, how do we retry youtube upload #25

Closed drutan1215 closed 3 years ago

drutan1215 commented 3 years ago

The clips downloaded fine but it errored out finding elements by xpath, how do we just retry that part to upload to youtube?

offish commented 3 years ago

Could you send the logs, so I can see where it failed? To upload the file, you would either need to grab the rendered file from clips/Jan-29-2021/category and upload it manually, or create a test.py file, in the same folder as main.py and do something like this:

from twitchtube.upload import Upload
from twitchtube.config import ROOT_PROFILE_PATH, SLEEP

config = {"file": "path/to/video", "title": "my title", "description": "my description"}

upload = Upload(ROOT_PROFILE_PATH, config, SLEEP)

upload.upload()
drutan1215 commented 3 years ago

File "C:\Users\Devan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath return self.find_element(by=By.XPATH, value=xpath) File "C:\Users\Devan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, { File "C:\Users\Devan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response) File "C:\Users\Devan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //input[@type='file']

matorina22 commented 3 years ago

Im getting this error

Traceback (most recent call last): File "C:\Users*\Downloads\youtube\twitchtube-master\main.py", line 8, in from twitchtube.config import File "C:\Users\\Downloads\youtube\twitchtube-master\twitchtube\config.py", line 15 ROOT_PROFILE_PATH = "C:\Users*****\AppData\Roaming\Mozilla\Firefox\Profiles\5q8sjx41.Selenium2" ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape