wkaisertexas / tiktok-uploader

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

updated post confirmation to match new TikTok UI #87

Closed gavink97 closed 8 months ago

gavink97 commented 9 months ago

TikTok updated their post confirmation UI which was making this error. Resulting in not uploading to TikTok. This update address those issues by clicking "Manage your posts" on the confirmation screen.

gavink97 commented 8 months ago

If we keep upload lang=en in the config.toml wouldn't that prevent issues relating to localization? upload = "https://www.tiktok.com/creator-center/upload?lang=en"

I can see if there's a better xpath to grab onto.

TheIndependentBrotherhood commented 8 months ago

Hi, I can confirm that despite the presence of lang=en, for me the page is still displayed in French...

gavink97 commented 8 months ago

Hi, I can confirm that despite the presence of lang=en, for me the page is still displayed in French...

Interesting, thanks for sharing. I'll come up with a new method for this.

andrewCohn commented 8 months ago

Hi, I can confirm that despite the presence of lang=en, for me the page is still displayed in French...

Interesting, thanks for sharing. I'll come up with a new method for this.

my fork is based off yours, and I never got the page to display french. I'm from an english speaking region. Could tiktok be loading a different language based on location?

TheIndependentBrotherhood commented 8 months ago

Maybe, I've just checked the cookies and I see two pieces of information set to "fr" for French : tiktok_webapp_lang, which defines the language of my interface, and another which is currently unknown to me: store-country-code. tiktok_webapp_lang is set to the right value if I change the interface language via my profile icon at the top right, then "🅰️ " button (here : 🅰️ English) image

gavink97 commented 8 months ago

Alright I went ahead and pushed out the changes. I switched post_confirmation from selecting by xpath to selecting by css selector which seems to work. I also updated the window size because you could not previous click the post button at a vertical height of 1080 and added a wait for the full page reload.

JackBird15 commented 8 months ago

I'm getting this error from this branch, but I'm not sure if I've just set it up incorrectly.

jack@thenest:~/sambashare/CustomScripts/PythonScripts/tiktok-uploader$ tiktok-uploader -v /home/jack/sambashare/MeTube/Uploaded/Me.mp4 -d "this is my escaped \"description\"" -c /home/jack/cookies.txt [16:09:08] Authenticating browser with cookies [16:09:08] Create a chrome browser instance in headless mode [16:09:09] Authenticating browser with cookies [16:09:15] Posting /home/jack/sambashare/MeTube/Uploaded/Me.mp4 with description: this is my escaped "description" [16:09:15] Navigating to upload page [16:09:20] Uploading video file Message: Stacktrace:

0 0x556ff25d6f83

1 0x556ff228fcf7

2 0x556ff22df99e

3 0x556ff22dfaa1

4 0x556ff232ad64

5 0x556ff23090dd

6 0x556ff2328006

7 0x556ff2308e53

8 0x556ff22d0dd4

9 0x556ff22d21de

10 0x556ff259b531

11 0x556ff259f455

12 0x556ff2587f55

13 0x556ff25a00ef

14 0x556ff256b99f

15 0x556ff25c4008

16 0x556ff25c41d7

17 0x556ff25d6124

18 0x7fb66b4e5ac3

[16:11:06] Failed to upload /home/jack/sambashare/MeTube/Uploaded/Me.mp4 [16:11:06] A video failed to upload

gavink97 commented 8 months ago

I'm getting this error from this branch, but I'm not sure if I've just set it up incorrectly.

Have you tried deleting your cookie txt file and making a new one?

JackBird15 commented 8 months ago

I'm getting this error from this branch, but I'm not sure if I've just set it up incorrectly.

Have you tried deleting your cookie txt file and making a new one?

Hi, I just tried this and unfortunately get the same errors, when I use the GetCookies.txt locally plugin, I'm exporting as Netscape and TableNoWrap is true. Does that seem all correct?

gavink97 commented 8 months ago

[16:09:08] Create a chrome browser instance in headless mode

I noticed you're using Chrome for your webdriver. As of right now Chrome isn't working. Try using Firefox instead.

JackBird15 commented 8 months ago

[16:09:08] Create a chrome browser instance in headless mode

I noticed you're using Chrome for your webdriver. As of right now Chrome isn't working. Try using Firefox instead.

oh my mistake, okay thank you! :))

JackBird15 commented 8 months ago

[16:09:08] Create a chrome browser instance in headless mode

I noticed you're using Chrome for your webdriver. As of right now Chrome isn't working. Try using Firefox instead.

Does this mean currently it does not work in headless at all ?

gavink97 commented 8 months ago

Does this mean currently it does not work in headless at all ?

No, it should work in headless Firefox.

JackBird15 commented 8 months ago

Does this mean currently it does not work in headless at all ?

No, it should work in headless Firefox.

i seem to be getting this now [22:29:09] Authenticating browser with cookies [22:29:09] Create a firefox browser instance in headless mode [22:29:13] Authenticating browser with cookies [22:29:15] Posting /home/jack/sambashare/MeTube/Uploaded/Me.mp4 with description: This is a video I just downloaded [22:29:15] Navigating to upload page [22:29:18] Uploading video file Message: Stacktrace: RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8 WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:189:5 NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:507:5 dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:132:16

[22:30:59] Failed to upload /home/jack/sambashare/MeTube/Uploaded/Me.mp4 [22:30:59] A video failed to upload

haydeninghem commented 8 months ago

@wkaisertexas can you please review the PR

wkaisertexas commented 8 months ago

The changed committed do not follow the format of the project. Throughout the project, configuration for explicit and implicit waits in the config.toml was used to make the process more generalizable.

Furthermore, some people have way slower wifi connections than others, so you must be careful with the explicit waits used everywhere.

wkaisertexas commented 8 months ago

Also, if you want your PR reviewed, change it to no longer be a draft PR. A draft PR implies a work in progress.