From 9844015dc5905587f12aba34f88405f5fde87125 Mon Sep 17 00:00:00 2001 From: CoasterFreakDE Date: Mon, 20 Jun 2022 21:30:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=A6=B1NSFW=20tag=20i?= =?UTF-8?q?n=20front=20of=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/subreddit.py | 3 ++- video_creation/video_uploader.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/subreddit.py b/utils/subreddit.py index e05c136..053566c 100644 --- a/utils/subreddit.py +++ b/utils/subreddit.py @@ -1,6 +1,6 @@ from typing import List import json -from os import getenv +from os import environ, getenv from utils.console import print_substep @@ -20,6 +20,7 @@ def get_subreddit_undone(submissions: List, subreddit): continue except AttributeError: print_substep("NSFW settings not defined. Skipping NSFW post...") + environ["nsfw"] = str(submission.over_18) return submission print("all submissions have been done going by top submission order") return get_subreddit_undone( diff --git a/video_creation/video_uploader.py b/video_creation/video_uploader.py index 40fff70..c198ffc 100644 --- a/video_creation/video_uploader.py +++ b/video_creation/video_uploader.py @@ -71,6 +71,10 @@ async def upload_video_to_tiktok(videofile): await asyncio.sleep(10) title = os.getenv("VIDEO_TITLE") or videofile.split(".")[0] + is_nsfw = os.getenv("nsfw") or "false" + if is_nsfw: + title = "#nsfw " + title + tags = os.getenv("TIKTOK_TAGS") or "#AskReddit" if len(title) + len(tags) > 150: