tiktokautouploader 2.8__py2.py3-none-any.whl → 2.9__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.
@@ -11,7 +11,6 @@ import os
11
11
  import warnings
12
12
  warnings.filterwarnings("ignore")
13
13
 
14
-
15
14
  def login_warning():
16
15
  print("NO COOKIES FILE FOUND, PLEASE LOG-IN WHEN PROMPTED")
17
16
 
@@ -19,6 +18,23 @@ def save_cookies(cookies):
19
18
  with open('TK_cookies.json', 'w') as file:
20
19
  json.dump(cookies, file, indent=4)
21
20
 
21
+ def check_expiry():
22
+ with open('TK_cookies.json', 'r') as file:
23
+ cookies = json.load(file)
24
+
25
+ current_time = int(time.time())
26
+ cookies_expire = []
27
+ expired = False
28
+ for cookie in cookies:
29
+ if cookie['name'] in ['sessionid', 'sid_tt', 'sessionid_ss', 'passport_auth_status']:
30
+ expiry = cookie.get('expires')
31
+ cookies_expire.append(expiry < current_time)
32
+
33
+ if all(cookies_expire):
34
+ expired = True
35
+
36
+ return expired
37
+
22
38
  def run_javascript():
23
39
  js_file_path = pkg_resources.resource_filename(__name__, 'Js_assets/login.js')
24
40
  result = subprocess.run(['node', js_file_path], capture_output=True, text=True)
@@ -204,12 +220,17 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
204
220
 
205
221
  retries = 0
206
222
  cookie_read = False
223
+ install_js_dependencies()
207
224
 
208
225
  if os.path.exists('TK_cookies.json'):
209
226
  cookies, cookie_read = read_cookies(cookies_path='TK_cookies.json')
227
+ expired = check_expiry()
228
+ if expired == True:
229
+ os.remove('TK_cookies.json')
230
+ print("COOKIES EXPIRED, PLEASE LOG-IN AGAIN")
231
+ cookie_read = False
210
232
 
211
233
  if cookie_read == False:
212
- install_js_dependencies()
213
234
  login_warning()
214
235
  run_javascript()
215
236
 
@@ -243,7 +264,6 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
243
264
  captcha = False
244
265
  while detected == False:
245
266
  if page.locator('.upload-text-container').is_visible():
246
- print("Showed up")
247
267
  detected = True
248
268
  else:
249
269
  if page.locator('div.VerifyBar___StyledDiv-sc-12zaxoy-0.hRJhHT').is_visible():
@@ -330,7 +350,7 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
330
350
  click_on_objects(page, webpage_coords)
331
351
  time.sleep(0.5)
332
352
  page.click("div.verify-captcha-submit-button")
333
- if attempts > 5:
353
+ if attempts > 10:
334
354
  sys.exit("FAILED TO SOLVE CAPTCHA")
335
355
  try:
336
356
  page.wait_for_selector('.upload-text-container', timeout=5000)
@@ -410,7 +430,13 @@ def upload_tiktok(video, description, hashtags=None, sound_name=None, sound_aud_
410
430
  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")
411
431
 
412
432
  page.locator('div.TUXRadioStandalone.TUXRadioStandalone--medium').nth(1).click()
413
- time.sleep(0.2)
433
+ time.sleep(1)
434
+ if page.locator('button.TUXButton.TUXButton--default.TUXButton--medium.TUXButton--primary:has-text("Allow")').nth(0).is_visible():
435
+ page.locator('button.TUXButton.TUXButton--default.TUXButton--medium.TUXButton--primary:has-text("Allow")').nth(0).click()
436
+ time.sleep(0.2)
437
+ else:
438
+ if page.locator('div.TUXTextInputCore-trailingIconWrapper').nth(1).is_visible():
439
+ time.sleep(0.2)
414
440
  if day != None:
415
441
  page.locator('div.TUXTextInputCore-trailingIconWrapper').nth(1).click()
416
442
  time.sleep(0.2)
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.3
2
+ Name: tiktokautouploader
3
+ Version: 2.9
4
+ Summary: Upload or schedule videos to TikTok with viral TikTok sounds and hashtags.
5
+ Project-URL: Homepage, https://github.com/haziq-exe/TikTokAutoUploader
6
+ Author-email: HAZIQ <haziqmk123@gmail.com>
7
+ License-File: LICENSE.md
8
+ Keywords: autoupload,tiktok,tiktokautoupload
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Requires-Dist: pillow>=8.0.0
17
+ Requires-Dist: playwright>=1.0.0
18
+ Requires-Dist: requests>=2.0.0
19
+ Requires-Dist: scikit-learn>=0.24.0
20
+ Description-Content-Type: text/markdown
21
+
22
+ <div align="center">
23
+ <h1>tiktokautouploader</h1>
24
+ </div>
25
+
26
+
27
+ ### AUTOMATE TIKTOK UPLOADS 🤖. USE TRENDING SOUNDS 🔊, ADD WORKING HASHTAGS 💯, SCHEDULE UPLOADS 🗓️, AUTOSOLVES CAPTCHAS 🧠, AND MORE 🎁
28
+
29
+ [![PyPI version](https://img.shields.io/pypi/v/tiktokautouploader.svg)](https://pypi.org/project/tiktokautouploader/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
30
+
31
+
32
+ <p align="center">
33
+ <img src="READMEimage/Image.png" alt="" width="400"/>
34
+ </p>
35
+
36
+ ## 🚀 Features
37
+
38
+ - **🔐 Bypass/Auto Solve Captchas:** No more manual captcha solving; fully automated process!
39
+ - **🎵 Use TikTok Sounds:** Seamlessly add popular TikTok sounds to your videos.
40
+ - **🗓 Schedule Uploads:** Upload videos at specific times or upto 10 days in advance with our scheduling feature.
41
+ - **🔍 Copyright Check:** Ensure your video is safe from copyright claims before uploading.
42
+ - **🏷 Add Working Hashtags:** Increase your reach by adding effective hashtags that actually work.
43
+
44
+
45
+ ## 📦 Installation
46
+
47
+ 1. **Python Installation:** Install the package using `pip`:
48
+
49
+ ```bash
50
+ pip install tiktokautouploader
51
+ ```
52
+
53
+ ---
54
+
55
+ ## ⚙️ Pre-requisites
56
+
57
+ 1. **Node.js:** You must have Node.js installed on your system, as some parts of this package rely on JavaScript code. If you don't have Node.js installed, you can download it from [nodejs.org](https://nodejs.org/).
58
+
59
+ - **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.
60
+
61
+
62
+ 2. **Browser Binaries:** If you don't have them already, you'll need to install the chromium browser binary for `playwright`.
63
+
64
+ To do so, just run the following command AFTER installing the package:
65
+
66
+ ```bash
67
+ python -m playwright install chromium
68
+ ```
69
+
70
+
71
+ ## 📝 Quick-Start
72
+
73
+ Here's how to upload a video to TikTok with hashtags using `tiktokautouploader`:
74
+
75
+ NOTE: It is highly recommended you read DOCUMENTATION.md before using the library.
76
+
77
+ The first time you run the code, you will be prompted to log-in, this will only occur the first time the function is used. Check documentation for more info.
78
+
79
+ ```python
80
+ from tiktokautouploader import upload_tiktok
81
+
82
+ video_path = 'path/to/your/video.mp4'
83
+ description = 'Check out my latest TikTok video!'
84
+ hashtags = ['#fun', '#viral']
85
+
86
+ upload_tiktok(video=video_path, description=description, hashtags=hashtags)
87
+
88
+ ```
89
+
90
+ ### Upload with TikTok Sound
91
+
92
+ ```python
93
+ upload_tiktok(video=video_path, description=description, sound_name='trending_sound', sound_aud_vol='main')
94
+ ```
95
+
96
+ PLEASE READ DOCUMENTATION FOR MORE INFO.
97
+
98
+ ### Schedule an Upload
99
+
100
+ ```python
101
+ upload_tiktok(video=video_path, description=description, schedule='03:10', day=11)
102
+ ```
103
+
104
+ PLEASE READ DOCUMENTATION FOR MORE INFO
105
+
106
+ ### Perform Copyright Check Before Uploading
107
+
108
+ ```python
109
+ upload_tiktok(video=video_path, description=description, hashtags=hashtags, copyrightcheck=True)
110
+ ```
111
+
112
+ ## 🎯 Why Choose `autotiktokuploader`?
113
+
114
+ - **No more captchas:** Fully automated uploads without interruptions, If captchas do show up, no worries, they will be solved. (read documentation for more info)
115
+ - **Maximize your reach:** Add popular sounds and effective hashtags that work to boost visibility.
116
+ - **Stay compliant:** Built-in copyright checks to avoid unforeseen takedowns.
117
+ - **Convenient scheduling:** Post at the right time, even when you're away.
118
+
119
+ ## 🛠 Dependencies
120
+
121
+ This library requires the following dependencies:
122
+
123
+ - `playwright`
124
+ - `requests`
125
+ - `Pillow`
126
+ - `scikit-learn`
127
+ - `inference`
128
+
129
+ These will be automatically installed when you install the package.
130
+
131
+ ## 👤 Author
132
+
133
+ Created by **Haziq Khalid**. Feel free to reach out at [haziqmk123@gmail.com](mailto:haziqmk123@gmail.com) or my LinkedIn.
134
+
135
+ ## 📄 License
136
+
137
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
138
+ ```
@@ -0,0 +1,7 @@
1
+ tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
2
+ tiktokautouploader/function.py,sha256=xH9h_yIxwuUo-CfvR1NpHDyGBhrS-6n-enNMx1l2Dqw,32635
3
+ tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
4
+ tiktokautouploader-2.9.dist-info/METADATA,sha256=nIX_7UaWoh3EGi-RqElLzdZpT026RxvO0pABzqm7LZo,4878
5
+ tiktokautouploader-2.9.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
6
+ tiktokautouploader-2.9.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
7
+ tiktokautouploader-2.9.dist-info/RECORD,,
@@ -1,19 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: tiktokautouploader
3
- Version: 2.8
4
- Summary: Upload or schedule videos to TikTok with TikTok sounds and hashtags that work.
5
- Project-URL: Homepage, https://github.com/haziq-exe/TikTokAutoUploader
6
- Author-email: HAZIQ KHALID <haziqmk123@gmail.com>
7
- License-File: LICENSE.md
8
- Keywords: autoupload,tiktok,tiktokautoupload
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Requires-Dist: pillow>=8.0.0
17
- Requires-Dist: playwright>=1.0.0
18
- Requires-Dist: requests>=2.0.0
19
- Requires-Dist: scikit-learn>=0.24.0
@@ -1,7 +0,0 @@
1
- tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
2
- tiktokautouploader/function.py,sha256=YWecvSMwVJD_Io4btPGiew9piv-1B6Df1tWxlkGTq4Y,31544
3
- tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
4
- tiktokautouploader-2.8.dist-info/METADATA,sha256=M_ZqzppVuuuqUGmevmCPxEAbjJvhO2A-wncP01KQ0Aw,816
5
- tiktokautouploader-2.8.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
6
- tiktokautouploader-2.8.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
7
- tiktokautouploader-2.8.dist-info/RECORD,,