Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Thinkific-Downloader Environment Configuration
# 🔧 IMPORTANT: See ENV_SETUP.md for complete step-by-step setup instructions
# Copy this file to .env and fill in your actual values

# ===============================================
# REQUIRED AUTHENTICATION
# REQUIRED AUTHENTICATION
# ===============================================
# ⚠️ NEED HELP? Follow the complete guide: ENV_SETUP.md

# For downloading all content, use the course link.
COURSE_LINK="https://your-thinkific-site.com/api/course_player/v2/courses/your-course-name"
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- 'v*.*.*'

permissions:
contents: write
packages: write

jobs:
release:
name: 📦 Create Release
Expand All @@ -19,12 +23,10 @@ jobs:
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: 🎉 Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
release_name: 🚀 Release ${{ steps.version.outputs.tag }}
name: 🚀 Release ${{ steps.version.outputs.tag }}
body: |
## 🎉 New Release: ${{ steps.version.outputs.tag }}

Expand All @@ -39,14 +41,14 @@ jobs:

**GitHub Packages:**
```bash
docker pull ghcr.io/itskavin/thinkific-downloader:${{ steps.version.outputs.tag }}
docker pull ghcr.io/bytetrix/thinkific-downloader:${{ steps.version.outputs.tag }}
# or
docker pull ghcr.io/itskavin/thinkific-downloader:latest
docker pull ghcr.io/bytetrix/thinkific-downloader:latest
```

**Setup and Run:**
```bash
git clone https://github.com/itskavin/Thinkific-Downloader.git
git clone https://github.com/ByteTrix/Thinkific-Downloader.git
cd Thinkific-Downloader
cp .env.example .env
# Edit .env with your details
Expand All @@ -55,7 +57,7 @@ jobs:

**Python Direct:**
```bash
git clone https://github.com/itskavin/Thinkific-Downloader.git
git clone https://github.com/ByteTrix/Thinkific-Downloader.git
cd Thinkific-Downloader
pip install -r requirements.txt
python thinkificdownloader.py
Expand Down Expand Up @@ -83,7 +85,8 @@ jobs:
id: version
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: 🔑 Login to Docker Hub
- name: 🔑 Login to Docker Hub (Optional)
continue-on-error: true
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -96,7 +99,8 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🔧 Build and Push to Docker Hub
- name: 🔧 Build and Push to Docker Hub (Optional)
continue-on-error: true
run: |
docker build -t kvnxo/thinkific-downloader:latest .
docker build -t kvnxo/thinkific-downloader:${{ steps.version.outputs.tag }} .
Expand Down
6 changes: 6 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ pip install pre-commit
pre-commit install
```

### **2.1 Environment Configuration**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The heading level 2.1 is a bit confusing in the document's structure. To improve clarity and consistency, consider making this a top-level step in the setup process. For example, you could change this to ### **3. Environment Configuration** and then renumber the subsequent IDE Configuration section to 4..

Suggested change
### **2.1 Environment Configuration**
### **3. Environment Configuration**


**🔧 For testing and development**, you'll need to set up authentication:
- **Production Guide**: [ENV_SETUP.md](ENV_SETUP.md) - Complete setup for end users
- **Development**: Copy `.env.example` to `.env` and configure for your test course

### **3. IDE Configuration**

#### **VS Code Settings** (`.vscode/settings.json`)
Expand Down
231 changes: 231 additions & 0 deletions ENV_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# 🔧 Environment Setup Guide

This guide will walk you through setting up the required environment variables to download courses from Thinkific-based platforms.

## **Reference Video (Optional)**

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)**

**⚠️ 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.

---

## Prerequisites

- A web browser (Chrome, Firefox, Edge, Safari)
- Access to the course you want to download
- Basic knowledge of browser Developer Tools

## 🎯 Quick Overview

You need to configure 3 main variables in your `.env` file:
- `COURSE_LINK` - The URL of the course
- `COOKIE_DATA` - Authentication cookies from your browser
- `CLIENT_DATE` - Timestamp for API requests

---

## 📝 Step-by-Step Setup

### **Step 1: Copy Environment Template**

First, create your environment file from the template:

```bash
# Copy the example file
cp .env.example .env
```

Or manually create a `.env` file and copy the contents from `.env.example`.

### **Step 2: Get Course Link**

1. **Log into your course platform** (the Thinkific-based site)
2. **Navigate to the course** you want to download
3. **Copy the full URL** from your browser's address bar
4. **Add it to your .env file:**
```env
COURSE_LINK=https://your-course-platform.com/courses/your-course-name
```

### **Step 3: Extract Authentication Data**

This is the most important step. You need to capture authentication cookies and timestamp.

**📺 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.

#### **3.1 Open Developer Tools**

**For Chrome/Edge:**
- Press `F12` OR
- Right-click → "Inspect" OR
- Menu → More Tools → Developer Tools

**For Firefox:**
- Press `F12` OR
- Right-click → "Inspect Element" OR
- Menu → Web Developer → Inspector

**For Safari:**
- Enable Developer menu first: Safari → Preferences → Advanced → "Show Develop menu"
- Then: Develop → Show Web Inspector

#### **3.2 Access Network Tab**

1. **Click on the "Network" tab** in Developer Tools
2. **Make sure "All" or "XHR" filter is selected**
3. **Clear any existing logs** (click the clear button 🗑️)

#### **3.3 Trigger Course Data Request**

1. **Refresh the course page** (F5 or Ctrl+R)
2. **OR navigate to any lesson** within the course
3. **Wait for the page to fully load**

#### **3.4 Find the API Request**

1. **In the Network tab, look for a request containing:**
```
course_player/v2/courses/
```

2. **It might look like:**
- `course_player/v2/courses/123456`
- `course_player/v2/courses/your-course-id`

3. **Click on this request** to select it

#### **3.5 Extract Cookie Data**

1. **Click on the request** you found
2. **Look for the "Headers" section** (or click "Headers" tab)
3. **Find "Request Headers" section**
4. **Look for the "cookie:" line** (it will be long)
5. **Copy the entire cookie value** (everything after "cookie: ")

```env
COOKIE_DATA=_session_id=abc123...; user_token=xyz789...;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example for COOKIE_DATA here includes a trailing space and semicolon. This might be confusing for users copying the value. To make it clearer, I suggest providing a cleaner example without the trailing characters, similar to the one in the 'Final Environment File' section.

Suggested change
COOKIE_DATA=_session_id=abc123...; user_token=xyz789...;
COOKIE_DATA=_session_id=abc123...; user_token=xyz789...

```

**⚠️ Important:**
- Copy the ENTIRE cookie string
- It should be very long (several hundred characters)
- Include all parts separated by semicolons

#### **3.6 Extract Client Date**

1. **In the same request headers section**
2. **Look for "Response Headers"**
3. **Find the "date:" field**
4. **Copy the date value**

```env
CLIENT_DATE=Wed, 25 Sep 2024 10:30:45 GMT
```

---

## 🔍 Alternative Method: Raw View

If you're having trouble finding the headers:

1. **Click on the course_player request**
2. **Click "Raw" tab** (if available)
3. **Look for lines starting with:**
- `cookie: ` (copy everything after this)
- `date: ` (copy everything after this)
Comment on lines +135 to +136
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The 'Raw View' method can be a bit confusing as it doesn't specify where to find the cookie and date headers. To improve clarity, it would be helpful to mention that cookie: is part of the request headers, while date: is found in the response headers.

Suggested change
- `cookie: ` (copy everything after this)
- `date: ` (copy everything after this)
- `cookie: ` (in the request headers part, copy everything after this)
- `date: ` (in the response headers part, copy everything after this)


---

## ✅ Final Environment File

Your `.env` file should look like this:

```env
# Course Configuration
COURSE_LINK=https://your-platform.com/courses/your-course

# Authentication (Required)
COOKIE_DATA=_session_id=abcd1234...; user_token=xyz789...; other_cookies=values...
CLIENT_DATE=Wed, 25 Sep 2024 10:30:45 GMT

# Download Settings (Optional)
OUTPUT_DIR=./downloads
CONCURRENT_DOWNLOADS=3
RETRY_ATTEMPTS=3
RESUME_PARTIAL=true
RATE_LIMIT_MB_S=10.0
DEBUG=false
```

---

## 🚨 Troubleshooting

**📺 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.

### **Problem: Can't find course_player request**

**Solutions:**
1. Make sure you're logged into the course
2. Try navigating to different lessons
3. Refresh the page with Network tab open
4. Check if the URL pattern is slightly different (search for "course" in Network tab)

### **Problem: Cookies not working**

**Solutions:**
1. Make sure you copied the ENTIRE cookie string
2. Cookies expire - get fresh ones
3. Try logging out and back in, then repeat the process

### **Problem: Invalid date format**

**Solutions:**
1. Copy the exact date format from the response headers
2. It should look like: `Wed, 25 Sep 2024 10:30:45 GMT`
3. Don't modify the format

### **Problem: Download fails with authentication errors**

**Solutions:**
1. Refresh your cookies (they might have expired)
2. Make sure you have access to the course
3. Check that COURSE_LINK points to the correct course

---

## 🔒 Security Notes

- **Keep your .env file private** - it contains your authentication data
- **Don't commit .env to version control** (it's in .gitignore by default)
- **Cookies expire** - you may need to refresh them periodically
- **Only use on courses you have legitimate access to**

---

## 🎯 Quick Validation

Test your setup by running:

```bash
# Docker
docker-compose up

# Python
python thinkificdownloader.py
```

If authentication works, you should see course information being fetched. If not, double-check your cookie data.

---

## 📞 Need Help?

- 🐛 **Issues**: [Report Problems](https://github.com/ByteTrix/Thinkific-Downloader/issues)
- 💬 **Questions**: [Community Discussions](https://github.com/ByteTrix/Thinkific-Downloader/discussions)
- 📚 **Documentation**: [Main README](README.md)

---

**⚡ Pro Tip:** Bookmark this guide! You'll need to refresh your cookies periodically as they expire.
Loading