mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 09:16:19 +00:00
✨ Improve description formatting
This commit is contained in:
@@ -14,7 +14,9 @@ class TikTokUploadEngine(BaseUploadEngine):
|
|||||||
self.hashtags = options[0]
|
self.hashtags = options[0]
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def upload(self, title: str, description: str, path: str):
|
def upload(
|
||||||
|
self, title: str, description: str, path: str, hashtags_end: bool = True
|
||||||
|
):
|
||||||
cookies = self.get_setting(type="cookies")["cookies"]
|
cookies = self.get_setting(type="cookies")["cookies"]
|
||||||
if cookies is None:
|
if cookies is None:
|
||||||
gr.Warning(
|
gr.Warning(
|
||||||
@@ -36,9 +38,15 @@ class TikTokUploadEngine(BaseUploadEngine):
|
|||||||
description = description.replace(word, "")
|
description = description.replace(word, "")
|
||||||
|
|
||||||
hashtags_str = " ".join(hashtags) + " " if hashtags else ""
|
hashtags_str = " ".join(hashtags) + " " if hashtags else ""
|
||||||
|
final_description = (
|
||||||
|
f"{title} {description} {hashtags_str}"
|
||||||
|
if hashtags_end
|
||||||
|
else f"{title} {hashtags_str} {description}"
|
||||||
|
)
|
||||||
|
final_description = final_description.strip()
|
||||||
failed = upload_video(
|
failed = upload_video(
|
||||||
filename=path,
|
filename=path,
|
||||||
description=f"{title} {hashtags_str}\n{description}",
|
description=final_description,
|
||||||
cookies_str=cookies,
|
cookies_str=cookies,
|
||||||
browser="chrome",
|
browser="chrome",
|
||||||
comment=True,
|
comment=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user