|
| 1 | +# 🎯 Selective Download Guide |
| 2 | + |
| 3 | +This guide explains how to download only specific lessons from a Thinkific course instead of downloading the entire course. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The Thinkific Downloader supports selective downloads using a JSON configuration file that specifies exactly which lessons you want to download. This is useful when you only need certain chapters or want to avoid downloading large files you don't need. |
| 8 | + |
| 9 | +## Methods Available |
| 10 | + |
| 11 | +### Method 1: Using Environment Variable (Recommended) |
| 12 | + |
| 13 | +1. **Create or obtain a course data JSON file** (see options below) |
| 14 | +2. **Set the file path in your `.env` file:** |
| 15 | + ```bash |
| 16 | + COURSE_DATA_FILE="my-selective-lessons.json" |
| 17 | + ``` |
| 18 | +3. **Run the downloader:** |
| 19 | + ```bash |
| 20 | + python -m thinkific_downloader |
| 21 | + ``` |
| 22 | + |
| 23 | +### Method 2: Using Command Line Flag |
| 24 | + |
| 25 | +You can specify the JSON file directly via command line: |
| 26 | +```bash |
| 27 | +python -m thinkific_downloader --json my-selective-lessons.json |
| 28 | +``` |
| 29 | + |
| 30 | +### Method 3: Docker with Selective Downloads |
| 31 | + |
| 32 | +```bash |
| 33 | +# Set in your .env file |
| 34 | +COURSE_DATA_FILE="selective-lessons.json" |
| 35 | + |
| 36 | +# Run with Docker |
| 37 | +docker-compose up |
| 38 | +``` |
| 39 | + |
| 40 | +## Creating Your Selective JSON File |
| 41 | + |
| 42 | +### Option A: From Existing Progress File |
| 43 | + |
| 44 | +If you've already run the downloader once: |
| 45 | + |
| 46 | +1. **Copy the generated progress file:** |
| 47 | + ```bash |
| 48 | + # Windows |
| 49 | + copy "downloads\\your-course-name\\.thinkific_progress.json" "selective-lessons.json" |
| 50 | + |
| 51 | + # Linux/Mac |
| 52 | + cp "downloads/your-course-name/.thinkific_progress.json" "selective-lessons.json" |
| 53 | + ``` |
| 54 | + |
| 55 | +2. **Edit the file** to remove unwanted lessons from the `download_tasks` array |
| 56 | + |
| 57 | +3. **Keep the structure intact** - only modify the contents of the arrays |
| 58 | + |
| 59 | +### Option B: Create from Scratch |
| 60 | + |
| 61 | +Create a JSON file with this structure: |
| 62 | + |
| 63 | +```json |
| 64 | +{ |
| 65 | + "analyzed_chapters": ["chapter_1", "chapter_3", "chapter_5"], |
| 66 | + "download_tasks": [ |
| 67 | + { |
| 68 | + "url": "https://embed-ssl.wistia.com/deliveries/video-id-here.bin", |
| 69 | + "dest_path": "1. chapter-name\\1.lesson-name\\lesson-file.mp4", |
| 70 | + "content_type": "video" |
| 71 | + }, |
| 72 | + { |
| 73 | + "url": "https://course-files.thinkific.com/document.pdf", |
| 74 | + "dest_path": "1. chapter-name\\2.document-lesson\\document.pdf", |
| 75 | + "content_type": "document" |
| 76 | + } |
| 77 | + ] |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +## Understanding the JSON Structure |
| 82 | + |
| 83 | +### `analyzed_chapters` |
| 84 | +- Array of chapter IDs that have been processed |
| 85 | +- Format: `["chapter_1", "chapter_2", "chapter_N"]` |
| 86 | +- Used to track which chapters have been analyzed |
| 87 | + |
| 88 | +### `download_tasks` |
| 89 | +Each task has three required fields: |
| 90 | + |
| 91 | +- **`url`**: Direct download URL for the content |
| 92 | +- **`dest_path`**: Local file path where content will be saved |
| 93 | +- **`content_type`**: Type of content (`video`, `document`, `html`, `audio`) |
| 94 | + |
| 95 | +## Content Types Supported |
| 96 | + |
| 97 | +| Content Type | Description | File Extensions | |
| 98 | +|--------------|-------------|-----------------| |
| 99 | +| `video` | Video lessons (Wistia, MP4) | `.mp4`, `.mov`, `.avi` | |
| 100 | +| `document` | PDF documents, slides | `.pdf`, `.ppt`, `.pptx` | |
| 101 | +| `html` | Text lessons, notes | `.html` | |
| 102 | +| `audio` | Audio files | `.mp3`, `.m4a`, `.wav` | |
| 103 | + |
| 104 | +## Example Workflows |
| 105 | + |
| 106 | +### Download Only Videos from Specific Chapters |
| 107 | + |
| 108 | +1. Run the full download once to get the complete JSON |
| 109 | +2. Copy the progress file to `videos-only.json` |
| 110 | +3. Edit to keep only entries where `content_type` is `"video"` |
| 111 | +4. Remove chapters you don't want from `analyzed_chapters` |
| 112 | +5. Set `COURSE_DATA_FILE="videos-only.json"` in `.env` |
| 113 | + |
| 114 | +### Download Only First 5 Lessons |
| 115 | + |
| 116 | +1. Get the complete JSON file |
| 117 | +2. Keep only the first 5 entries in `download_tasks` |
| 118 | +3. Update `analyzed_chapters` to match |
| 119 | +4. Use the modified file |
| 120 | + |
| 121 | +### Skip Large Video Files |
| 122 | + |
| 123 | +1. Edit the JSON to remove large video entries |
| 124 | +2. Keep documents, text, and smaller videos |
| 125 | +3. Use the filtered JSON for download |
| 126 | + |
| 127 | +## Tips and Best Practices |
| 128 | + |
| 129 | +### File Path Management |
| 130 | +- Use forward slashes (`/`) or double backslashes (`\\\\`) in paths |
| 131 | +- Ensure destination directories exist or will be created |
| 132 | +- Keep the original folder structure for organization |
| 133 | + |
| 134 | +### Performance Optimization |
| 135 | +- Fewer tasks = faster completion |
| 136 | +- Remove unnecessary content types to save bandwidth |
| 137 | +- Use `CONCURRENT_DOWNLOADS=1` for selective downloads to avoid rate limiting |
| 138 | + |
| 139 | +### Validation |
| 140 | +- Ensure all URLs are accessible |
| 141 | +- Verify file paths are valid for your operating system |
| 142 | +- Test with a small subset first |
| 143 | + |
| 144 | +## Troubleshooting |
| 145 | + |
| 146 | +### "File not found" Error |
| 147 | +``` |
| 148 | +COURSE_DATA_FILE env var not set. |
| 149 | +``` |
| 150 | +**Solution:** Ensure the JSON file exists in the project root directory and the path in `.env` is correct. |
| 151 | + |
| 152 | +### "Invalid JSON" Error |
| 153 | +**Solution:** Validate your JSON syntax using an online JSON validator or text editor with JSON support. |
| 154 | + |
| 155 | +### Missing Downloads |
| 156 | +**Solution:** Check that the `url` fields in your JSON are still valid and accessible. |
| 157 | + |
| 158 | +### Permission Errors |
| 159 | +**Solution:** Ensure the destination directories are writable and you have sufficient disk space. |
| 160 | + |
| 161 | +## Getting Help |
| 162 | + |
| 163 | +- See [ENV_SETUP.md](ENV_SETUP.md) for authentication setup |
| 164 | +- See [README.md](README.md) for general usage |
| 165 | +- Enable `DEBUG=true` for detailed logging |
| 166 | +- Check the generated progress files for examples of proper JSON structure |
0 commit comments