From 85319ba3908d13b70e4afa4638e990cb1f6d472c Mon Sep 17 00:00:00 2001 From: datechnoman Date: Mon, 8 Jan 2024 11:09:35 +0000 Subject: [PATCH] Updated code to move files to /opt/cdxfiles/mediafire --- mediafire_automated_cdx_processor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mediafire_automated_cdx_processor.py b/mediafire_automated_cdx_processor.py index 95361a8..2a0acbc 100644 --- a/mediafire_automated_cdx_processor.py +++ b/mediafire_automated_cdx_processor.py @@ -7,8 +7,8 @@ from urllib.parse import urlparse MEDIAFIRE_DIRECTORY = "/opt/cdxfiles/mediafire" ROOT_DIRECTORY = "/root/mediafire_files" -CONCURRENCY = 6 -BATCH_SIZE = 6 +CONCURRENCY = 10 +BATCH_SIZE = 10 def run_cdxsummary(file_path, json_filepath): # Construct the cdxsummary command @@ -42,6 +42,11 @@ def run_cdxsummary(file_path, json_filepath): print(f"Created JSON file for '{file_path}': '{json_filepath}'") + # Move the JSON file to /opt/cdxfiles/mediafire + destination_path = os.path.join(MEDIAFIRE_DIRECTORY, os.path.basename(json_filepath)) + os.rename(json_filepath, destination_path) + print(f"Moved '{os.path.basename(json_filepath)}' to '{MEDIAFIRE_DIRECTORY}'.") + # Delete the .cdx.gz file os.remove(file_path) print(f"Deleted '{file_path}' after processing.")