tiktokautouploader 3.14__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 +36 -28
- {tiktokautouploader-3.14.dist-info → tiktokautouploader-3.16.dist-info}/METADATA +1 -1
- tiktokautouploader-3.16.dist-info/RECORD +7 -0
- tiktokautouploader-3.14.dist-info/RECORD +0 -7
- {tiktokautouploader-3.14.dist-info → tiktokautouploader-3.16.dist-info}/WHEEL +0 -0
- {tiktokautouploader-3.14.dist-info → tiktokautouploader-3.16.dist-info}/licenses/LICENSE.md +0 -0
tiktokautouploader/function.py
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
from playwright.sync_api import sync_playwright
|
2
2
|
import json
|
3
3
|
import time
|
4
|
-
import inference
|
5
4
|
import subprocess
|
5
|
+
from inference_sdk import InferenceHTTPClient
|
6
6
|
import pkg_resources
|
7
7
|
import requests
|
8
8
|
from PIL import Image
|
9
9
|
import sys
|
10
|
-
import base64
|
11
10
|
import os
|
12
|
-
from dotenv import load_dotenv
|
13
11
|
import warnings
|
14
|
-
load_dotenv()
|
15
12
|
warnings.simplefilter("ignore")
|
16
13
|
|
17
14
|
|
@@ -135,8 +132,6 @@ def get_image_src(page):
|
|
135
132
|
image_url = page.get_attribute("img#captcha-verify-image", "src")
|
136
133
|
return image_url
|
137
134
|
|
138
|
-
os.getenv('ROBOFLOW_API_KEY')
|
139
|
-
|
140
135
|
def download_image(image_url):
|
141
136
|
response = requests.get(image_url)
|
142
137
|
image_path = "captcha_image.jpg"
|
@@ -146,18 +141,25 @@ def download_image(image_url):
|
|
146
141
|
|
147
142
|
def run_inference_on_image_tougher(image_path, object):
|
148
143
|
|
149
|
-
|
150
|
-
|
144
|
+
k = 'n|KIeDZnRZiJ};iVHz;R'
|
145
|
+
rk = ''.join(chr((ord(c) - 3) % 256) for c in k)
|
146
|
+
|
147
|
+
CLIENT = InferenceHTTPClient(
|
148
|
+
api_url="https://detect.roboflow.com",
|
149
|
+
api_key=f"{rk}"
|
150
|
+
)
|
151
|
+
|
152
|
+
results = CLIENT.infer(image_path, model_id="captcha-2-6ehbe/2")
|
151
153
|
|
152
154
|
class_names = []
|
153
155
|
bounding_boxes = []
|
154
|
-
for obj in results[
|
155
|
-
class_names.append(obj
|
156
|
+
for obj in results['predictions']:
|
157
|
+
class_names.append(obj['class'])
|
156
158
|
bounding_boxes.append({
|
157
|
-
"x": obj
|
158
|
-
"y": obj
|
159
|
-
"width": obj
|
160
|
-
"height": obj
|
159
|
+
"x": obj['x'],
|
160
|
+
"y": obj['y'],
|
161
|
+
"width": obj['width'],
|
162
|
+
"height": obj['height']
|
161
163
|
})
|
162
164
|
|
163
165
|
bounding_box = []
|
@@ -172,34 +174,40 @@ def run_inference_on_image_tougher(image_path, object):
|
|
172
174
|
|
173
175
|
def run_inference_on_image(image_path):
|
174
176
|
|
175
|
-
|
176
|
-
|
177
|
+
k = 'n|KIeDZnRZiJ};iVHz;R'
|
178
|
+
rk = ''.join(chr((ord(c) - 3) % 256) for c in k)
|
179
|
+
|
180
|
+
CLIENT = InferenceHTTPClient(
|
181
|
+
api_url="https://detect.roboflow.com",
|
182
|
+
api_key=f"{rk}"
|
183
|
+
)
|
184
|
+
|
185
|
+
results = CLIENT.infer(image_path, model_id="tk-3nwi9/2")
|
177
186
|
|
178
187
|
class_names = []
|
179
188
|
bounding_boxes = []
|
180
|
-
for obj in results[
|
181
|
-
class_names.append(obj
|
189
|
+
for obj in results['predictions']:
|
190
|
+
class_names.append(obj['class'])
|
182
191
|
bounding_boxes.append({
|
183
|
-
"x": obj
|
184
|
-
"y": obj
|
185
|
-
"width": obj
|
186
|
-
"height": obj
|
192
|
+
"x": obj['x'],
|
193
|
+
"y": obj['y'],
|
194
|
+
"width": obj['width'],
|
195
|
+
"height": obj['height']
|
187
196
|
})
|
188
197
|
|
189
198
|
already_written = []
|
190
199
|
bounding_box = []
|
191
200
|
class_to_click = []
|
192
|
-
for i,
|
193
|
-
if
|
194
|
-
class_to_click.append(
|
201
|
+
for i, detected_class in enumerate(class_names):
|
202
|
+
if detected_class in already_written:
|
203
|
+
class_to_click.append(detected_class)
|
195
204
|
bounding_box.append(bounding_boxes[i])
|
196
|
-
index = already_written.index(
|
205
|
+
index = already_written.index(detected_class)
|
197
206
|
bounding_box.append(bounding_boxes[index])
|
198
207
|
|
199
|
-
already_written.append(
|
208
|
+
already_written.append(detected_class)
|
200
209
|
|
201
210
|
found = False
|
202
|
-
|
203
211
|
if len(class_to_click) == 1:
|
204
212
|
found = True
|
205
213
|
|
@@ -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>
|
@@ -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,7 +0,0 @@
|
|
1
|
-
tiktokautouploader/__init__.py,sha256=u7OWCK_u68ST8dfrkSF4Yw44CJOzV9NXI6ASRuoDfmE,64
|
2
|
-
tiktokautouploader/function.py,sha256=vR2ELk1ydps0K9nhA1bxIc2Cf3d5qbvfRm3wUxkDEyk,35292
|
3
|
-
tiktokautouploader/Js_assets/login.js,sha256=SLhtPYo8ZfTRUnbR7Xqp084lSuAOqIWUxi75FlFH3vs,966
|
4
|
-
tiktokautouploader-3.14.dist-info/METADATA,sha256=9AoqNXOcgyMZyvhgx2bB06uj5uq4caZxge7JyWJbloU,5862
|
5
|
-
tiktokautouploader-3.14.dist-info/WHEEL,sha256=fl6v0VwpzfGBVsGtkAkhILUlJxROXbA3HvRL6Fe3140,105
|
6
|
-
tiktokautouploader-3.14.dist-info/licenses/LICENSE.md,sha256=hYds_VJIpnS5gC73WhuWk2IY_e9BWjuEJthQCb9ThyU,1073
|
7
|
-
tiktokautouploader-3.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|