wkaisertexas / tiktok-uploader

Automatically ⬆️ upload TikTok videos
https://pypi.org/project/tiktok-uploader/
353 stars 83 forks source link

Failed to resolve address for stun.l.google.com., errorcode: -105 after Upload video file #116

Open yuuval opened 6 months ago

yuuval commented 6 months ago

Hey @wkaisertexas

Today i encountered an issue with the current version of the tiktok-uploader.

What did i do?

pip install tiktok-uploader
tiktok-uploader.exe -v ye.mp4 -d "#fyp #ye #kanye" -c cookies.txt

Error Message:

[21:36:16] Posting ye.mp4
               with description: #fyp #ye #kanye
[21:36:16] Navigating to upload page
[3804:35180:0322/213620.923:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
[21:36:21] Uploading video file
[3804:35180:0322/213621.690:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
[3804:35180:0322/213622.107:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
[3804:35180:0322/213622.657:ERROR:socket_manager.cc(141)] Failed to resolve address for stun.l.google.com., errorcode: -105
Message: 
Stacktrace:
        GetHandleVerifier [0x009F8D03+51395]
        (No symbol) [0x00873C26]
        (No symbol) [0x0084C629]
        (No symbol) [0x0084D40D]
        GetHandleVerifier [0x00D768D3+3712147]
        GetHandleVerifier [0x00DB5CBA+3971194]
        GetHandleVerifier [0x00DB0FA8+3951464]
        GetHandleVerifier [0x00AA9D09+776393]
        (No symbol) [0x00971734]
        (No symbol) [0x0096C618]
        (No symbol) [0x0096C7C9]
        (No symbol) [0x0095DDF0]
        BaseThreadInitThunk [0x75BD7BA9+25]
        RtlInitializeExceptionChain [0x76FFBDAB+107]
        RtlClearBits [0x76FFBD2F+191]

[21:37:36] Failed to upload C:\Users\teeng\PycharmProjects\api\ye.mp4
[21:37:36]
    A video failed to upload

-------------------------
Error while uploading video

Thanks in advance for helping me out

doviethungkma commented 5 months ago

I have the same issue

joaovit1 commented 5 months ago

Having the same issue, is there a fix coming?

yuuval commented 5 months ago

@wkaisertexas ?

wkaisertexas commented 5 months ago

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

yuuval commented 5 months ago

@wkaisertexas Okay, Thanks alot for the the detailed answer! Can you tag as or somehow notify us when you have published your wonderful work?

lugor2016 commented 5 months ago

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.

joaovit1 commented 5 months ago

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

lugor2016 commented 5 months ago

@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'))
yuuval commented 5 months ago

@lugor2016 could you maybe send a fork? For me it's also not working...

lugor2016 commented 5 months ago

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

Victorinox13 commented 5 months ago

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

Victorinox13 commented 5 months ago

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

yuuval commented 5 months ago

@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 commented 5 months ago

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

joaovit1 commented 5 months ago

@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

TediSina commented 5 months ago

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

yuuval commented 5 months ago

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...

jbosolutions commented 2 months ago

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


Error while uploading video

jbosolutions commented 2 months ago

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

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


Error while uploading video