# MyMiniFactory Model Downloader

> Source: <https://gist.github.com/deliriyum/d353b9528e970e242b1915bb51da2a61>
> Published: 2025-10-08 19:08:33+00:00

README.md - Full workflow explanation 1_mmf_download_metadata.sh - Get JSON metadata 2_mmf_download_stl_files.sh - Get actual files Key features both scripts have: ✅ Windows line ending fixes (automatic) ✅ Cookie authentication handling ✅ Rate limiting to be respectful to servers ✅ Clear error messages and progress tracking ✅ Comprehensive troubleshooting documentation Script 2 specifically includes: ✅ Redirect following with -L flag (critical fix) ✅ URL cleaning to handle Windows corruption ✅ jq path detection for cross-platform compatibility BONUS EXTRACTION AND RENAMING SCRIPTS FOR WINDOWS 3_extract_all_zips.ps1 - [BONUS] Windows mass extraction 4_rename_folders_from_json.ps1 - [BONUS] Intelligent renaming What Users Need to Update: Extract Script (extract_all_zips.ps1): $BASE_PATH - Path to their stl_files directory $EXTRACT_IN_PLACE - Choose extraction mode (true/false) Rename Script (rename_folders_from_json.ps1): $JSON_PATH - Path to directory with JSON files (usually downloads) $FOLDERS_PATH - Path to stl_files directory with model folders $NAMING_FORMAT - Choose "ID_NAME" or "NAME_ONLY" style $MAX_NAME_LENGTH - Customize if needed Both scripts include: ✅ Clear "UPDATE THIS" sections at the top with example paths ✅ Path validation with helpful error messages if wrong ✅ All the fixes we discovered (Explorer locks, filename cleaning, etc.) ✅ Progress tracking and summary statistics ✅ Comprehensive troubleshooting sections based on our debugging ✅ Safe operation - won't overwrite or damage existing data
New Features: ✅ Cookie Validation - Checks for PHPSESSID and cf_clearance before starting ✅ Test Mode - Run with --test flag to verify setup with one file first ✅ HTML Error Detection - Catches "enable Javascript" pages automatically ✅ Consecutive Failure Protection - Stops after 3 failures in a row (systematic error) ✅ Better Error Messages - Shows actual error content and troubleshooting steps ✅ Detailed Cookie Instructions - Step-by-step guide in the script header ✅ Early Exit - Won't download 157 error pages before noticing something's wrong Key Improvements: Test mode will catch the issue immediately: bash mmf_download_stl_files_enhanced.sh --test This downloads ONE file and validates it before proceeding. Cookie validation checks for cf_clearance - The "enable Javascript" error is almost always missing this Cloudflare token Shows the actual error page content so they can see what MyMiniFactory is returning Stops after 3 consecutive failures instead of downloading 157 HTML error pages Replace your script with this enhanced version Run [bash mmf_download_stl_files_enhanced.sh --test] first If test fails, follow the error message instructions to get a fresh cookie Make sure cookie is from a download request, not just browsing the site.
