|
| 1 | +# 🔧 Environment Setup Guide |
| 2 | + |
| 3 | +This guide will walk you through setting up the required environment variables to download courses from Thinkific-based platforms. |
| 4 | + |
| 5 | +## **Reference Video (Optional)** |
| 6 | + |
| 7 | +For a general overview of using browser DevTools to extract authentication data, you can watch this reference video: **[How to Extract Authentication Data from Browser](https://youtu.be/owi-cOcpceI?t=60)** |
| 8 | + |
| 9 | +**⚠️ Important Note:** The video above is just a **general reference** for understanding browser DevTools concepts. **Follow the specific steps below for this Thinkific Downloader project**, as the exact fields and process may differ from the video. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + |
| 15 | +- A web browser (Chrome, Firefox, Edge, Safari) |
| 16 | +- Access to the course you want to download |
| 17 | +- Basic knowledge of browser Developer Tools |
| 18 | + |
| 19 | +## 🎯 Quick Overview |
| 20 | + |
| 21 | +You need to configure 3 main variables in your `.env` file: |
| 22 | +- `COURSE_LINK` - The URL of the course |
| 23 | +- `COOKIE_DATA` - Authentication cookies from your browser |
| 24 | +- `CLIENT_DATE` - Timestamp for API requests |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## 📝 Step-by-Step Setup |
| 29 | + |
| 30 | +### **Step 1: Copy Environment Template** |
| 31 | + |
| 32 | +First, create your environment file from the template: |
| 33 | + |
| 34 | +```bash |
| 35 | +# Copy the example file |
| 36 | +cp .env.example .env |
| 37 | +``` |
| 38 | + |
| 39 | +Or manually create a `.env` file and copy the contents from `.env.example`. |
| 40 | + |
| 41 | +### **Step 2: Get Course Link** |
| 42 | + |
| 43 | +1. **Log into your course platform** (the Thinkific-based site) |
| 44 | +2. **Navigate to the course** you want to download |
| 45 | +3. **Copy the full URL** from your browser's address bar |
| 46 | +4. **Add it to your .env file:** |
| 47 | + ```env |
| 48 | + COURSE_LINK=https://your-course-platform.com/courses/your-course-name |
| 49 | + ``` |
| 50 | + |
| 51 | +### **Step 3: Extract Authentication Data** |
| 52 | + |
| 53 | +This is the most important step. You need to capture authentication cookies and timestamp. |
| 54 | + |
| 55 | +**📺 Visual Reference:** While the [video guide](https://youtu.be/owi-cOcpceI?t=60) shows similar concepts, **follow these exact steps below** for Thinkific-based platforms. |
| 56 | + |
| 57 | +#### **3.1 Open Developer Tools** |
| 58 | + |
| 59 | +**For Chrome/Edge:** |
| 60 | +- Press `F12` OR |
| 61 | +- Right-click → "Inspect" OR |
| 62 | +- Menu → More Tools → Developer Tools |
| 63 | + |
| 64 | +**For Firefox:** |
| 65 | +- Press `F12` OR |
| 66 | +- Right-click → "Inspect Element" OR |
| 67 | +- Menu → Web Developer → Inspector |
| 68 | + |
| 69 | +**For Safari:** |
| 70 | +- Enable Developer menu first: Safari → Preferences → Advanced → "Show Develop menu" |
| 71 | +- Then: Develop → Show Web Inspector |
| 72 | + |
| 73 | +#### **3.2 Access Network Tab** |
| 74 | + |
| 75 | +1. **Click on the "Network" tab** in Developer Tools |
| 76 | +2. **Make sure "All" or "XHR" filter is selected** |
| 77 | +3. **Clear any existing logs** (click the clear button 🗑️) |
| 78 | + |
| 79 | +#### **3.3 Trigger Course Data Request** |
| 80 | + |
| 81 | +1. **Refresh the course page** (F5 or Ctrl+R) |
| 82 | +2. **OR navigate to any lesson** within the course |
| 83 | +3. **Wait for the page to fully load** |
| 84 | + |
| 85 | +#### **3.4 Find the API Request** |
| 86 | + |
| 87 | +1. **In the Network tab, look for a request containing:** |
| 88 | + ``` |
| 89 | + course_player/v2/courses/ |
| 90 | + ``` |
| 91 | + |
| 92 | +2. **It might look like:** |
| 93 | + - `course_player/v2/courses/123456` |
| 94 | + - `course_player/v2/courses/your-course-id` |
| 95 | + |
| 96 | +3. **Click on this request** to select it |
| 97 | + |
| 98 | +#### **3.5 Extract Cookie Data** |
| 99 | + |
| 100 | +1. **Click on the request** you found |
| 101 | +2. **Look for the "Headers" section** (or click "Headers" tab) |
| 102 | +3. **Find "Request Headers" section** |
| 103 | +4. **Look for the "cookie:" line** (it will be long) |
| 104 | +5. **Copy the entire cookie value** (everything after "cookie: ") |
| 105 | + |
| 106 | + ```env |
| 107 | + COOKIE_DATA=_session_id=abc123...; user_token=xyz789...; |
| 108 | + ``` |
| 109 | + |
| 110 | +**⚠️ Important:** |
| 111 | +- Copy the ENTIRE cookie string |
| 112 | +- It should be very long (several hundred characters) |
| 113 | +- Include all parts separated by semicolons |
| 114 | + |
| 115 | +#### **3.6 Extract Client Date** |
| 116 | + |
| 117 | +1. **In the same request headers section** |
| 118 | +2. **Look for "Response Headers"** |
| 119 | +3. **Find the "date:" field** |
| 120 | +4. **Copy the date value** |
| 121 | + |
| 122 | + ```env |
| 123 | + CLIENT_DATE=Wed, 25 Sep 2024 10:30:45 GMT |
| 124 | + ``` |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## 🔍 Alternative Method: Raw View |
| 129 | + |
| 130 | +If you're having trouble finding the headers: |
| 131 | + |
| 132 | +1. **Click on the course_player request** |
| 133 | +2. **Click "Raw" tab** (if available) |
| 134 | +3. **Look for lines starting with:** |
| 135 | + - `cookie: ` (copy everything after this) |
| 136 | + - `date: ` (copy everything after this) |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## ✅ Final Environment File |
| 141 | + |
| 142 | +Your `.env` file should look like this: |
| 143 | + |
| 144 | +```env |
| 145 | +# Course Configuration |
| 146 | +COURSE_LINK=https://your-platform.com/courses/your-course |
| 147 | +
|
| 148 | +# Authentication (Required) |
| 149 | +COOKIE_DATA=_session_id=abcd1234...; user_token=xyz789...; other_cookies=values... |
| 150 | +CLIENT_DATE=Wed, 25 Sep 2024 10:30:45 GMT |
| 151 | +
|
| 152 | +# Download Settings (Optional) |
| 153 | +OUTPUT_DIR=./downloads |
| 154 | +CONCURRENT_DOWNLOADS=3 |
| 155 | +RETRY_ATTEMPTS=3 |
| 156 | +RESUME_PARTIAL=true |
| 157 | +RATE_LIMIT_MB_S=10.0 |
| 158 | +DEBUG=false |
| 159 | +``` |
| 160 | + |
| 161 | +--- |
| 162 | + |
| 163 | +## 🚨 Troubleshooting |
| 164 | + |
| 165 | +**📺 Need visual help?** The [reference video](https://youtu.be/owi-cOcpceI?t=60) shows general DevTools concepts, but **follow our specific steps above** for this project. |
| 166 | + |
| 167 | +### **Problem: Can't find course_player request** |
| 168 | + |
| 169 | +**Solutions:** |
| 170 | +1. Make sure you're logged into the course |
| 171 | +2. Try navigating to different lessons |
| 172 | +3. Refresh the page with Network tab open |
| 173 | +4. Check if the URL pattern is slightly different (search for "course" in Network tab) |
| 174 | + |
| 175 | +### **Problem: Cookies not working** |
| 176 | + |
| 177 | +**Solutions:** |
| 178 | +1. Make sure you copied the ENTIRE cookie string |
| 179 | +2. Cookies expire - get fresh ones |
| 180 | +3. Try logging out and back in, then repeat the process |
| 181 | + |
| 182 | +### **Problem: Invalid date format** |
| 183 | + |
| 184 | +**Solutions:** |
| 185 | +1. Copy the exact date format from the response headers |
| 186 | +2. It should look like: `Wed, 25 Sep 2024 10:30:45 GMT` |
| 187 | +3. Don't modify the format |
| 188 | + |
| 189 | +### **Problem: Download fails with authentication errors** |
| 190 | + |
| 191 | +**Solutions:** |
| 192 | +1. Refresh your cookies (they might have expired) |
| 193 | +2. Make sure you have access to the course |
| 194 | +3. Check that COURSE_LINK points to the correct course |
| 195 | + |
| 196 | +--- |
| 197 | + |
| 198 | +## 🔒 Security Notes |
| 199 | + |
| 200 | +- **Keep your .env file private** - it contains your authentication data |
| 201 | +- **Don't commit .env to version control** (it's in .gitignore by default) |
| 202 | +- **Cookies expire** - you may need to refresh them periodically |
| 203 | +- **Only use on courses you have legitimate access to** |
| 204 | + |
| 205 | +--- |
| 206 | + |
| 207 | +## 🎯 Quick Validation |
| 208 | + |
| 209 | +Test your setup by running: |
| 210 | + |
| 211 | +```bash |
| 212 | +# Docker |
| 213 | +docker-compose up |
| 214 | + |
| 215 | +# Python |
| 216 | +python thinkificdownloader.py |
| 217 | +``` |
| 218 | + |
| 219 | +If authentication works, you should see course information being fetched. If not, double-check your cookie data. |
| 220 | + |
| 221 | +--- |
| 222 | + |
| 223 | +## 📞 Need Help? |
| 224 | + |
| 225 | +- 🐛 **Issues**: [Report Problems](https://github.com/ByteTrix/Thinkific-Downloader/issues) |
| 226 | +- 💬 **Questions**: [Community Discussions](https://github.com/ByteTrix/Thinkific-Downloader/discussions) |
| 227 | +- 📚 **Documentation**: [Main README](README.md) |
| 228 | + |
| 229 | +--- |
| 230 | + |
| 231 | +**⚡ Pro Tip:** Bookmark this guide! You'll need to refresh your cookies periodically as they expire. |
0 commit comments