Open yuuval opened 6 months ago
I have the same issue
Having the same issue, is there a fix coming?
@wkaisertexas ?
I am not sure what the maintenance for this package will look like. I think over the summer I will spend a few days migrating this library to a node module to use puppeteer. Having to rely on ChromeDriverManager and other libraries to get things working creates too many debugging issues right now. Sorry about this
@wkaisertexas Okay, Thanks alot for the the detailed answer! Can you tag as or somehow notify us when you have published your wonderful work?
First let me thank @wkaisertexas for the TikTok-uploader. The following line is in the file upload.py post_button_xpath = config['selectors']['upload']['post']
replace with post_button_xpath = config['selectors']['upload']['upload_finished'] It works for me. Does anyone else have this change working? Sorry, my English is not good.
Not sure if I did something wrong, but I didn't find this line in the upload.py file, @lugor2016
Tried changing this one, that looks to be the upload button click part:
post = WebDriverWait(driver, config['implicit_wait']).until(EC.element_to_be_clickable((By.XPATH, config['selectors']['upload']['post'])))
However it didn't work either
Also, I don't know if this is caused by the error we are talking about, but the video schedule doesn't appear to be working as well
@joaovit1 In upload.py file
def _post_video(driver) -> None:
"""
Posts the video by clicking the post button
Parameters
----------
driver : selenium.webdriver
"""
logger.debug(green('Clicking the post button'))
driver.set_window_size(1920, 1080)
try:
# post_button_xpath = config['selectors']['upload']['post']
post_button_xpath = config['selectors']['upload']['upload_finished']
# pprint.pprint(config)
# Find the button element
post_button = WebDriverWait(driver, config['implicit_wait']).until(
EC.element_to_be_clickable((By.XPATH, post_button_xpath))
)
logger.debug(green('Houston, we have a click button (element is clickable)'))
# Find the form element that contains the button
#form = driver.find_element(By.XPATH, '/html/body/div[1]/div/div/div/div[2]/div[2]/div[2]')
logger.debug(green('Found the form'))
# Click the button or submit the form, depending on your use case
# post_button.click()
driver.execute_script('document.querySelector(".btn-post > button").click()')
logger.debug(green('The click has occurred'))
except ElementClickInterceptedException:
logger.debug(green("Trying to click on the button again"))
driver.execute_script('document.querySelector(".btn-post > button").click()')
except Exception as e:
logger.debug(red('Unhandled Exception!'))
print(e)
print(e.args)
post_confirmation = EC.visibility_of_element_located(
(By.XPATH, config['selectors']['upload']['post_confirmation'])
)
manage_posts = WebDriverWait(driver, config['explicit_wait']).until(post_confirmation)
manage_posts.click()
logger.debug(green('Video posted successfully'))
@lugor2016 could you maybe send a fork? For me it's also not working...
@yuuval Here is the link, the other changes that exist on my a fork I changed a lot earlier and I found them in the comments and other a forks, without them it wouldn't work for me:
https://github.com/lugor2016/tiktok-uploader
Does it work for you?
I am having the same error, but does changing the post function help if the error is when I am putting in the title? I think the error is also there for @yuuval
I kind of fixed it, change config.toml downloaded using pip and change it with config.toml given in the repository.
https://github.com/wkaisertexas/tiktok-uploader/blob/main/src/tiktok_uploader/config.toml
@lugor2016
Your approach worked... Interesting, it only seems to work with firefox and not with chrome...
But yeah that's another problem i guess. Thanks alot for your hard work!
@lugor2016
Your approach worked... Interesting, it only seems to work with firefox and not with chrome...
But yeah that's another problem i guess. Thanks alot for your hard work! @yuuval
I'm glad it helped. It works with chrome for me, I didn't need to try other browsers. :)
@Victorinox13 thanks! Changed the config.toml and it almost worked, the code went much further
Not sure if this is still related to the same issue, did someone have this error?
Something went wrong with the time picker, expected 12:00 but got 11:00
Failed to set schedule: Something went wrong with the time picker, expected 12:00 but got 11:00
Working on chrome btw
@Victorinox13 thank you! Your approach worked for me as well but I also changed line 61 in config.toml to:
post_confirmation = "//div[contains(@class, 'tiktok-modal__modal-wrapper')]//div[contains(@class, 'tiktok-modal__modal-title') and contains(text(), 'Your videos are being posted to TikTok!')]"
.
This was because the TikTok website had changed the confirmation text to Your videos are being posted to TikTok!
instead of the former Your videos are being uploaded to TikTok!
and that had broken the post confirmation in line 600 of upload.py's _post_video()
function.
Are you guys downloading firefox on a linux server and there using the tiktok-uploader? Im just wondering cause the firefox geckodriver keeps crashing with this library...
i think worked better with firefox, anyway im getting these errors:
C:\Users\jbbag\OneDrive\Escritorio\otro tik>tiktok-uploader -v video.mp4 -d "this is my escaped \"description\"" -c cookies.txt [01:02:13] Authenticating browser with cookies [01:02:13] Create a firefox browser instance in headless mode [01:02:24] Authenticating browser with cookies [01:02:27] Posting video.mp4 with description: this is my escaped "description" [01:02:27] Navigating to upload page [01:02:30] Uploading video file [01:02:34] Video should be uploading [01:02:34] Video should be uploaded Message: Stacktrace: RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8 WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5 dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
[01:03:35] Failed to upload C:\Users\jbbag\OneDrive\Escritorio\otro tik\video.mp4 [01:03:35] A video failed to upload
@Victorinox13 thank you! Your approach worked for me as well but I also changed line 61 in config.toml to:
post_confirmation = "//div[contains(@class, 'tiktok-modal__modal-wrapper')]//div[contains(@class, 'tiktok-modal__modal-title') and contains(text(), 'Your videos are being posted to TikTok!')]"
.This was because the TikTok website had changed the confirmation text to
Your videos are being posted to TikTok!
instead of the formerYour videos are being uploaded to TikTok!
and that had broken the post confirmation in line 600 of upload.py's_post_video()
function.
hey brother do you know why im getting errors after uploaded?
C:\Users\jbbag\OneDrive\Escritorio\otro tik>tiktok-uploader -v video.mp4 -d "this is my escaped \"description\"" -c cookies.txt [01:02:13] Authenticating browser with cookies [01:02:13] Create a firefox browser instance in headless mode [01:02:24] Authenticating browser with cookies [01:02:27] Posting video.mp4 with description: this is my escaped "description" [01:02:27] Navigating to upload page [01:02:30] Uploading video file [01:02:34] Video should be uploading [01:02:34] Video should be uploaded Message: Stacktrace: RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8 WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5 dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
[01:03:35] Failed to upload C:\Users\jbbag\OneDrive\Escritorio\otro tik\video.mp4 [01:03:35] A video failed to upload
Hey @wkaisertexas
Today i encountered an issue with the current version of the tiktok-uploader.
What did i do?
Error Message:
Thanks in advance for helping me out