wkaisertexas / tiktok-uploader

Automatically ⬆️ upload TikTok videos
https://pypi.org/project/tiktok-uploader/
MIT License
390 stars 91 forks source link

Fails while uploading video #89

Closed andrewCohn closed 10 months ago

andrewCohn commented 10 months ago

I think this is potentially related to #74, #82 or #88, but essentially, after the library gets the selinum session running and authenticated, and it begins to upload videos, it prints "Message: ", then fails and prints a stack trace. Here is an example (with the video file path and descriptions removed):

aj@andy-server:~/netShare$ python3 shipper.py
[20:06:39] Authenticating browser with cookies
[20:06:39] Uploading 239 videos
[20:06:39] Create a chrome browser instance in headless mode
[20:06:45] Authenticating browser with cookies
[20:07:06] Posting video: vid_file_path
               with description: description
[20:07:06] Navigating to upload page
[20:07:22] Uploading video file
Message:
Stacktrace:
#0 0x5575be3f5f83 <unknown>
#1 0x5575be0aecf7 <unknown>
#2 0x5575be0fe99e <unknown>
#3 0x5575be0feaa1 <unknown>
#4 0x5575be149d64 <unknown>
#5 0x5575be1280dd <unknown>
#6 0x5575be147006 <unknown>
#7 0x5575be127e53 <unknown>
#8 0x5575be0efdd4 <unknown>
#9 0x5575be0f11de <unknown>
#10 0x5575be3ba531 <unknown>
#11 0x5575be3be455 <unknown>
#12 0x5575be3a6f55 <unknown>
#13 0x5575be3bf0ef <unknown>
#14 0x5575be38a99f <unknown>
#15 0x5575be3e3008 <unknown>
#16 0x5575be3e31d7 <unknown>
#17 0x5575be3f5124 <unknown>
#18 0x7fe7f72c9ac3 <unknown>

[20:08:47] Failed to upload vid_path

I'm not entirely sure of any steps to reproduce, because this always happens when I use the library. To try to fix this, I have tried compiling from the build at https://github.com/ashaid/tiktok-uploader which alleges to fix the new UI issues. I also increased the explicit timeout from 60 seconds to 500. Nonetheless, I still have the same issue. Thank you very much for any help!

gavink97 commented 10 months ago

Have you tried creating a new cookie.txt file and using that?

andrewCohn commented 10 months ago

Have you tried creating a new cookie.txt file and using that?

Just redumped them using the recomended tool (get browser cookies locally), and had the same issue. I think it makes it past the authentication step (it makes it all the way to the upload stage), but fails to actually upload the video. I've also changed the explicit wait back to 60 seconds (changing it didn't seem to do much) and recompiled with the main branch here. It's also worth noting it prints the same stack trace every time it fails. Also, same behavior uploading a single video straight from my terminal. It's worth noting I'm on ubuntu 22.04.

andrewCohn commented 10 months ago

A little update: When I run the code on my windows machine, with headless mode off so I can see what's going on, it uploads the video file, and gets to the post page, then fails to hit the post button. The exception causing the stacktrace doesn't seem to do anything, and it seems to timeout after it sits on the post page for 60 seconds.

Merging #87 could fix (although it didn't work for me)

Zegervg commented 10 months ago

A little update: When I run the code on my windows machine, with headless mode off so I can see what's going on, it uploads the video file, and gets to the post page, then fails to hit the post button. The exception causing the stacktrace doesn't seem to do anything, and it seems to timeout after it sits on the post page for 60 seconds.

Merging #87 could fix (although it didn't work for me)

yeah neither for me. juts implement a waiting time for that part. idk how to make a proper fix for it

gavink97 commented 10 months ago

A little update: When I run the code on my windows machine, with headless mode off so I can see what's going on, it uploads the video file, and gets to the post page, then fails to hit the post button. The exception causing the stacktrace doesn't seem to do anything, and it seems to timeout after it sits on the post page for 60 seconds.

Merging #87 could fix (although it didn't work for me)

Are you using Chrome? It seems Chrome is not working but it does on Firefox.

andrewCohn commented 10 months ago

Are you using Chrome? It seems Chrome is not working but it does on Firefox.

This was it. Tiktok is broken on Chrome for now. I just submit a pr which gets it working on firefox.

gavink97 commented 10 months ago

BTW as of writing this there is a bug with Firefox version 121.0 that breaks the Geckodriver. If you're having this issue please try rolling back to version 120.0. mozilla/geckodriver#2144

andrewCohn commented 10 months ago

BTW as of writing this there is a bug with Firefox version 121.0 that breaks the Geckodriver. If you're having this issue please try rolling back to version 120.0. mozilla/geckodriver#2144

Which issue? For me, CHROME was the problem, and switching over to firefox fixed the issue for me.

MarshmallowB commented 10 months ago

@andrewCohn what firefox and gecko version you have? i have problems with geckodriver 0.33 so i moved to 0.32 but still cant upload :/

andrewCohn commented 10 months ago

@andrewCohn what firefox and gecko version you have? i have problems with geckodriver 0.33 so i moved to 0.32 but still cant upload :/

Im using firefox 120.1. To get firefox working with selenium I had to install the version from the mozilla PPA rather then the snap store, so maybe try that?

pablol314 commented 10 months ago

andresCohn fork with chrome works for me (headless included). With firefox finish ok the process but then doesnt upload the video. I put a time.sleep(5) here:

            upload_box = driver.find_element(
                By.XPATH, config['selectors']['upload']['upload_video']
            )
            time.sleep(5)
            upload_box.send_keys(path)
romanrsr commented 10 months ago

andresCohn fork with chrome works for me (headless included). With firefox finish ok the process but then doesnt upload the video. I put a time.sleep(5) here:

            upload_box = driver.find_element(
                By.XPATH, config['selectors']['upload']['upload_video']
            )
            time.sleep(5)
            upload_box.send_keys(path)

What version of Chrome are you using? I am using the andresCohn fork, but with Chrome it stays at the message: Video should be uploaded

And with Firefox finish ok the process but then doesn't upload the video

wkaisertexas commented 10 months ago

Yeah, a lot of these are interrelated issues. The upload button's selector is off plus a bunch of other ui changes. Will push a new version soon.

Zegervg commented 10 months ago

Yeah, a lot of these are interrelated issues. The upload button's selector is off plus a bunch of other ui changes. Will push a new version soon.

W