aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbunkr_dl17
1 files changed, 2 insertions, 15 deletions
diff --git a/bunkr_dl b/bunkr_dl
index 9ea1184..3614745 100755
--- a/bunkr_dl
+++ b/bunkr_dl
@@ -177,19 +177,6 @@ def download_file(file_url, file_name, save_dir, retries=5):
print(f"Failed to download {file_url} after {retries} attempts.")
return None
-def ensure_unique_folder(base_folder, folder_name):
- """Ensure the folder name is unique by adding suffixes like ' - 2', ' - 3' if necessary"""
- folder_path = os.path.join(base_folder, folder_name)
- if not os.path.exists(folder_path):
- return folder_path
-
- # If folder exists, add a numerical suffix
- suffix = 2
- while os.path.exists(f"{folder_path} - {suffix}"):
- suffix += 1
-
- return f"{folder_path} - {suffix}"
-
def process_album(album_url, base_save_directory):
"""Process a single album to download all media"""
soup = get_soup(album_url)
@@ -197,8 +184,8 @@ def process_album(album_url, base_save_directory):
return
album_title = extract_album_title(soup)
- # Create a unique subfolder for the album title inside the base directory
- album_save_directory = ensure_unique_folder(base_save_directory, album_title)
+ # Reuse an existing album folder so a rerun resumes instead of starting over
+ album_save_directory = os.path.join(base_save_directory, album_title)
os.makedirs(album_save_directory, exist_ok=True)
# Step 1: Get all media links (images/videos) from the album page