tiktokautouploader 2.93__py2.py3-none-any.whl → 2.96__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.
@@ -88,11 +88,24 @@ def understood_Qs(question):
88
88
  'has strings': 'guitar',
89
89
  'oval and inflatable': 'football',
90
90
  'strumming': 'guitar',
91
- 'bounces on courts': 'basketball',
91
+ 'bounces': 'basketball',
92
92
  'musical instrument': 'guitar',
93
93
  'laces': 'football',
94
94
  'bands': 'guitar',
95
- 'leather': 'football'
95
+ 'leather': 'football',
96
+ 'leaves':'tree',
97
+ 'pages': 'book',
98
+ 'throwing': 'football',
99
+ 'tossed in a spiral': 'football',
100
+ 'spiky crown': 'pineapple',
101
+ 'pigskin': 'football',
102
+ 'photography': 'camera',
103
+ 'lens': 'camera',
104
+ 'grow': 'tree',
105
+ 'captures images': 'camera',
106
+ 'keeps doctors': 'apple',
107
+ 'crown': 'pineapple',
108
+ 'driven': 'car',
96
109
  }
97
110
 
98
111
  for key in understood_terms.keys():
@@ -118,8 +131,7 @@ def download_image(image_url):
118
131
 
119
132
  def run_inference_on_image_tougher(image_path, object):
120
133
 
121
- found_proper = False
122
- model = inference.get_model("captcha-2-6ehbe/1")
134
+ model = inference.get_model("captcha-2-6ehbe/2")
123
135
  results = model.infer(image=image_path)
124
136
 
125
137
  class_names = []
@@ -139,12 +151,9 @@ def run_inference_on_image_tougher(image_path, object):
139
151
  if classes == class_to_click:
140
152
  bounding_box.append(bounding_boxes[i])
141
153
 
142
- if len(bounding_box) == 2:
143
- found_proper = True
144
154
 
145
- found_proper = True
146
155
 
147
- return bounding_box, found_proper
156
+ return bounding_box
148
157
 
149
158
  def run_inference_on_image(image_path):
150
159
 
@@ -222,6 +231,7 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
222
231
 
223
232
  retries = 0
224
233
  cookie_read = False
234
+ oldQ = 'N.A'
225
235
 
226
236
  if os.path.exists('TK_cookies.json'):
227
237
  cookies, cookie_read = read_cookies(cookies_path='TK_cookies.json')
@@ -243,7 +253,7 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
243
253
 
244
254
  with sync_playwright() as p:
245
255
 
246
- browser = p.webkit.launch(headless=False)
256
+ browser = p.firefox.launch(headless=True)
247
257
 
248
258
  context = browser.new_context()
249
259
  context.add_cookies(cookies)
@@ -280,24 +290,28 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
280
290
  print("CAPTCHA DETECTED, Attempting to solve")
281
291
  solved = False
282
292
  attempts = 0
293
+ question = page.locator('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT').text_content()
283
294
  while solved == False:
284
295
  attempts += 1
285
- question = page.locator('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT').text_content()
296
+ start_time = time.time()
297
+ while question == oldQ:
298
+ question = page.locator('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT').text_content()
299
+ if time.time() - start_time > 2:
300
+ break
286
301
  if 'Select 2 objects that are the same' in question:
287
302
  found = False
288
303
  while found == False:
289
304
  page.click('span.secsdk_captcha_refresh--text')
290
- time.sleep(0.5)
291
305
  image = get_image_src(page)
292
306
  img_path = download_image(image)
293
307
  b_box, found = run_inference_on_image(image_path=img_path)
294
308
 
295
309
  with Image.open(img_path) as img:
296
310
  image_size = img.size
297
-
298
- image = page.locator('#captcha-verify-image')
299
- image.wait_for()
300
- box = image.bounding_box()
311
+
312
+ imageweb = page.locator('#captcha-verify-image')
313
+ imageweb.wait_for()
314
+ box = imageweb.bounding_box()
301
315
  image_x = box['x']
302
316
  image_y = box['y']
303
317
  image_height_web = box['height']
@@ -309,36 +323,39 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
309
323
  time.sleep(0.5)
310
324
  if attempts > 5:
311
325
  sys.exit("FAILED TO SOLVE CAPTCHA")
312
- try:
313
- page.wait_for_selector('.upload-text-container', timeout=5000)
314
- os.remove('captcha_image.jpg')
315
- if suppressprint == False:
316
- print("Captcha Solved")
317
- solved = True
318
- except:
319
- continue
326
+ while showedup == False:
327
+ if page.locator("div.captcha_verify_message.captcha_verify_message-pass").is_visible():
328
+ solved = True
329
+ showedup = True
330
+ if page.locator("div.captcha_verify_message.captcha_verify_message-fail").is_visible():
331
+ showedup = True
332
+ oldQ = question
333
+ page.click('span.secsdk_captcha_refresh--text')
320
334
  else:
321
- found_prop = False
322
- while found_prop == False:
335
+ objectclick = understood_Qs(question)
336
+ while objectclick == 'N.A':
337
+ oldQ = question
323
338
  page.click('span.secsdk_captcha_refresh--text')
324
- time.sleep(0.5)
325
- question = page.locator('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT').text_content()
326
- objectclick = understood_Qs(question)
327
- while objectclick == 'N.A':
328
- page.click('span.secsdk_captcha_refresh--text')
329
- page.wait_for_selector('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT')
339
+ start_time = time.time()
340
+ runs = 0
341
+ while question == oldQ:
342
+ runs += 1
330
343
  question = page.locator('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT').text_content()
331
- objectclick = understood_Qs(question)
332
- image = get_image_src(page)
333
- img_path = download_image(image)
334
- b_box, found_prop = run_inference_on_image_tougher(image_path=img_path, object=objectclick)
335
-
344
+ if runs > 1:
345
+ time.sleep(1)
346
+ if time.time() - start_time > 2:
347
+ break
348
+ objectclick = understood_Qs(question)
349
+ image = get_image_src(page)
350
+ img_path = download_image(image)
351
+ b_box = run_inference_on_image_tougher(image_path=img_path, object=objectclick)
352
+
336
353
  with Image.open(img_path) as img:
337
354
  image_size = img.size
338
-
339
- image = page.locator('#captcha-verify-image')
340
- image.wait_for()
341
- box = image.bounding_box()
355
+
356
+ imageweb = page.locator('#captcha-verify-image')
357
+ imageweb.wait_for()
358
+ box = imageweb.bounding_box()
342
359
  image_x = box['x']
343
360
  image_y = box['y']
344
361
  image_height_web = box['height']
@@ -347,20 +364,22 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
347
364
 
348
365
  webpage_coords = convert_to_webpage_coordinates(b_box, image_x, image_y, image_height_web, image_width_web, image_height_real, image_width_real)
349
366
 
350
-
351
367
  click_on_objects(page, webpage_coords)
352
- time.sleep(0.5)
353
368
  page.click("div.verify-captcha-submit-button")
354
- if attempts > 10:
369
+ if attempts > 20:
355
370
  sys.exit("FAILED TO SOLVE CAPTCHA")
356
- try:
357
- page.wait_for_selector('.upload-text-container', timeout=5000)
358
- solved = True
359
- os.remove('captcha_image.jpg')
360
- if suppressprint == False:
361
- print("Captcha Solved")
362
- except:
363
- continue
371
+ showedup = False
372
+ while showedup == False:
373
+ if page.locator("div.captcha_verify_message.captcha_verify_message-pass").is_visible():
374
+ solved = True
375
+ showedup = True
376
+ os.remove('captcha_image.jpg')
377
+ if suppressprint == False:
378
+ print("CAPTCHA SOLVED")
379
+ if page.locator("div.captcha_verify_message.captcha_verify_message-fail").is_visible():
380
+ showedup = True
381
+ oldQ = question
382
+ page.click('span.secsdk_captcha_refresh--text')
364
383
 
365
384
 
366
385
  try:
@@ -465,8 +484,89 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
465
484
 
466
485
  if (schedule == None) and (day != None):
467
486
  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")
487
+
488
+ if(sound_name == None):
489
+ if copyrightcheck == True:
490
+ page.locator(".TUXSwitch-input").nth(0).click()
491
+ while copyrightcheck == True:
492
+ time.sleep(0.2)
493
+ if page.locator("span", has_text="No issues detected.").is_visible():
494
+ if suppressprint == False:
495
+ print("Copyright check complete")
496
+ break
497
+ if page.locator("span", has_text="Copyright issues detected.").is_visible():
498
+ sys.exit("COPYRIGHT CHECK FAILED: COPYRIGHT AUDIO DETECTED FROM TIKTOK")
499
+
500
+ if schedule == None:
501
+ page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Post")', timeout=10000)
502
+ uploaded = False
503
+ checks = 0
504
+ while uploaded == False:
505
+ if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
506
+ time.sleep(0.2)
507
+ break
508
+ time.sleep(0.2)
509
+ checks += 1
510
+ if checks > 100:
511
+ time.sleep(10)
512
+ if checks == 150:
513
+ break
514
+ else:
515
+ page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Schedule")', timeout=10000)
516
+ uploaded = False
517
+ checks = 0
518
+ while uploaded == False:
519
+ if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
520
+ time.sleep(0.2)
521
+ break
522
+ time.sleep(0.2)
523
+ checks += 1
524
+ if checks > 100:
525
+ time.sleep(10)
526
+ if checks == 150:
527
+ break
528
+ if suppressprint == False:
529
+ print("Done uploading video, NOTE: it may take a minute or two to show on TikTok")
468
530
 
469
- if sound_name != None:
531
+ page.close()
532
+
533
+ else:
534
+ try:
535
+ page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--secondary:has-text("Save draft")', timeout=10000)
536
+ except:
537
+ sys.exit("SAVE AS DRAFT BUTTON NOT FOUND; CANNOT ADD SOUND WITHOUT ABILITY TO SAVE DRAFTS")
538
+
539
+ time.sleep(0.5)
540
+ page.close()
541
+
542
+ browser = p.chromium.launch(headless=True)
543
+
544
+ context = browser.new_context()
545
+ context.add_cookies(cookies)
546
+ page = context.new_page()
547
+ url2 = 'https://www.tiktok.com/tiktokstudio/content?tab=draft'
548
+
549
+ while retries < 2:
550
+ try:
551
+ page.goto(url2, timeout=30000)
552
+ except:
553
+ retries +=1
554
+ time.sleep(5)
555
+ if retries == 2:
556
+ sys.exit("ERROR: TIK TOK PAGE FAILED TO LOAD, try again.")
557
+ else:
558
+ break
559
+
560
+ try:
561
+ 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']")
562
+ 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']")
563
+ page.wait_for_selector('div[data-contents="true"]')
564
+ page.wait_for_function("document.querySelector('.info-progress-num').textContent.trim() === '100%'", timeout=3000000)
565
+ time.sleep(0.2)
566
+ except:
567
+ sys.exit("ERROR ADDING SOUND: Video saved as draft")
568
+
569
+ if sound_name != None:
470
570
  page.click("div.TUXButton-label:has-text('Edit video')")
471
571
  page.wait_for_selector("input.search-bar-input")
472
572
  page.fill(f"input.search-bar-input", f"{sound_name}")
@@ -521,9 +621,9 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
521
621
  if suppressprint == False:
522
622
  print("Added sound")
523
623
 
524
- page.wait_for_selector('div[data-contents="true"]')
624
+ page.wait_for_selector('div[data-contents="true"]')
525
625
 
526
- if copyrightcheck == True:
626
+ if copyrightcheck == True:
527
627
  page.locator(".TUXSwitch-input").nth(0).click()
528
628
  while copyrightcheck == True:
529
629
  time.sleep(0.2)
@@ -535,40 +635,40 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
535
635
  sys.exit("COPYRIGHT CHECK FAILED: VIDEO SAVED AS DRAFT, COPYRIGHT AUDIO DETECTED FROM TIKTOK")
536
636
 
537
637
 
538
- try:
539
- if schedule == None:
540
- page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Post")', timeout=10000)
541
- uploaded = False
542
- checks = 0
543
- while uploaded == False:
544
- if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
638
+ try:
639
+ if schedule == None:
640
+ page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Post")', timeout=10000)
641
+ uploaded = False
642
+ checks = 0
643
+ while uploaded == False:
644
+ if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
645
+ time.sleep(0.2)
646
+ break
545
647
  time.sleep(0.2)
546
- break
547
- time.sleep(0.2)
548
- checks += 1
549
- if checks > 100:
550
- time.sleep(10)
551
- if checks == 150:
552
- break
553
- else:
554
- page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Schedule")', timeout=10000)
555
- uploaded = False
556
- checks = 0
557
- while uploaded == False:
558
- if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
648
+ checks += 1
649
+ if checks > 100:
650
+ time.sleep(10)
651
+ if checks == 150:
652
+ break
653
+ else:
654
+ page.click('button.TUXButton.TUXButton--default.TUXButton--large.TUXButton--primary:has-text("Schedule")', timeout=10000)
655
+ uploaded = False
656
+ checks = 0
657
+ while uploaded == False:
658
+ if page.locator(':has-text("Leaving the page does not interrupt")').nth(0).is_visible():
659
+ time.sleep(0.2)
660
+ break
559
661
  time.sleep(0.2)
560
- break
561
- time.sleep(0.2)
562
- checks += 1
563
- if checks > 100:
564
- time.sleep(10)
565
- if checks == 150:
566
- break
567
- if suppressprint == False:
568
- print("Done uploading video, NOTE: it may take a minute or two to show on TikTok")
569
- except:
570
- time.sleep(5)
571
- sys.exit("ERROR UPLOADING: VIDEO HAS SAVED AS DRAFT BUT CANT UPLOAD")
572
- time.sleep(1)
662
+ checks += 1
663
+ if checks > 100:
664
+ time.sleep(10)
665
+ if checks == 150:
666
+ break
667
+ if suppressprint == False:
668
+ print("Done uploading video, NOTE: it may take a minute or two to show on TikTok")
669
+ except:
670
+ time.sleep(5)
671
+ sys.exit("ERROR UPLOADING: VIDEO HAS SAVED AS DRAFT BUT CANT UPLOAD")
672
+ time.sleep(1)
573
673
 
574
- page.close()
674
+ page.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: tiktokautouploader
3
- Version: 2.93
3
+ Version: 2.96
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>
@@ -31,7 +31,7 @@ Description-Content-Type: text/markdown
31
31
 
32
32
 
33
33
  <p align="center">
34
- <img src="READMEimage/READMEimg.png" alt="" width="150"/>
34
+ <img src="READMEimage/READMEvid.gif" alt="" width="900"/>
35
35
  </p>
36
36
 
37
37
  ## 🚀 Features
@@ -41,6 +41,7 @@ Description-Content-Type: text/markdown
41
41
  - **🗓 Schedule Uploads:** Upload videos at specific times or upto 10 days in advance with our scheduling feature.
42
42
  - **🔍 Copyright Check:** Ensure your video is safe from copyright claims before uploading.
43
43
  - **🏷 Add Working Hashtags:** Increase your reach by adding effective hashtags that actually work.
44
+ - **⏰ Cutdown on upload time:** Upload to TikTok with way less hassle and much more speed using our library
44
45
 
45
46
 
46
47
  ## 📦 Installation
@@ -60,7 +61,7 @@ pip install tiktokautouploader
60
61
  - **Note:** The necessary JavaScript dependencies (`playwright`,`playwright-extra`, `puppeteer-extra-plugin-stealth`) will be AUTOMATICALLY installed the first time you run the function, so you don't need to install them manually. Make sure that `npm` (Node.js package manager) is available in your system's PATH.
61
62
 
62
63
 
63
- 2. **Browser Binaries:** If you don't have them already, you'll need to install the browser binaries for `playwright`.
64
+ 2. **Browser Binaries:** If you don't have them already, you'll need to install the browser binaries for `playwright`. This library uses chromium and firefox.
64
65
 
65
66
  to do so, just run the following command AFTER installing the package:
66
67
 
@@ -68,6 +69,8 @@ pip install tiktokautouploader
68
69
  python -m playwright install
69
70
  ```
70
71
 
72
+ **NOTE:** If you want to add sounds to your TikTok, you MUST have the ability to save drafts. If you don't want to add sounds then you don't need this feature.
73
+
71
74
 
72
75
  ## 📝 Quick-Start
73
76
 
@@ -0,0 +1,7 @@
1
+ tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
2
+ tiktokautouploader/function.py,sha256=d3JODI7zeE6WEvHzTsObh1voH7O-Zv1PJfacn1lRH44,33619
3
+ tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
4
+ tiktokautouploader-2.96.dist-info/METADATA,sha256=ScUrk5fPgVIm1qF8sxmvhr_ZzUVDMwHWlbQ8VSBryfs,5344
5
+ tiktokautouploader-2.96.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
6
+ tiktokautouploader-2.96.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
7
+ tiktokautouploader-2.96.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
2
- tiktokautouploader/function.py,sha256=t7_VOwFEKMqykWRdxXwyMaDX1AwmLhQbdILos5_kXks,27776
3
- tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
4
- tiktokautouploader-2.93.dist-info/METADATA,sha256=tQhgWlzfM2buP10ypgGfBVAxW_a78RB78saJaucIfl8,5033
5
- tiktokautouploader-2.93.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
6
- tiktokautouploader-2.93.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
7
- tiktokautouploader-2.93.dist-info/RECORD,,