Skip to content

Sonff/TeraFetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 TeraFetch - High-Speed Terabox Video Downloader & Previewer

TeraFetch is a premium, web-based tool designed to fetch, preview, and download videos shared via Terabox (terabox.com, 1024tera.com, etc.) without speed limitations. Built using a custom, zero-dependency PHP MVC architecture, it incorporates a range-compatible streaming proxy and a Python-based scraper integration to deliver a seamless, ads-free streaming experience.


✨ Features

  • ⚡ High-Speed Direct Downloads: Bypass anonymous speed limits by fetching and resolving direct CDN download links.
  • 🎬 Premium Video Player: Fully integrated with Plyr.js for progressive buffer controls, custom speed selectors, and premium dark/light mode accents.
  • 🔄 Range-Compatible Streaming Proxy: Play and scrub through large video files instantly using custom HTTP Range and partial content (206) headers.
  • 🖱️ Click-to-Fetch Live Feed: Banners under the "Recent Downloads Feed" are clickable, scrolling and auto-filling the downloader form to fetch and play with a single click.
  • 📊 Admin Dashboard & Analytics:
    • Track total pageviews, unique visitors, and download stats.
    • View geolocation-simulated traffic distributions (browsers, devices, platforms).
    • Searchable, paginated Download Logs with a one-click secure Delete All log entry feature.
    • Manage global site configurations and visitor contact messages.
  • 🔒 OWASP Security Audited:
    • SQL Injection: Complete protection via PDO prepared statements.
    • Cross-Site Scripting (XSS): Sanitized outputs using strict HTML entity encoders.
    • CSRF Defense: Session-bound cryptographic tokens protecting forms.
    • Rate Limiting: Database-backed throttling protecting endpoints from abuse.

🛠️ Tech Stack & Architecture

  • Backend: PHP 8.0+ (Custom MVC framework, zero external packages)
  • Database: MySQL / MariaDB (Prepared tables, relations, and index optimization)
  • Scraper Engine: Python 3.8+ (requests and urllib fallback clients)
  • Frontend: Vanilla JS, Bootstrap 5, Bootstrap Icons, Plyr.js CSS/JS

📦 Prerequisites

  1. XAMPP (or any Apache + PHP + MySQL stack)
  2. PHP 8.0+
  3. Python 3.8+ with requests library:
    pip install requests

🚀 Installation & Local Setup

Step 1: Clone & Move Project

Move the TeraFetch project folder into your server's root directory (e.g., C:/xampp/htdocs/TeraFetch or F:/xampp/htdocs/TeraFetch).

Step 2: Database Setup

  1. Open phpMyAdmin (http://localhost/phpmyadmin).
  2. Create a new database named terafetch.
  3. Import the SQL schema file:
    • Path: database/schema.sql

Step 3: Configure Settings

If your server runs on a custom port or path, verify the dynamic settings in config/config.php:

define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', ''); // Your database password
define('DB_NAME', 'terafetch');

🔑 Administrative Control Panel

Access the Admin dashboard to view logs, monitor traffic, and configure active Terabox session keys.

  • URL: http://localhost/TeraFetch/admin
  • Default Username: admin
  • Default Password: admin123

⚙️ Enabling Real Scraping (ndus Cookie)

Terabox limits anonymous scraping. To enable real video fetching:

  1. Log into your account on Terabox.
  2. Open your browser Developer Tools (F12) -> Go to Application -> Cookies.
  3. Copy the value of the ndus cookie.
  4. Paste this value into Admin Panel > Website Settings > Terabox Session Cookie (ndus) and save.

📂 Directory Structure

TeraFetch/
├── app/
│   ├── Controllers/      # Route entry controllers (Home, Fetch, Admin)
│   ├── Core/             # Custom MVC engine (Router, Controller, Database, Model)
│   ├── Helpers/          # Utilities (Session, Utils, Validator, RateLimiter)
│   ├── Models/           # Database tables (Admin, FetchHistory, Visitor, Setting)
│   ├── Scripts/          # Scraper engine (terabox_fetcher.py)
│   ├── Services/         # PHP Scraper Bridge executor (TeraboxService.php)
│   └── Views/            # Layouts, Page templates, Admin interfaces, Errors
├── config/
│   └── config.php        # Global environment settings & session configurations
├── database/
│   └── schema.sql        # Database tables structures
├── public/
│   ├── css/              # Brand styling & dark mode sheets
│   ├── js/               # Dynamic AJAX, charts rendering, & client controllers
│   ├── stream.php        # HTTP Range chunk-streaming player proxy
│   ├── index.php         # Front Controller bootstrapper
│   └── .htaccess         # URL rewriting routing rules
└── .gitignore            # Clean git directories rules

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors