Files
RedditVideoMakerBot/utils/cleanup.py
T
Simon 0ea74e43f1 Version 3.2
The RedditVideoMakerBot has been updated to version 3.2, bringing exciting new features and bug fixes. Introducing **ElevenLabs TTS** for high-quality audio. Enjoy **background audio** and **random voices per comment**. Run the bot with one click using the **bat file**. Use the **zoom setting** for bigger text. Bug fixes include video downloader improvements, random story mode fix, updated dependencies, code optimizations, text size adjustments, enhanced Reddit credentials validation, and translator fixes. Enjoy the new features and **thanks to all contributors**!
2023-05-28 16:05:41 +02:00

21 lines
422 B
Python

import os
from os.path import exists
import shutil
def _listdir(d): # listdir with full path
return [os.path.join(d, f) for f in os.listdir(d)]
def cleanup(reddit_id) -> int:
"""Deletes all temporary assets in assets/temp
Returns:
int: How many files were deleted
"""
directory = f"../assets/temp/{reddit_id}/"
if exists(directory):
shutil.rmtree(directory)
return 1