Skip to content

Lysagxra/HanimeDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hanime Downloader

A Python-based tool for downloading hanime from hanime.tv. This tool reads a list of URLs from a file and processes the downloads accordingly.

Demo

Features

Dependencies

  • Python 3
  • httpx - for HTTP requests with HTTP/1.1 & HTTP/2 support
  • m3u8 - for parsing and generating M3U8 playlists
  • pycryptodomex - for encryption, decryption, and other cryptographic operations
  • rich - for progress display in the terminal
Show directory structure
project-root/
├── helpers/
│ ├── downloaders/
│ │ ├── crawler_utils.py       # Utilities for extracting media download links
│ │ └── episode_downloader.py  # Utilities for managing the download process
│ ├── managers/
│ │ ├── live_manager.py        # Manages a real-time live display
│ │ ├── log_manager.py         # Manages real-time log updates
│ │ └── progress_manager.py    # Manages progress bars
│ ├── config.py                # Manages constants and settings used across the project
│ ├── file_utils.py            # Utilities for managing file operations
│ └── general_utils.py         # Miscellaneous utility functions
├── hanime_downloader.py       # Module for initiating downloads from specified hanime.tv
├── main.py                    # Main script to run the downloader
└── URLs.txt                   # Text file listing album URLs to be downloaded

Installation

  1. Clone the repository:
git clone https://github.com/Lysagxra/HanimeDownloader.git
  1. Navigate to the project directory:
cd HanimeDownloader
  1. Install the required dependencies:
pip install -r requirements.txt

Single Episode Download

To download a single hanime episode from an URL, you can use hanime_downloader.py, running the script with a valid album URL.

Usage

python3 hanime_downloader.py <episode_url>

Example

python3 hanime_downloader.py https://hanime.tv/videos/hentai/sukebe-elf-tanbouki-1

Hanime Series Download

To download all the episodes from a hanime series, you can use hanime_downloader.py, running the script with a valid album URL, and --all-episodes command-line argument:

python3 hanime_downloader.py <episode_url> --all-episodes

Example

python3 hanime_downloader.py https://hanime.tv/videos/hentai/sukebe-elf-tanbouki-2 --all-episodes

Batch Download

To batch download from multiple album URLs, you can use the main.py script. This script reads URLs from a file named URLs.txt and downloads each one using the album downloader.

Usage

  1. Create a file named URLs.txt in the root of your project, listing each URL on a new line.
  • Example of URLs.txt:
https://hanime.tv/videos/hentai/sukebe-elf-tanbouki-1
https://hanime.tv/videos/hentai/sukebe-elf-tanbouki-2
https://hanime.tv/videos/hentai/youkoso-sukebe-elf-no-mori-e-2
  • Ensure that each URL is on its own line without any extra spaces.
  • You can add as many URLs as you need, following the same format.
  1. Run the batch download script:
python3 main.py

File Download Location

If the --custom-path <custom_path> argument is used, the downloaded files will be saved in <custom_path>/Downloads. Otherwise, the files will be saved in a Downloads folder created within the script's directory

Usage

python3 main.py --custom-path <custom_path>

Example

python3 main.py --custom-path /path/to/external/drive

Custom Resolution

To download an episode (or all episodes in a session) in a certain resolution, you can use the --resolution command-line argument:

python3 hanime_downloader.py <episode_url> --resolution <resolution>

or

python3 main.py --resolution <resolution>

Example

python3 hanime_downloader.py https://hanime.tv/videos/hentai/sukebe-elf-tanbouki-1 --resolution 480p

If not specified, the program will automatically select 720p as the default resolution. The supported resolutions are: 360p, 480p, and 720p.

Logging

The application logs any issues encountered during the download process.