tiktokautouploader 3.7__py2.py3-none-any.whl → 3.16__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tiktokautouploader/function.py +120 -193
- {tiktokautouploader-3.7.dist-info → tiktokautouploader-3.16.dist-info}/METADATA +5 -11
- tiktokautouploader-3.16.dist-info/RECORD +7 -0
- tiktokautouploader/Js_assets/package.json +0 -12
- tiktokautouploader-3.7.dist-info/RECORD +0 -8
- {tiktokautouploader-3.7.dist-info → tiktokautouploader-3.16.dist-info}/WHEEL +0 -0
- {tiktokautouploader-3.7.dist-info → tiktokautouploader-3.16.dist-info}/licenses/LICENSE.md +0 -0
tiktokautouploader/function.py
CHANGED
@@ -54,14 +54,11 @@ def run_javascript():
|
|
54
54
|
def install_js_dependencies():
|
55
55
|
js_dir = pkg_resources.resource_filename(__name__, 'Js_assets')
|
56
56
|
node_modules_path = os.path.join(js_dir, 'node_modules')
|
57
|
-
|
57
|
+
|
58
58
|
if not os.path.exists(node_modules_path):
|
59
59
|
print("JavaScript dependencies not found. Installing...")
|
60
|
-
|
61
|
-
|
62
|
-
except subprocess.CalledProcessError as e:
|
63
|
-
print("An error occurred during npm installation.")
|
64
|
-
print(f"Error details: {e}")
|
60
|
+
subprocess.run(['npm', 'install', 'playwright', 'playwright-extra', 'puppeteer-extra-plugin-stealth', '--silent'], cwd=js_dir, check=True)
|
61
|
+
subprocess.run(['npx', 'playwright', 'install', 'chromium'], cwd=js_dir, check=True)
|
65
62
|
else:
|
66
63
|
time.sleep(0.1)
|
67
64
|
|
@@ -146,7 +143,7 @@ def run_inference_on_image_tougher(image_path, object):
|
|
146
143
|
|
147
144
|
k = 'n|KIeDZnRZiJ};iVHz;R'
|
148
145
|
rk = ''.join(chr((ord(c) - 3) % 256) for c in k)
|
149
|
-
|
146
|
+
|
150
147
|
CLIENT = InferenceHTTPClient(
|
151
148
|
api_url="https://detect.roboflow.com",
|
152
149
|
api_key=f"{rk}"
|
@@ -238,14 +235,13 @@ def click_on_objects(page, object_coords):
|
|
238
235
|
|
239
236
|
|
240
237
|
|
241
|
-
def upload_tiktok(video, description, accountname, hashtags=None, sound_name=None, sound_aud_vol='mix', schedule=None, day=None, copyrightcheck=False, suppressprint=False
|
238
|
+
def upload_tiktok(video, description, accountname, hashtags=None, sound_name=None, sound_aud_vol='mix', schedule=None, day=None, copyrightcheck=False, suppressprint=False):
|
242
239
|
|
243
240
|
"""
|
244
241
|
UPLOADS VIDEO TO TIKTOK
|
245
242
|
------------------------------------------------------------------------------------------------------------------------------------------------c
|
246
243
|
video (str) -> path to video to upload
|
247
244
|
description (str) -> description for video
|
248
|
-
accountname (str) -> account to upload on
|
249
245
|
hashtags (str)(array) -> hashtags for video
|
250
246
|
sound_name (str) -> name of tik tok sound to use for video
|
251
247
|
sound_aud_vol (str) -> volume of tik tok sound, 'main', 'mix' or 'background', check documentation for more info -> https://github.com/haziq-exe/TikTokAutoUploader
|
@@ -253,7 +249,6 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
253
249
|
day (int) -> day to schedule video for, check documentation for more info -> https://github.com/haziq-exe/TikTokAutoUploader
|
254
250
|
copyrightcheck (bool) -> include copyright check or not; CODE FAILS IF FAIL COPYRIGHT CHECK
|
255
251
|
suppressprint (bool) -> True means function doesnt print anything to provide updates on progress
|
256
|
-
headless (bool) -> run in headless mode or not
|
257
252
|
--------------------------------------------------------------------------------------------------------------------------------------------
|
258
253
|
"""
|
259
254
|
try:
|
@@ -289,7 +284,8 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
289
284
|
|
290
285
|
with sync_playwright() as p:
|
291
286
|
|
292
|
-
browser = p.firefox.launch(headless=
|
287
|
+
browser = p.firefox.launch(headless=True)
|
288
|
+
|
293
289
|
context = browser.new_context()
|
294
290
|
context.add_cookies(cookies)
|
295
291
|
page = context.new_page()
|
@@ -475,16 +471,13 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
475
471
|
print("Description and Hashtags added")
|
476
472
|
|
477
473
|
try:
|
478
|
-
page.
|
474
|
+
page.wait_for_function("document.querySelector('.info-progress-num').textContent.trim() === '100%'", timeout=12000000)
|
479
475
|
except:
|
480
476
|
sys.exit("ERROR: TIK TOK TOOK TOO LONG TO UPLOAD YOUR FILE (>20min). Try again, if issue persists then try a lower file size or different wifi connection")
|
481
477
|
|
482
478
|
time.sleep(0.2)
|
483
479
|
if suppressprint == False:
|
484
480
|
print("Tik tok done loading file onto servers")
|
485
|
-
|
486
|
-
if (schedule == None) and (day != None):
|
487
|
-
sys.exit("ERROR: CANT SCHEDULE FOR ANOTHER DAY USING 'day' WITHOUT ALSO INCLUDING TIME OF UPLOAD WITH 'schedule'; PLEASE ALSO INCLUDE TIME WITH 'schedule' PARAMETER")
|
488
481
|
|
489
482
|
if schedule != None:
|
490
483
|
try:
|
@@ -496,39 +489,31 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
496
489
|
except:
|
497
490
|
sys.exit("SCHEDULE TIME ERROR: PLEASE MAKE SURE YOUR SCHEDULE TIME IS A STRING THAT FOLLOWS THE 24H FORMAT 'HH:MM', VIDEO SAVED AS DRAFT")
|
498
491
|
|
499
|
-
page.locator('div.TUXRadioStandalone.TUXRadioStandalone--medium
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
time.sleep(0.
|
507
|
-
else:
|
508
|
-
if page.locator('div.TUXTextInputCore-trailingIconWrapper').nth(1).is_visible():
|
509
|
-
visible = True
|
510
|
-
time.sleep(0.1)
|
492
|
+
page.locator('div.TUXRadioStandalone.TUXRadioStandalone--medium').nth(1).click()
|
493
|
+
time.sleep(1)
|
494
|
+
if page.locator('button.TUXButton.TUXButton--default.TUXButton--medium.TUXButton--primary:has-text("Allow")').nth(0).is_visible():
|
495
|
+
page.locator('button.TUXButton.TUXButton--default.TUXButton--medium.TUXButton--primary:has-text("Allow")').nth(0).click()
|
496
|
+
time.sleep(0.2)
|
497
|
+
else:
|
498
|
+
if page.locator('div.TUXTextInputCore-trailingIconWrapper').nth(1).is_visible():
|
499
|
+
time.sleep(0.2)
|
511
500
|
if day != None:
|
512
|
-
page.locator('div.TUXTextInputCore-
|
501
|
+
page.locator('div.TUXTextInputCore-trailingIconWrapper').nth(1).click()
|
513
502
|
time.sleep(0.2)
|
514
503
|
try:
|
515
|
-
page.locator(f'span.day.valid:text
|
504
|
+
page.locator(f'span.day.valid:has-text("{day}")').click()
|
516
505
|
except:
|
517
506
|
sys.exit("SCHEDULE DAY ERROR: ERROR WITH SCHEDULED DAY, read documentation for more information on format of day")
|
518
507
|
try:
|
508
|
+
time.sleep(1)
|
509
|
+
page.locator('div.TUXTextInputCore-trailingIconWrapper').nth(0).click()
|
519
510
|
time.sleep(0.2)
|
520
|
-
page.locator('
|
521
|
-
time.sleep(0.2)
|
522
|
-
page.locator(f'.tiktok-timepicker-option-text.tiktok-timepicker-right:text-is("{minute}")').scroll_into_view_if_needed()
|
511
|
+
page.locator(f'.tiktok-timepicker-option-text.tiktok-timepicker-right:has-text("{minute}")').nth(0).scroll_into_view_if_needed()
|
523
512
|
time.sleep(0.2)
|
524
|
-
page.locator(f'.tiktok-timepicker-option-text.tiktok-timepicker-right:text
|
513
|
+
page.locator(f'.tiktok-timepicker-option-text.tiktok-timepicker-right:has-text("{minute}")').nth(0).click()
|
525
514
|
time.sleep(0.2)
|
526
|
-
|
527
|
-
|
528
|
-
else:
|
529
|
-
page.locator('div.TUXTextInputCore-leadingIconWrapper:has(svg > path[d="M24 2a22 22 0 1 0 0 44 22 22 0 0 0 0-44ZM6 24a18 18 0 1 1 36 0 18 18 0 0 1-36 0Z"])').click()
|
530
|
-
page.locator(f'.tiktok-timepicker-option-text.tiktok-timepicker-left:text-is("{hour}")').scroll_into_view_if_needed()
|
531
|
-
page.locator(f'.tiktok-timepicker-option-text.tiktok-timepicker-left:text-is("{hour}")').click()
|
515
|
+
page.locator(f'.tiktok-timepicker-option-text:has-text("{hour}")').nth(0).scroll_into_view_if_needed()
|
516
|
+
page.locator(f'.tiktok-timepicker-option-text:has-text("{hour}")').nth(0).click()
|
532
517
|
time.sleep(1)
|
533
518
|
|
534
519
|
if suppressprint == False:
|
@@ -536,14 +521,93 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
536
521
|
|
537
522
|
except:
|
538
523
|
sys.exit("SCHEDULING ERROR: VIDEO SAVED AS DRAFT")
|
524
|
+
|
525
|
+
if (schedule == None) and (day != None):
|
526
|
+
sys.exit("ERROR: CANT SCHEDULE FOR ANOTHER DAY USING 'day' WITHOUT ALSO INCLUDING TIME OF UPLOAD WITH 'schedule'; PLEASE ALSO INCLUDE TIME WITH 'schedule' PARAMETER")
|
527
|
+
|
528
|
+
if(sound_name == None):
|
529
|
+
if copyrightcheck == True:
|
530
|
+
page.locator(".TUXSwitch-input").nth(0).click()
|
531
|
+
while copyrightcheck == True:
|
532
|
+
time.sleep(0.2)
|
533
|
+
if page.locator("span", has_text="No issues detected.").is_visible():
|
534
|
+
if suppressprint == False:
|
535
|
+
print("Copyright check complete")
|
536
|
+
break
|
537
|
+
if page.locator("span", has_text="Copyright issues detected.").is_visible():
|
538
|
+
sys.exit("COPYRIGHT CHECK FAILED: COPYRIGHT AUDIO DETECTED FROM TIKTOK")
|
539
|
+
|
540
|
+
if schedule == None:
|
541
|
+
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Post")', timeout=10000)
|
542
|
+
uploaded = False
|
543
|
+
checks = 0
|
544
|
+
while uploaded == False:
|
545
|
+
if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
|
546
|
+
time.sleep(0.2)
|
547
|
+
break
|
548
|
+
time.sleep(0.2)
|
549
|
+
checks += 1
|
550
|
+
if checks > 100:
|
551
|
+
time.sleep(10)
|
552
|
+
if checks == 150:
|
553
|
+
break
|
554
|
+
else:
|
555
|
+
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Schedule")', timeout=10000)
|
556
|
+
uploaded = False
|
557
|
+
checks = 0
|
558
|
+
while uploaded == False:
|
559
|
+
if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
|
560
|
+
time.sleep(0.2)
|
561
|
+
break
|
562
|
+
time.sleep(0.2)
|
563
|
+
checks += 1
|
564
|
+
if checks > 100:
|
565
|
+
time.sleep(10)
|
566
|
+
if checks == 150:
|
567
|
+
break
|
568
|
+
if suppressprint == False:
|
569
|
+
print("Done uploading video, NOTE: it may take a minute or two to show on TikTok")
|
570
|
+
|
571
|
+
page.close()
|
539
572
|
|
540
|
-
|
541
|
-
if sound_name != None:
|
573
|
+
else:
|
542
574
|
try:
|
543
|
-
page.click(
|
575
|
+
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--secondary:has-text("Save draft")', timeout=10000)
|
576
|
+
except:
|
577
|
+
sys.exit("SAVE AS DRAFT BUTTON NOT FOUND; CANNOT ADD SOUND WITHOUT ABILITY TO SAVE DRAFTS")
|
578
|
+
|
579
|
+
time.sleep(0.5)
|
580
|
+
page.close()
|
581
|
+
|
582
|
+
browser = p.chromium.launch(headless=True)
|
583
|
+
|
584
|
+
context = browser.new_context()
|
585
|
+
context.add_cookies(cookies)
|
586
|
+
page = context.new_page()
|
587
|
+
url2 = 'https://www.tiktok.com/tiktokstudio/content?tab=draft'
|
588
|
+
|
589
|
+
while retries < 2:
|
590
|
+
try:
|
591
|
+
page.goto(url2, timeout=30000)
|
592
|
+
except:
|
593
|
+
retries +=1
|
594
|
+
time.sleep(5)
|
595
|
+
if retries == 2:
|
596
|
+
sys.exit("ERROR: TIK TOK PAGE FAILED TO LOAD, try again.")
|
597
|
+
else:
|
598
|
+
break
|
599
|
+
|
600
|
+
try:
|
601
|
+
page.wait_for_selector("path[d='M37.37 4.85a4.01 4.01 0 0 0-.99-.79 3 3 0 0 0-2.72 0c-.45.23-.81.6-1 .79a9 9 0 0 1-.04.05l-19.3 19.3c-1.64 1.63-2.53 2.52-3.35 3.47a36 36 0 0 0-4.32 6.16c-.6 1.1-1.14 2.24-2.11 4.33l-.3.6c-.4.75-.84 1.61-.8 2.43a2.5 2.5 0 0 0 2.37 2.36c.82.05 1.68-.4 2.44-.79l.59-.3c2.09-.97 3.23-1.5 4.33-2.11a36 36 0 0 0 6.16-4.32c.95-.82 1.84-1.71 3.47-3.34l19.3-19.3.05-.06a3 3 0 0 0 .78-3.71c-.22-.45-.6-.81-.78-1l-.02-.02-.03-.03-3.67-3.67a8.7 8.7 0 0 1-.06-.05ZM16.2 26.97 35.02 8.15l2.83 2.83L19.03 29.8c-1.7 1.7-2.5 2.5-3.33 3.21a32 32 0 0 1-7.65 4.93 32 32 0 0 1 4.93-7.65c.73-.82 1.51-1.61 3.22-3.32Z']")
|
602
|
+
page.click("path[d='M37.37 4.85a4.01 4.01 0 0 0-.99-.79 3 3 0 0 0-2.72 0c-.45.23-.81.6-1 .79a9 9 0 0 1-.04.05l-19.3 19.3c-1.64 1.63-2.53 2.52-3.35 3.47a36 36 0 0 0-4.32 6.16c-.6 1.1-1.14 2.24-2.11 4.33l-.3.6c-.4.75-.84 1.61-.8 2.43a2.5 2.5 0 0 0 2.37 2.36c.82.05 1.68-.4 2.44-.79l.59-.3c2.09-.97 3.23-1.5 4.33-2.11a36 36 0 0 0 6.16-4.32c.95-.82 1.84-1.71 3.47-3.34l19.3-19.3.05-.06a3 3 0 0 0 .78-3.71c-.22-.45-.6-.81-.78-1l-.02-.02-.03-.03-3.67-3.67a8.7 8.7 0 0 1-.06-.05ZM16.2 26.97 35.02 8.15l2.83 2.83L19.03 29.8c-1.7 1.7-2.5 2.5-3.33 3.21a32 32 0 0 1-7.65 4.93 32 32 0 0 1 4.93-7.65c.73-.82 1.51-1.61 3.22-3.32Z']")
|
603
|
+
page.wait_for_selector('div[data-contents="true"]')
|
604
|
+
page.wait_for_function("document.querySelector('.info-progress-num').textContent.trim() === '100%'", timeout=3000000)
|
605
|
+
time.sleep(0.2)
|
544
606
|
except:
|
545
|
-
|
546
|
-
|
607
|
+
sys.exit("ERROR ADDING SOUND: Video saved as draft")
|
608
|
+
|
609
|
+
if sound_name != None:
|
610
|
+
page.click("div.TUXButton-label:has-text('Edit video')")
|
547
611
|
page.wait_for_selector("input.search-bar-input")
|
548
612
|
page.fill(f"input.search-bar-input", f"{sound_name}")
|
549
613
|
time.sleep(0.2)
|
@@ -596,12 +660,11 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
596
660
|
page.click("div.TUXButton-label:has-text('Save edit')")
|
597
661
|
if suppressprint == False:
|
598
662
|
print("Added sound")
|
599
|
-
|
600
|
-
if sound_fail == False:
|
663
|
+
|
601
664
|
page.wait_for_selector('div[data-contents="true"]')
|
602
665
|
|
603
666
|
if copyrightcheck == True:
|
604
|
-
page.
|
667
|
+
page.locator(".TUXSwitch-input").nth(0).click()
|
605
668
|
while copyrightcheck == True:
|
606
669
|
time.sleep(0.2)
|
607
670
|
if page.locator("span", has_text="No issues detected.").is_visible():
|
@@ -617,151 +680,15 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
617
680
|
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Post")', timeout=10000)
|
618
681
|
uploaded = False
|
619
682
|
checks = 0
|
620
|
-
while uploaded == False:
|
621
|
-
if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
|
622
|
-
time.sleep(0.1)
|
623
|
-
break
|
624
|
-
time.sleep(0.2)
|
625
|
-
checks += 1
|
626
|
-
if checks == 25:
|
627
|
-
break
|
628
|
-
else:
|
629
|
-
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Schedule")', timeout=10000)
|
630
|
-
uploaded = False
|
631
|
-
checks = 0
|
632
683
|
while uploaded == False:
|
633
684
|
if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
|
634
685
|
time.sleep(0.2)
|
635
686
|
break
|
636
687
|
time.sleep(0.2)
|
637
688
|
checks += 1
|
638
|
-
if checks
|
639
|
-
|
640
|
-
|
641
|
-
print("Done uploading video, NOTE: it may take a minute or two to show on TikTok")
|
642
|
-
except:
|
643
|
-
time.sleep(2)
|
644
|
-
sys.exit("POSSIBLE ERROR UPLOADING: Cannot confirm if uploaded successfully, Please check account in a minute or two to confirm.")
|
645
|
-
time.sleep(1)
|
646
|
-
|
647
|
-
page.close()
|
648
|
-
else:
|
649
|
-
try:
|
650
|
-
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--secondary:has-text("Save draft")', timeout=10000)
|
651
|
-
except:
|
652
|
-
sys.exit("SAVE AS DRAFT BUTTON NOT FOUND; Please try account that has ability to save as draft")
|
653
|
-
|
654
|
-
time.sleep(0.5)
|
655
|
-
page.close()
|
656
|
-
|
657
|
-
browser = p.chromium.launch(headless=headless)
|
658
|
-
|
659
|
-
context = browser.new_context()
|
660
|
-
context.add_cookies(cookies)
|
661
|
-
page = context.new_page()
|
662
|
-
url2 = 'https://www.tiktok.com/tiktokstudio/content?tab=draft'
|
663
|
-
|
664
|
-
while retries < 2:
|
665
|
-
try:
|
666
|
-
page.goto(url2, timeout=30000)
|
667
|
-
except:
|
668
|
-
retries +=1
|
669
|
-
time.sleep(5)
|
670
|
-
if retries == 2:
|
671
|
-
sys.exit("ERROR: TIK TOK PAGE FAILED TO LOAD, try again.")
|
672
|
-
else:
|
673
|
-
break
|
674
|
-
|
675
|
-
try:
|
676
|
-
page.wait_for_selector("path[d='M37.37 4.85a4.01 4.01 0 0 0-.99-.79 3 3 0 0 0-2.72 0c-.45.23-.81.6-1 .79a9 9 0 0 1-.04.05l-19.3 19.3c-1.64 1.63-2.53 2.52-3.35 3.47a36 36 0 0 0-4.32 6.16c-.6 1.1-1.14 2.24-2.11 4.33l-.3.6c-.4.75-.84 1.61-.8 2.43a2.5 2.5 0 0 0 2.37 2.36c.82.05 1.68-.4 2.44-.79l.59-.3c2.09-.97 3.23-1.5 4.33-2.11a36 36 0 0 0 6.16-4.32c.95-.82 1.84-1.71 3.47-3.34l19.3-19.3.05-.06a3 3 0 0 0 .78-3.71c-.22-.45-.6-.81-.78-1l-.02-.02-.03-.03-3.67-3.67a8.7 8.7 0 0 1-.06-.05ZM16.2 26.97 35.02 8.15l2.83 2.83L19.03 29.8c-1.7 1.7-2.5 2.5-3.33 3.21a32 32 0 0 1-7.65 4.93 32 32 0 0 1 4.93-7.65c.73-.82 1.51-1.61 3.22-3.32Z']")
|
677
|
-
page.click("path[d='M37.37 4.85a4.01 4.01 0 0 0-.99-.79 3 3 0 0 0-2.72 0c-.45.23-.81.6-1 .79a9 9 0 0 1-.04.05l-19.3 19.3c-1.64 1.63-2.53 2.52-3.35 3.47a36 36 0 0 0-4.32 6.16c-.6 1.1-1.14 2.24-2.11 4.33l-.3.6c-.4.75-.84 1.61-.8 2.43a2.5 2.5 0 0 0 2.37 2.36c.82.05 1.68-.4 2.44-.79l.59-.3c2.09-.97 3.23-1.5 4.33-2.11a36 36 0 0 0 6.16-4.32c.95-.82 1.84-1.71 3.47-3.34l19.3-19.3.05-.06a3 3 0 0 0 .78-3.71c-.22-.45-.6-.81-.78-1l-.02-.02-.03-.03-3.67-3.67a8.7 8.7 0 0 1-.06-.05ZM16.2 26.97 35.02 8.15l2.83 2.83L19.03 29.8c-1.7 1.7-2.5 2.5-3.33 3.21a32 32 0 0 1-7.65 4.93 32 32 0 0 1 4.93-7.65c.73-.82 1.51-1.61 3.22-3.32Z']")
|
678
|
-
page.wait_for_selector('div[data-contents="true"]')
|
679
|
-
time.sleep(0.2)
|
680
|
-
except:
|
681
|
-
sys.exit("ERROR ADDING SOUND: Video saved as draft")
|
682
|
-
|
683
|
-
if sound_name != None:
|
684
|
-
page.click("div.TUXButton-label:has-text('Edit video')")
|
685
|
-
page.wait_for_selector("input.search-bar-input")
|
686
|
-
page.fill(f"input.search-bar-input", f"{sound_name}")
|
687
|
-
time.sleep(0.2)
|
688
|
-
page.click("div.TUXButton-label:has-text('Search')")
|
689
|
-
try:
|
690
|
-
page.wait_for_selector('div.music-card-container')
|
691
|
-
page.click("div.music-card-container")
|
692
|
-
page.wait_for_selector("div.TUXButton-label:has-text('Use')")
|
693
|
-
page.click("div.TUXButton-label:has-text('Use')")
|
694
|
-
except:
|
695
|
-
sys.exit(f"ERROR: SOUND '{sound_name}' NOT FOUND")
|
696
|
-
try:
|
697
|
-
page.wait_for_selector('img[src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMSAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgNy41MDE2QzAgNi42NzMxNyAwLjY3MTU3MyA2LjAwMTYgMS41IDYuMDAxNkgzLjU3NzA5QzMuODY4MDUgNi4wMDE2IDQuMTQ0NTggNS44NzQ4OCA0LjMzNDU1IDUuNjU0NDlMOC43NDI1NSAwLjU0MDUyQzkuMzQ3OCAtMC4xNjE2NjggMTAuNSAwLjI2NjM3NCAxMC41IDEuMTkzNDFWMTguOTY3MkMxMC41IDE5Ljg3NDUgOS4zODg5NCAyMC4zMTI5IDguNzY5NDIgMTkuNjVMNC4zMzE3OSAxNC45MDIxQzQuMTQyNjkgMTQuNjk5OCAzLjg3ODE2IDE0LjU4NDkgMy42MDEyMiAxNC41ODQ5SDEuNUMwLjY3MTU3MyAxNC41ODQ5IDAgMTMuOTEzNCAwIDEzLjA4NDlWNy41MDE2Wk01Ljg0OTQ1IDYuOTYwMjdDNS4yNzk1NiA3LjYyMTQzIDQuNDQ5OTcgOC4wMDE2IDMuNTc3MDkgOC4wMDE2SDJWMTIuNTg0OUgzLjYwMTIyQzQuNDMyMDMgMTIuNTg0OSA1LjIyNTY0IDEyLjkyOTUgNS43OTI5NSAxMy41MzY0TDguNSAxNi40MzI4VjMuODg1MjJMNS44NDk0NSA2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NS41NjI5MyAxNC43NTU4IDUuNTYxNzUgMTQuOTM1NiA1Ljc3MTM2QzE2Ljk5NTkgOC4xNzM2MiAxNi45OTU5IDExLjgyOCAxNC45MzU2IDE0LjIzMDNDMTQuNzU1OCAxNC40Mzk5IDE0LjQzNzYgMTQuNDM4NyAxNC4yNDIzIDE0LjI0MzVMMTMuNTM1MiAxMy41MzY0QzEzLjMzOTkgMTMuMzQxMSAxMy4zNDI0IDEzLjAyNjEgMTMuNTE1IDEyLjgxMDVDMTQuODEzIDExLjE4ODUgMTQuODEzIDguODEzMTIgMTMuNTE1IDcuMTkxMTlaIiBmaWxsPSIjMTYxODIzIiBmaWxsLW9wYWNpdHk9IjAuNiIvPgo8cGF0aCBkPSJNMTYuNzE3MiAxNi43MTgzQzE2LjUyMTkgMTYuNTIzMSAxNi41MjMxIDE2LjIwNzQgMTYuNzA3MiAxNi4wMDE3QzE5LjcyNTcgMTIuNjMgMTkuNzI1NyA3LjM3MTY4IDE2LjcwNzIgNC4wMDAwMUMxNi41MjMxIDMuNzk0MjcgMTYuNTIxOSAzLjQ3ODU4IDE2LjcxNzIgMy4yODMzMkwxNy40MjQzIDIuNTc2MjFDMTcuNjE5NSAyLjM4MDk1IDE3LjkzNyAyLjM4MDIgMTguMTIzMyAyLjU4NDA4QzIxLjkwOTkgNi43MjkyNiAyMS45MDk5IDEzLjI3MjQgMTguMTIzMyAxNy40MTc2QzE3LjkzNyAxNy42MjE1IDE3LjYxOTUgMTcuNjIwNyAxNy40MjQzIDE3LjQyNTVMMTYuNzE3MiAxNi43MTgzWiIgZmlsbD0iIzE2MTgyMyIgZmlsbC1vcGFjaXR5PSIwLjYiLz4KPC9zdmc+Cg=="]')
|
699
|
-
time.sleep(0.5)
|
700
|
-
sliders = page.locator("input.scaleInput")
|
701
|
-
|
702
|
-
if sound_aud_vol == 'background':
|
703
|
-
slider1 = sliders.nth(0)
|
704
|
-
bounding_box1 = slider1.bounding_box()
|
705
|
-
if bounding_box1:
|
706
|
-
x1 = bounding_box1["x"] + (bounding_box1["width"] * 0.92)
|
707
|
-
y1 = bounding_box1["y"] + bounding_box1["height"] / 2
|
708
|
-
page.mouse.click(x1, y1)
|
709
|
-
|
710
|
-
slider2 = sliders.nth(1)
|
711
|
-
bounding_box2 = slider2.bounding_box()
|
712
|
-
if bounding_box2:
|
713
|
-
x2 = bounding_box2["x"] + (bounding_box2["width"] * 0.097)
|
714
|
-
y2 = bounding_box2["y"] + bounding_box2["height"] / 2
|
715
|
-
page.mouse.click(x2, y2)
|
716
|
-
|
717
|
-
if sound_aud_vol == 'main':
|
718
|
-
slider1 = sliders.nth(0)
|
719
|
-
bounding_box1 = slider1.bounding_box()
|
720
|
-
if bounding_box1:
|
721
|
-
x1 = bounding_box1["x"] + (bounding_box1["width"] * 0.092)
|
722
|
-
y1 = bounding_box1["y"] + bounding_box1["height"] / 2
|
723
|
-
page.mouse.click(x1, y1)
|
724
|
-
slider2 = sliders.nth(1)
|
725
|
-
bounding_box2 = slider2.bounding_box()
|
726
|
-
if bounding_box2:
|
727
|
-
x2 = bounding_box2["x"] + (bounding_box2["width"] * 0.92)
|
728
|
-
y2 = bounding_box2["y"] + bounding_box2["height"] / 2
|
729
|
-
page.mouse.click(x2, y2)
|
730
|
-
except:
|
731
|
-
sys.exit("ERROR ADJUSTING SOUND VOLUME: please try again.")
|
732
|
-
|
733
|
-
page.wait_for_selector("div.TUXButton-label:has-text('Save edit')")
|
734
|
-
page.click("div.TUXButton-label:has-text('Save edit')")
|
735
|
-
if suppressprint == False:
|
736
|
-
print("Added sound")
|
737
|
-
|
738
|
-
|
739
|
-
page.wait_for_selector('div[data-contents="true"]')
|
740
|
-
|
741
|
-
if copyrightcheck == True:
|
742
|
-
page.click('div.TUXSwitch:has(label.TUXSwitch-label:has-text("Run a copyright check")) input.TUXSwitch-input')
|
743
|
-
while copyrightcheck == True:
|
744
|
-
time.sleep(0.2)
|
745
|
-
if page.locator("span", has_text="No issues detected.").is_visible():
|
746
|
-
if suppressprint == False:
|
747
|
-
print("Copyright check complete")
|
748
|
-
break
|
749
|
-
if page.locator("span", has_text="Copyright issues detected.").is_visible():
|
750
|
-
sys.exit("COPYRIGHT CHECK FAILED: VIDEO SAVED AS DRAFT, COPYRIGHT AUDIO DETECTED FROM TIKTOK")
|
751
|
-
|
752
|
-
|
753
|
-
try:
|
754
|
-
if schedule == None:
|
755
|
-
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Post")', timeout=10000)
|
756
|
-
uploaded = False
|
757
|
-
checks = 0
|
758
|
-
while uploaded == False:
|
759
|
-
if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
|
760
|
-
time.sleep(0.2)
|
761
|
-
break
|
762
|
-
time.sleep(0.2)
|
763
|
-
checks += 1
|
764
|
-
if checks == 25:
|
689
|
+
if checks > 100:
|
690
|
+
time.sleep(10)
|
691
|
+
if checks == 150:
|
765
692
|
break
|
766
693
|
else:
|
767
694
|
page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Schedule")', timeout=10000)
|
@@ -769,19 +696,19 @@ def upload_tiktok(video, description, accountname, hashtags=None, sound_name=Non
|
|
769
696
|
checks = 0
|
770
697
|
while uploaded == False:
|
771
698
|
if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
|
772
|
-
time.sleep(0.
|
699
|
+
time.sleep(0.2)
|
773
700
|
break
|
774
701
|
time.sleep(0.2)
|
775
702
|
checks += 1
|
776
|
-
if checks
|
703
|
+
if checks > 100:
|
704
|
+
time.sleep(10)
|
705
|
+
if checks == 150:
|
777
706
|
break
|
778
707
|
if suppressprint == False:
|
779
708
|
print("Done uploading video, NOTE: it may take a minute or two to show on TikTok")
|
780
709
|
except:
|
781
|
-
time.sleep(
|
782
|
-
sys.exit("
|
710
|
+
time.sleep(5)
|
711
|
+
sys.exit("ERROR UPLOADING: VIDEO HAS SAVED AS DRAFT BUT CANT UPLOAD")
|
783
712
|
time.sleep(1)
|
784
713
|
|
785
|
-
page.close()
|
786
|
-
|
787
|
-
return "Completed"
|
714
|
+
page.close()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: tiktokautouploader
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.16
|
4
4
|
Summary: Upload or schedule videos to TikTok with viral TikTok sounds and hashtags.
|
5
5
|
Project-URL: Homepage, https://github.com/haziq-exe/TikTokAutoUploader
|
6
6
|
Author-email: HAZIQ <haziqmk123@gmail.com>
|
@@ -17,6 +17,7 @@ Requires-Dist: inference>=0.18.1
|
|
17
17
|
Requires-Dist: pillow>=8.0.0
|
18
18
|
Requires-Dist: playwright>=1.0.0
|
19
19
|
Requires-Dist: requests>=2.0.0
|
20
|
+
Requires-Dist: scikit-learn>=0.24.0
|
20
21
|
Description-Content-Type: text/markdown
|
21
22
|
|
22
23
|
<div align="center">
|
@@ -28,8 +29,9 @@ Description-Content-Type: text/markdown
|
|
28
29
|
|
29
30
|
[](https://pypi.org/project/tiktokautouploader/) [](https://opensource.org/licenses/MIT)
|
30
31
|
|
32
|
+
|
31
33
|
<p align="center">
|
32
|
-
<img src="READMEimage/
|
34
|
+
<img src="READMEimage/READMEvid.gif" alt="" width="900"/>
|
33
35
|
</p>
|
34
36
|
|
35
37
|
## 🚀 Features
|
@@ -42,8 +44,6 @@ Description-Content-Type: text/markdown
|
|
42
44
|
- **⏰ Cutdown on upload time:** Upload to TikTok with way less hassle and much more speed using our library.
|
43
45
|
- **📝 Upload to different accounts:** Stay organized and on top of multiple different accounts with our multi-account functionality.
|
44
46
|
|
45
|
-
⭐️ If you like this project please feel free to star it, Thank you.
|
46
|
-
|
47
47
|
## 📦 Installation
|
48
48
|
|
49
49
|
1. **Python Installation:** Install the package using `pip`:
|
@@ -143,10 +143,4 @@ Created by **Haziq**. Feel free to reach out at [haziqmk123@gmail.com](mailto:ha
|
|
143
143
|
## 📄 License
|
144
144
|
|
145
145
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
|
146
|
-
|
147
|
-
## 📮 Related Projects
|
148
|
-
|
149
|
-
If you liked this project please check out my use case showcase project that generates TikToks and uploads them using 'tiktokautouploader'
|
150
|
-
|
151
|
-
[TikTokGenerator](https://github.com/haziq-exe/TikTokGenerator)
|
152
|
-
|
146
|
+
```
|
@@ -0,0 +1,7 @@
|
|
1
|
+
tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
|
2
|
+
tiktokautouploader/function.py,sha256=DZyECL0gmdLvbNBHt9KE4Z1ZOs-sPDwcTF80S0u3jqo,35623
|
3
|
+
tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
|
4
|
+
tiktokautouploader-3.16.dist-info/METADATA,sha256=7CSTSuCTPP7GO3uaClMmCHdH3eHpGygnPrq1oQHRd6o,5862
|
5
|
+
tiktokautouploader-3.16.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
|
6
|
+
tiktokautouploader-3.16.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
|
7
|
+
tiktokautouploader-3.16.dist-info/RECORD,,
|
@@ -1,12 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "tiktokautouploader-assets",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"scripts": {
|
5
|
-
"postinstall": "npx playwright install chromium"
|
6
|
-
},
|
7
|
-
"dependencies": {
|
8
|
-
"playwright": "^1.48.2",
|
9
|
-
"playwright-extra": "^4.3.6",
|
10
|
-
"puppeteer-extra-plugin-stealth": "^2.11.2"
|
11
|
-
}
|
12
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
|
2
|
-
tiktokautouploader/function.py,sha256=3x_mharQkxbElbWEqCusB0qZAGy-PlLfkkozHYqpc3w,44660
|
3
|
-
tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
|
4
|
-
tiktokautouploader/Js_assets/package.json,sha256=aNbwSOpEpDUlplSuXugHVeN11riVwV4ofVkRPwHzbLs,273
|
5
|
-
tiktokautouploader-3.7.dist-info/METADATA,sha256=XZ7nBoYoXXeAGiNXvAFhZTsmqWs4ihgIIDH5blQar94,6125
|
6
|
-
tiktokautouploader-3.7.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
|
7
|
-
tiktokautouploader-3.7.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
|
8
|
-
tiktokautouploader-3.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|