diff --git a/.env.example b/.env.example index 06d3c77..a2f30fd 100644 --- a/.env.example +++ b/.env.example @@ -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" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ebe7c0..9389fa8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: tags: - 'v*.*.*' +permissions: + contents: write + packages: write + jobs: release: name: 📦 Create Release @@ -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 }} @@ -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 @@ -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 @@ -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 }} @@ -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 }} . diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index a0cdb5b..a7f231a 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -113,6 +113,12 @@ pip install pre-commit pre-commit install ``` +### **2.1 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`) diff --git a/ENV_SETUP.md b/ENV_SETUP.md new file mode 100644 index 0000000..869b11b --- /dev/null +++ b/ENV_SETUP.md @@ -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...; + ``` + +**⚠️ 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) + +--- + +## ✅ 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. \ No newline at end of file diff --git a/README.md b/README.md index 7bf7bf3..5336052 100644 --- a/README.md +++ b/README.md @@ -83,12 +83,14 @@ A modern, feature-rich Python utility to download courses from Thinkific platfor **⚠️ Important**: Always clone or download the project first! The application needs access to the project directory for downloads, configuration files (.env), and proper functionality. +**🔧 FIRST TIME USERS:** Before running the application, you MUST set up your environment variables. **[Follow our Complete Environment Setup Guide](ENV_SETUP.md)** for step-by-step instructions on extracting authentication data from your browser. + ### **🐳 Docker (Recommended)** **Step 1: Get the Project** ```bash # Clone or download the project -git clone https://github.com/itskavin/Thinkific-Downloader.git +git clone https://github.com/ByteTrix/Thinkific-Downloader.git cd Thinkific-Downloader # Or download and extract ZIP, then navigate to project directory @@ -96,11 +98,13 @@ cd Thinkific-Downloader **Step 2: Setup Environment** ```bash -# Create your .env file (see configuration section below) +# Create your .env file cp .env.example .env -# Edit .env with your course details +# Edit .env with your course details - See detailed guide below ``` +**📋 [Complete Environment Setup Guide](ENV_SETUP.md) ← Click here for step-by-step instructions** + **Step 3: Run with Docker** ```bash # Option 1: Docker Hub @@ -108,8 +112,8 @@ docker pull kvnxo/thinkific-downloader docker run -it --rm -v $(pwd)/downloads:/app/downloads --env-file .env kvnxo/thinkific-downloader # Option 2: GitHub Packages -docker pull ghcr.io/itskavin/thinkific-downloader -docker run -it --rm -v $(pwd)/downloads:/app/downloads --env-file .env ghcr.io/itskavin/thinkific-downloader +docker pull ghcr.io/bytetrix/thinkific-downloader +docker run -it --rm -v $(pwd)/downloads:/app/downloads --env-file .env ghcr.io/bytetrix/thinkific-downloader # Option 3: Docker Compose (recommended) docker-compose up @@ -119,13 +123,17 @@ docker-compose up ```bash # Step 1: Clone the project -git clone https://github.com/itskavin/Thinkific-Downloader.git +git clone https://github.com/ByteTrix/Thinkific-Downloader.git cd Thinkific-Downloader # Step 2: Install dependencies pip install -r requirements.txt -# Step 3: Configure and run +# Step 3: Configure environment +cp .env.example .env +# ⚠️ IMPORTANT: See ENV_SETUP.md for detailed configuration instructions + +# Step 4: Run the downloader # Update environment variables in .env file python thinkificdownloader.py ``` @@ -136,12 +144,12 @@ Get the latest source code: ```bash # Clone the repository -git clone https://github.com/itskavin/Thinkific-Downloader.git +git clone https://github.com/ByteTrix/Thinkific-Downloader.git cd Thinkific-Downloader -# Setup and run with Docker +# Setup environment variables cp .env.example .env -# Edit .env with your course details +# ⚠️ IMPORTANT: Follow the complete setup guide: ENV_SETUP.md docker-compose up # Or run with Python @@ -161,6 +169,8 @@ python thinkificdownloader.py ## ⚙️ **Enhanced Configuration** +**🚨 BEFORE YOU START:** Follow our **[Complete Environment Setup Guide](ENV_SETUP.md)** for step-by-step instructions on extracting authentication data from your browser. + Configure advanced features via environment variables or `.env` file: ```bash diff --git a/SETUP.md b/SETUP.md index a1318fc..ef25816 100644 --- a/SETUP.md +++ b/SETUP.md @@ -49,9 +49,11 @@ Get the latest version directly from GitHub: 2. **Setup configuration**: ```bash cp .env.example .env - # Edit .env with your course details (see Authentication Setup below) + # ⚠️ IMPORTANT: Follow ENV_SETUP.md for detailed authentication setup ``` + **🔧 [Complete Environment Setup Guide](ENV_SETUP.md)** - Step-by-step instructions for extracting authentication data + 3. **Run with Docker** (Recommended): ```bash docker-compose up diff --git a/setup.py b/setup.py index 6416b43..2179f93 100644 --- a/setup.py +++ b/setup.py @@ -62,9 +62,9 @@ ], keywords="thinkific downloader education video course offline", project_urls={ - "Bug Reports": "https://github.com/itskavin/Thinkific-Downloader/issues", - "Source": "https://github.com/itskavin/Thinkific-Downloader", - "Documentation": "https://github.com/itskavin/Thinkific-Downloader#readme", + "Bug Reports": "https://github.com/ByteTrix/Thinkific-Downloader/issues", + "Source": "https://github.com/ByteTrix/Thinkific-Downloader", + "Documentation": "https://github.com/ByteTrix/Thinkific-Downloader#readme", "Docker Hub": "https://hub.docker.com/r/kvnxo/thinkific-downloader", }, ) \ No newline at end of file