wkaisertexas / tiktok-uploader

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

Schedule not working #50

Closed diegotrasobares closed 1 year ago

diegotrasobares commented 1 year ago

When I try to upload one video using the datetime for schedule it always fails with the following message:

Failed to set schedule: Something went wrong with the time picker, expected 18:00 but got 17:00 [17:11:30] Something went wrong with the time picker, expected 18:00 but got 17:00 [17:11:30] Failed to set schedule: Something went wrong with the time picker, expected 18:00 but got 17:00

My code is very simple:

 import datetime
from tiktok_uploader.upload import upload_video

schedule = datetime.datetime(2023, 9, 26, 18, 0)
upload_video(filename="../result/part_1_with_text.mp4",description="Just a test" ,cookies="./static/cookies.txt",
             schedule=schedule) 

Any thoughts?

wkaisertexas commented 1 year ago

@XavierZambrano wrote the scheduler code

diegotrasobares commented 1 year ago

Oh okey. @XavierZambrano can you help a bit here please :)

XavierZambrano commented 1 year ago

def __time_picker is not working fine

You can try to :

  1. add time.sleep() between driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'nearest'});", hour_to_click) hour_to_click.click()
  2. Check if the selector changed hour_options = driver.find_elements(By.XPATH, config['selectors']['schedule']['timepicker_hours'])
  3. Execute without headless and watch what is happening
diegotrasobares commented 1 year ago

@XavierZambrano selectors where looking good. I added the time.sleep() and now its working fine, giving a few seconds to select the elements. Thanks!