mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 01:06:19 +00:00
Fix typos and remove newlines since they're broken
This commit is contained in:
@@ -23,26 +23,27 @@ class TikTokUploadEngine(BaseUploadEngine):
|
|||||||
return
|
return
|
||||||
title: str = self.ctx.title
|
title: str = self.ctx.title
|
||||||
description: str = self.ctx.description
|
description: str = self.ctx.description
|
||||||
hastags = self.hashtags.strip().split(" ")
|
hashtags = self.hashtags.strip().split(" ")
|
||||||
|
|
||||||
# extract any hashtags from the description / title and remove them from the description
|
# extract any hashtags from the description / title and remove them from the description
|
||||||
for word in title.split():
|
for word in title.split():
|
||||||
if word.startswith("#"):
|
if word.startswith("#"):
|
||||||
hastags.append(word)
|
hashtags.append(word)
|
||||||
title = title.replace(word, "")
|
title = title.replace(word, "")
|
||||||
for word in description.split():
|
for word in description.split():
|
||||||
if word.startswith("#"):
|
if word.startswith("#"):
|
||||||
hastags.append(word)
|
hashtags.append(word)
|
||||||
description = description.replace(word, "")
|
description = description.replace(word, "")
|
||||||
|
|
||||||
title = title.strip()
|
title = title.strip()
|
||||||
description = description.strip()
|
description = description.strip().replace("\n", " ") # Newlines are not supported by this uploader
|
||||||
hastags_str = " ".join(hastags) + " " if hastags else ""
|
hashtags_str = " ".join(hashtags) + " " if hashtags else ""
|
||||||
failed = upload_video(
|
failed = upload_video(
|
||||||
filename=self.ctx.get_file_path("final.mp4"),
|
filename=self.ctx.get_file_path("final.mp4"),
|
||||||
description=f"{title} {description} {hastags_str}",
|
description=f"{title} {description} {hashtags_str}",
|
||||||
cookies_str=cookies,
|
cookies_str=cookies,
|
||||||
browser="firefox",
|
browser="chrome",
|
||||||
|
comment=True, stitch=False, duet=False
|
||||||
)
|
)
|
||||||
for _ in failed:
|
for _ in failed:
|
||||||
gr.Error(f"Failed to upload to TikTok")
|
gr.Error(f"Failed to upload to TikTok")
|
||||||
|
|||||||
Reference in New Issue
Block a user