Updated code to move files to /opt/cdxfiles/mediafire

This commit is contained in:
datechnoman 2024-01-08 11:09:35 +00:00
parent 42be737ee6
commit 85319ba390

View File

@ -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.")