Files
RedditVideoMakerBot/utils/id.py
T
SimonandCallum Leslie 5a8db46178 Bot can run multiple instances at the same time (#1091)
* Bot can run multiple instances at the same time

* Delete TTS/__pycache__ directory

* Delete video_creation/__pycache__ directory

* Delete videos.json

* Delete utils/__pycache__ directory

* Create videos.json

* Moved id to utils

* Added cleanup in shutdown and fixed bug

* Removed watermark todo and fixed it

* Delete final_video.py

* Update final_video.py

* Delete video.py

* Update video.py

* Delete id.py

* feat: meaningful error message for bad credentials

* chore: remove comment reference to .env

Co-authored-by: Callum Leslie <git@cleslie.uk>
2022-08-09 20:48:15 +00:00

10 lines
288 B
Python

import re
from utils import print_substep
def id(reddit_obj: dict):
"""
This function takes a reddit object and returns the post id
"""
id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"])
print_substep(f"Thread ID is {id}", style="bold blue")
return id