diff --git a/mediafire_automated_cdx_processor.py b/mediafire_automated_cdx_processor.py index b1be716..db342aa 100644 --- a/mediafire_automated_cdx_processor.py +++ b/mediafire_automated_cdx_processor.py @@ -2,7 +2,6 @@ import os import subprocess import json -import tarfile # Use tarfile for creating tar archives from datetime import datetime, timedelta from concurrent.futures import ThreadPoolExecutor from urllib.parse import urlparse @@ -184,11 +183,8 @@ def main(): for filename in os.listdir(MEDIAFIRE_DIRECTORY): file_path = os.path.join(MEDIAFIRE_DIRECTORY, filename) if filename.endswith(".cdx.json") and os.path.getmtime(file_path) < older_than_24_hours.timestamp(): - # Appending to the existing tar file - with tarfile.open(os.path.join(MEDIAFIRE_DIRECTORY, 'mediafire_cdxfiles_archive.tar'), 'a') as tar: - tar.add(file_path, arcname=filename) os.remove(file_path) - print(f"Added '{filename}' to 'mediafire_cdxfiles_archive.tar' and removed the JSON file.") + print(f"Deleted '{filename}' as it is older than 24 hours.") run_ia_command() # Run IA command after processing older files