wkaisertexas / tiktok-uploader

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

Couldn't upload video #74

Closed Skyslycer closed 8 months ago

Skyslycer commented 10 months ago

Code:

schedule = datetime.datetime.today().replace(hour=17) + datetime.timedelta(days=i+1)
upload_video(part_output_path, description=description, cookies='cookies.txt', schedule=schedule)

Stacktrace:

[22:48:52] Authenticating browser with cookies [22:48:52] Create a chrome browser instance in headless mode /bin/sh: line 1: google-chrome: command not found /bin/sh: line 1: google-chrome: command not found [22:48:54] Authenticating browser with cookies [22:48:56] Posting xxx.mp4 with description: xxx [22:48:56] Navigating to upload page [22:49:03] Uploading video file Message:

Message: Stacktrace:

0 0x559d586905e3

1 0x559d583530b7

2 0x559d583a0f53

3 0x559d583a1051

4 0x559d583e69c4

5 0x559d583c7f1d

6 0x559d583e3b3d

7 0x559d583c7cc3

8 0x559d583930e4

9 0x559d583940ae

10 0x559d58656ce1

11 0x559d5865ab7e

12 0x559d586444b5

13 0x559d5865b7d6

14 0x559d58627dbf

15 0x559d5867e748

16 0x559d5867e917

17 0x559d5868f773

18 0x7f39eafe89eb

Message: Stacktrace:

0 0x559d586905e3

1 0x559d583530b7

2 0x559d583a0f53

3 0x559d583a1051

4 0x559d583e69c4

5 0x559d583c7f1d

6 0x559d583e3b3d

7 0x559d583c7cc3

8 0x559d583930e4

9 0x559d583940ae

10 0x559d58656ce1

11 0x559d5865ab7e

12 0x559d586444b5

13 0x559d5865b7d6

14 0x559d58627dbf

15 0x559d5867e748

16 0x559d5867e917

17 0x559d5868f773

18 0x7f39eafe89eb

Skyslycer commented 10 months ago

When not using the headless version, it gets to the schedule, opens the selection menu but doesn't select it:

[23:11:31] Failed to set schedule: Message: element not interactable (Session info: chrome=119.0.6045.159) Stacktrace:

0 0x5579fc3c75e3

1 0x5579fc089f0d

2 0x5579fc0d95e6

3 0x5579fc0cc1a0

4 0x5579fc0feef2

5 0x5579fc0cba02

6 0x5579fc0ff0be

7 0x5579fc11ab3d

8 0x5579fc0fecc3

9 0x5579fc0ca0e4

10 0x5579fc0cb0ae

11 0x5579fc38dce1

12 0x5579fc391b7e

13 0x5579fc37b4b5

14 0x5579fc3927d6

15 0x5579fc35edbf

16 0x5579fc3b5748

17 0x5579fc3b5917

18 0x5579fc3c6773

19 0x7f6df31929eb

[23:11:31] Failed to upload xxx.mp4 [23:11:31] A video failed to upload

Skyslycer commented 10 months ago

Any ideas?

enzoRsl commented 10 months ago

Hello,

I reproduced in debug

The process is infinite waiting at : WebDriverWait(driver, config['explicit_wait']).until(upload_progress) in upload.py at line 346

for _ in range(num_retries):
        try:
            _change_to_upload_iframe(driver)
            upload_box = driver.find_element(
                By.XPATH, config['selectors']['upload']['upload_video']
            )
            upload_box.send_keys(path)
            # waits for the upload progress bar to disappear
            upload_progress = EC.presence_of_element_located(
                (By.XPATH, config['selectors']['upload']['upload_in_progress'])
                )
            WebDriverWait(driver, config['explicit_wait']).until(upload_progress)
lavanphat commented 10 months ago

I have same error. I fixed by increase explicit_wait from 60 seconds to 300 seconds (5 minutes) and it worked for me. You can edit explicit_wait in .venv\Lib\site-packages\tiktok_uploader\config.toml

enzoRsl commented 10 months ago

I have same error. I fixed by increase explicit_wait from 60 seconds to 300 seconds (5 minutes) and it worked for me. You can edit explicit_wait in .venv\Lib\site-packages\tiktok_uploader\config.toml

It don't works for me.

I think it's because waiting for cancel button is made by english language. upload_in_progress = "//*[.='Cancel']"

Despite there is ?lang=en in the url, it opened the page with french language and i think the cancel button is never found.

I tried to fix that in this PR #77 and it works for me

Skyslycer commented 10 months ago

I have same error. I fixed by increase explicit_wait from 60 seconds to 300 seconds (5 minutes) and it worked for me. You can edit explicit_wait in .venv\Lib\site-packages\tiktok_uploader\config.toml

Tried this, doesn't work. Maybe some input from the author?

wkaisertexas commented 8 months ago

I have trouble testing the module now that my web driver does not work being on Apple Silicon. Going to be releasing a major new version in about a week.

wkaisertexas commented 8 months ago

Also, why does everyone keep posting their stack traces as if the error message would be useful