Skip to content

quantrancse/hako2epub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Version MIT License Quality Gate Status


Logo

hako2epub

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

Download · Screenshots · Script Usage

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.
  • 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.
  • Support multiprocessing to speed up.
  • Auto get current downloaded light novel in the directory.
  • Auto checking the new tool version.

Getting Started

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

Windows: hako2epub.exe ~ 14MB

Prerequisites

  • python 3.9.6
  • ebooklib
  • requests
  • bs4
  • pillow
  • tqdm
  • questionary
  • argparse
pip install ebooklib requests bs4 pillow argparse tqdm questionary

Usage

usage: hako2epub.py [-h] [-c ln_url] [-u [ln_url]] [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

optional arguments:
  -h, --help            show this help message and exit
  -c ln_url, --chapter ln_url
                        download specific chapters of a light novel
  -u [ln_url], --update [ln_url]
                        update all/single light novel
  • Download a light novel
python hako2epub.py 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

Notes

  • After processing 190 requests at a time, the program will pause for 120 seconds (2 mins) to avoid spam blocking. Please be patient if it hangs.
  • 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.

Screenshots

Demo

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 for more information.

Contact

Acknowledgements