Skip to content
quantrancsePublic

About

A tool to download light novels from https://ln.hako.vn in epub file format for offline reading.

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Latest commit

 

History

54 Commits

Folders and files

Repository files navigation


Logo

hako2epub

A tool to download light novels from ln.hako.vn in epub file format for offline reading.

Windows · Android · Screenshots · Script Usage

Notes

Table of Contents

About The Project

A tool to download light novels from ln.hako.vn in epub file format for offline reading.

Notes:

  • This tool is a personal standalone project, it does not have any related to ln.hako.vn administrators.
  • If possible, please support the original light novel, hako website, and light novel translation authors.
  • This tool is for non-commercial purpose only.

Features

  • Working with docln.net, ln.hako.vn, and docln.sbs.
  • Auto check and switch to working domain.
  • Support all kind of novels (Truyện dịch, Sáng tác, AI Dịch).
  • Support images.
  • Support navigation and table of contents.
  • Notes are shown directly in the light novel content.
  • Download all/single volume of a light novel.
  • Download specific chapters of a light novel.
  • Update all/single downloaded light novel.
    • Update new volumes.
    • Update new chapters.
  • Delete downloaded light novels or individual volumes.
  • Auto get current downloaded light novel in the directory.
  • Auto checking the new tool version.
  • Automatic retry on network failures.
  • Dual download modes: Fast mode for speed, Slow mode for reliability with Cloudflare protection.
  • Android app: the same downloader as an APK, saving into Downloads/hako2epub.

Getting Started

For normal user, download the execution file below. Run and follow the instructions.

Windows: hako2epub.exe

Android: hako2epub.apk

Prerequisites

  • python >= 3.9
  • ebooklib
  • requests
  • bs4
  • pillow
  • tqdm
  • questionary
  • argparse
  • cloudscraper
  • playwright
pip install ebooklib requests bs4 pillow argparse tqdm questionary cloudscraper playwright
playwright install chromium

Usage

usage: hako2epub.py [-h] [-v] [-m {fast,slow}] [-c ln_url] [-u [ln_url]] [-d]
                    [-i]
                    [ln_url]

A tool to download light novels from https://ln.hako.vn in epub file format for offline reading.

positional arguments:
  ln_url                url to the light novel page

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -m, --mode {fast,slow} download mode: fast (faster, may get blocked) or slow (default, more reliable)
  -c, --chapter ln_url  download specific chapters of a light novel
  -u, --update [ln_url] update all/single light novel
  -d, --delete          delete downloaded light novels or volumes
  -i, --interactive     run in interactive mode (TUI)

Download Modes

  • Slow mode (default): More reliable, handles protected content, uses Cloudflare protection
  • Fast mode: Faster downloads with more threads, but may get blocked by Cloudflare

Examples

  • Download a light novel (slow mode, default)
python hako2epub.py light_novel_url
  • Download a light novel (fast mode)
python hako2epub.py --mode fast light_novel_url
  • Download specific chapters of light novel
python hako2epub.py -c light_novel_url
  • Update all downloaded light novels
python hako2epub.py -u
  • Update a single downloaded light novel
python hako2epub.py -u light_novel_url
  • Delete downloaded light novels or volumes
python hako2epub.py -d

Notes

  • Slow mode (default) includes delays to avoid being blocked by Cloudflare.
  • Fast mode uses more threads and no delays for faster downloads, but may get blocked.
  • Light novel will be downloaded into the same folder as the program.
  • Downloaded information will be saved into ln_info.json file located in the same folder as the program.
  • If you download specific chapters of a light novel, please enter the full name of the chapter in the "from ... to ..." prompt.
  • If you update the volume which contains specific chapters, only new chapters after the current latest chapter will be added.
  • Try to keep the program and ln_info.json file at the same folder with your downloaded light novels for efficiently management.
  • Deleting asks which light novels first, then which of their volumes to remove. Selecting every volume of a light novel also removes its folder and its ln_info.json entry.
  • The Android app writes the same ln_info.json format, but names folders and files differently (Tap-1-Novel.epub here vs Tap 1 - Novel.epub on Android), so a library copied between the two will be re-downloaded rather than recognised.

Screenshots

Windows

Demo

Android

Android

Issues

  • I only tested on some of my favorite light novels.
  • Sometimes the tool can not get images from some image hosts.
  • Sometimes you have to wait (most cases are under 10 seconds) to download or update the light novels (maybe only the first light novel in the list). If you are over that time, you should use a VPN (1.1.1.1 Cloudflare WARP) to avoid this.
  • If you update the light novel that was renamed, it will download the whole light novel again. To avoid this, please manually rename the path of the epub file to the new light novel name exactly like the current name format. Also rename the light novel in the ln_info.json file.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See [LICENSE][license-url] for more information.

Contact

Acknowledgements

About

A tool to download light novels from https://ln.hako.vn in epub file format for offline reading.

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages