aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-03 18:23:35 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-03 18:23:35 -0700
commit9244e32b4fd3c9c0013c99b7f7709cc7e723a6f3 (patch)
treec44079d7990e270bb31aa34b8b9236126d701dca
parentcf53e7b72ee9ad66a187d0423aad61a63253be23 (diff)
generate: delete file after upload
-rw-r--r--playlist_generator/generate_daily.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/playlist_generator/generate_daily.py b/playlist_generator/generate_daily.py
index 039ea87..aba73b0 100644
--- a/playlist_generator/generate_daily.py
+++ b/playlist_generator/generate_daily.py
@@ -25,6 +25,11 @@ def get_obfuscation_key() -> bytes:
date = datetime.now(timezone.utc).strftime("%Y-%m-%d")
return (OBFUSCATION_KEY + date).encode("utf-8")
+def delete_file(file_path):
+ if os.path.exists(file_path):
+ os.remove(file_path)
+ return True
+ return False
def decode_data(hex_data: str):
encrypted = bytes.fromhex(hex_data)
@@ -117,6 +122,7 @@ def main():
clip_path = download_random_segment_mp3(youtube_id)
date = datetime.now(timezone.utc).strftime("%Y-%m-%d")
upload_to_r2(clip_path, f"kheardle/{date}.mp3")
+ delete_file("today.mp3")
write_json("save.json", daily_data)
if __name__ == "__main__":
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage