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: