Skip to content

haxsysgit/autopahe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PyPI version contributions welcome License OpenIssues

Windows macOS Linux

AutoPahe

A powerful, cross-platform anime downloader for AnimePahe with advanced features

Automatic anime search, download, and management with support for parallel downloads, desktop notifications, smart caching, filtering, and comprehensive record tracking. Fully cross-platform (Windows, macOS, Linux).

✨ Key Features

  • πŸ” Smart Search with year and status filters
  • πŸ“¦ Batch/Season Downloads - Download entire seasons with one command
  • πŸš€ Parallel Downloads - Speed up with multi-threaded downloads
  • πŸ”” Desktop Notifications - Get notified when downloads complete (Windows/macOS/Linux)
  • πŸ’Ύ Smart Caching - Faster repeat searches with automatic API caching
  • πŸ“Š Progress Tracking - Visual progress bars for multi-episode downloads
  • πŸ—‚οΈ Record Management - Track watching progress, ratings, and status
  • βš™οΈ Configuration System - Save your preferences in a config file
  • 🎯 Auto-Sorting - Automatically organize downloaded files
  • 🌐 Cross-Platform - Works on Windows, macOS, and Linux
  • πŸ“ Detailed Logging - Verbose and quiet modes available
  • πŸͺ Session Persistence - Reduced DDoS-Guard friction with cookie caching

πŸ“‹ Requirements

System Requirements

  • Python 3.8+
  • Web Browser: Firefox or Chrome/Chromium
  • WebDriver: geckodriver (Firefox) or chromedriver (Chrome)

Python Dependencies

pip install selenium beautifulsoup4 requests tqdm lxml

WebDriver Installation

Linux (Ubuntu/Debian):

# Firefox (geckodriver)
sudo apt install firefox-geckodriver

# Chrome (chromedriver)
sudo apt install chromium-chromedriver

macOS (Homebrew):

# Firefox
brew install geckodriver

# Chrome
brew install chromedriver

Windows:

πŸš€ Quick Start

Installation

  1. Clone the repository:
git clone https://github.com/haxsysgit/autopahe.git
cd autopahe
  1. Install dependencies:
pip install -r requirements.txt
  1. Install WebDriver (see requirements above)

  2. Run the script:

python3 auto_pahe.py --help

First Use Example

# Search for an anime
python3 auto_pahe.py -s "Naruto"

# Select and download episode 1
python3 auto_pahe.py -s "Naruto" -i 0 -d 1

# Download multiple episodes
python3 auto_pahe.py -s "Naruto" -i 0 -md "1-5"

πŸ“– Usage

Basic Commands

# Search for anime
python3 auto_pahe.py -s "Anime Name"

# Search with filters
python3 auto_pahe.py -s "Naruto" --year 2007 --status "Finished"

# Select anime from results (index 0 = first result)
python3 auto_pahe.py -s "Naruto" -i 0

# Download single episode
python3 auto_pahe.py -s "Naruto" -i 0 -d 1

# Download multiple episodes
python3 auto_pahe.py -s "Naruto" -i 0 -md "1-5"
python3 auto_pahe.py -s "Naruto" -i 0 -md "1,3,5-8,10"

# Download entire season (12-13 episodes)
python3 auto_pahe.py -s "Naruto" -i 0 --season 1

# Parallel downloads (use with caution)
python3 auto_pahe.py -s "Naruto" -i 0 -md "1-10" -w 2

# With desktop notifications
python3 auto_pahe.py -s "Naruto" -i 0 -md "1-5" --notify

Advanced Features

πŸ“Š Records Management

# View all records
python3 auto_pahe.py -R view

# Search records
python3 auto_pahe.py -R search "naruto"

# Update progress
python3 auto_pahe.py -R progress "Naruto" 27

# Rate anime
python3 auto_pahe.py -R rate "Naruto" 9.5

# Export records
python3 auto_pahe.py -R export backup.json json
python3 auto_pahe.py -R export records.csv csv

# Import records
python3 auto_pahe.py -R import backup.json

# Delete record
python3 auto_pahe.py -R delete "Naruto"

# List by status
python3 auto_pahe.py -R list-status completed

πŸ—‚οΈ File Sorting

# Sort downloaded files
python3 auto_pahe.py --sort all --sort-path ~/Downloads

# Dry run (preview changes)
python3 auto_pahe.py --sort all --sort-dry-run

# Rename only
python3 auto_pahe.py --sort rename

# Organize into folders
python3 auto_pahe.py --sort organize

πŸ’Ύ Cache Management

# View cache statistics
python3 auto_pahe.py --cache stats

# Clear cache and cookies
python3 auto_pahe.py --cache clear

πŸ“ˆ Execution Statistics

# Today's stats
python3 auto_pahe.py -dt "today"

# This week
python3 auto_pahe.py --summary "this week"

# All time
python3 auto_pahe.py --summary "all"

# Date range
python3 auto_pahe.py --summary "from 2025-11-01 to 2025-11-30"

πŸ’‘ Example Workflows

Basic Workflow

# 1. Search
python3 auto_pahe.py -s "One Piece"

# 2. Select (index 0 = first result)
python3 auto_pahe.py -s "One Piece" -i 0

# 3. Download episode 1
python3 auto_pahe.py -s "One Piece" -i 0 -d 1

Advanced Workflow

# Search with filters
python3 auto_pahe.py -s "Naruto" --year 2007 --status "Finished Airing"

# Download season 1 with notifications and parallel downloads
python3 auto_pahe.py -s "Naruto" -i 0 --season 1 -w 2 --notify

# Auto-sort after download (if configured)
# Files automatically organized into folders

Record Management Workflow

# After downloading, update your records
python3 auto_pahe.py -R progress "Naruto" 12
python3 auto_pahe.py -R rate "Naruto" 9.0

# Check what you're watching
python3 auto_pahe.py -R list-status "watching"

# Export for backup
python3 auto_pahe.py -R export ~/anime_backup.json json

🎯 Complete Command Reference

Search & Download

Flag Description
-s, --search TEXT Search for anime by name
-i, --index INT Select anime from search results
-d, --single_download INT Download single episode
-md, --multi_download TEXT Download multiple episodes (e.g., "1-5,7,10-12")
-l, --link Display download link (no download)
-ml, --multilinks Display multiple download links
-a, --about Show anime overview

Options

Flag Description
-b, --browser TEXT Browser choice (firefox|chrome)
-p, --resolution TEXT Preferred resolution (480|720|1080)
-w, --workers INT Parallel workers for downloads (default: 1)

πŸ” Search Filters (NEW)

Flag Description
--year INT Filter search results by release year
--status TEXT Filter search results by status

πŸ“¦ Batch Downloads (NEW)

Flag Description
--season INT Download entire season (e.g., --season 1 = eps 1-12)

πŸ”” Notifications (NEW)

Flag Description
--notify Enable desktop notifications on completion

πŸ“Š Records Management

Flag Description
-r, --record TEXT Basic record access (view, index, keyword)
-R, --records ... Advanced management (see subcommands below)

-R Subcommands:

  • view - List all records
  • search <query> - Search records
  • delete <id\|title> - Delete record
  • progress <id\|title> <episode> - Update progress
  • rate <id\|title> <0-10> - Set rating
  • rename <id\|title> <new_title> - Rename
  • set-keyword <id\|title> <keyword> - Update keyword
  • list-status <status> - Filter by status
  • export <path> [json\|csv] - Export records
  • import <path> - Import records

πŸ—‚οΈ File Sorting

Flag Description
--sort {all|rename|organize} Sort downloaded files
--sort-path PATH Directory to sort (default: Downloads)
--sort-dry-run Preview changes without applying

πŸ’Ύ Cache Management (NEW)

Flag Description
--cache {clear|stats} Manage disk cache and cookies

πŸ“ˆ Statistics

Flag Description
-dt, --execution_data TEXT Execution stats for periods
--summary TEXT Stats + records summary

πŸ“ Logging (NEW)

Flag Description
--verbose Enable DEBUG logging (detailed)
--quiet Enable WARNING logging (minimal)

βš™οΈ Configuration

Flag Description
--config PATH Load configuration from file
--write-config [PATH] Generate sample config file

βš™οΈ Configuration

Create a config file to save your preferences:

# Generate sample config
python3 auto_pahe.py --write-config

# Edit ~/.config/autopahe/config.ini

Sample Configuration:

[defaults]
# Browser: firefox or chrome
browser = firefox

# Resolution: 480, 720, 1080
resolution = 1080

# Workers for parallel downloads (1 = sequential)
workers = 2

# Custom download directory (optional)
download_dir = /home/user/Videos/Anime

# Auto-sort after downloads
sort_on_complete = true
sort_mode = all

# Custom sort directory (optional)
sort_path = 

Config is loaded automatically from:

  1. ~/.config/autopahe/config.ini
  2. ~/.autopahe.ini
  3. ./autopahe.ini

Or specify custom location: --config /path/to/config.ini

πŸš€ Performance Features

Smart Caching

  • API Response Caching: 6-hour cache for faster repeat searches
  • Cookie Persistence: 24-hour session cookies reduce DDoS-Guard challenges
  • Auto-cleanup: Old cache entries removed automatically

Parallel Downloads

  • Download multiple episodes simultaneously with -w/--workers
  • Safe staggering prevents port conflicts
  • Warning: May trigger DDoS-Guard protection. Use -w 1 for stability.

Progress Tracking

  • Visual progress bars for multi-episode downloads (requires tqdm)
  • Real-time completion status
  • Failed episode tracking

πŸ”” Desktop Notifications

Get notified when downloads complete or fail:

Linux: Uses notify-send (libnotify)

sudo apt install libnotify-bin  # Ubuntu/Debian

macOS: Uses AppleScript (built-in)

Windows: Uses PowerShell toast notifications (built-in)

Enable with --notify flag.

πŸ—‚οΈ File Organization

Automatic Sorting

Integrates pahesort functionality:

  • Rename: Clean up AnimePahe filenames
  • Organize: Group episodes into anime folders
  • Auto-sort: Enable in config for automatic organization

Manual Sorting

# Preview changes
python3 auto_pahe.py --sort all --sort-dry-run

# Apply sorting
python3 auto_pahe.py --sort all --sort-path ~/Downloads

πŸ“ Logging

Control output verbosity:

# Normal logging (INFO)
python3 auto_pahe.py -s "Naruto" -i 0 -d 1

# Verbose logging (DEBUG) - shows cache hits, API calls, etc.
python3 auto_pahe.py -s "Naruto" -i 0 -d 1 --verbose

# Quiet logging (WARNING) - errors only
python3 auto_pahe.py -s "Naruto" -i 0 -d 1 --quiet

Logs saved to autopahe.log in current directory.

🌐 Cross-Platform Support

Windows

  • βœ… Full support with Firefox or Chrome
  • βœ… Desktop notifications via PowerShell
  • βœ… Automatic driver detection
  • πŸ“ Install drivers to PATH or project directory

macOS

  • βœ… Full support with Firefox or Chrome
  • βœ… Desktop notifications via AppleScript
  • βœ… Homebrew driver installation
  • πŸ“ Use brew install geckodriver or chromedriver

Linux

  • βœ… Full support on all distros
  • βœ… Desktop notifications via notify-send
  • βœ… Package manager driver installation
  • πŸ“ Tested on Ubuntu, Debian, Fedora, Arch

πŸ“š Documentation

Detailed documentation in the repository:

  • ALL_PHASES_DOCUMENTATION.txt - Complete feature guide
  • CONFIG_DOCUMENTATION.txt - Configuration system details
  • TESTING_GUIDE.txt - Comprehensive testing procedures
  • PHASE2_CHANGES_SUMMARY.txt - Implementation changelog

⚠️ Important Notes

DDoS-Guard Protection

  • AnimePahe uses DDoS-Guard protection
  • Script includes bypass mechanism (refresh + implicit wait)
  • Parallel downloads may trigger protection - use cautiously
  • Persistent cookies help reduce challenges
  • If blocked, wait a few minutes and try again

Download Quality

  • Default: 720p (configurable)
  • Available: 480p, 720p, 1080p
  • Script selects best available quality if preferred not available

Resume Support

  • Partial downloads automatically resumed
  • Uses HTTP Range headers
  • Safe to interrupt and restart

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

βš–οΈ License

See license.md for details.

πŸ™ Credits

Created by haxsys

Built with:

πŸ“ž Support

  • Issues: GitHub Issues
  • Questions: Open a discussion or issue
  • Updates: Watch the repository for new releases

Enjoy AutoPahe! 🎬

About

Automatically download your all favorite anime from AnimePahe

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages