Code Monkey home page Code Monkey logo

webtoonreader's Introduction

WebtoonReader

WebtoonReader is free and open-source manga/webtoon reader for locally downloaded mangas and webtoons. It is NOT a webapp nor does it require a server setup.



๐Ÿš€ ย  Features

  • Comfortably read locally downloaded manga/webtoon
  • Read from where the chapter you left off on
  • Configure manga/webtoon width, height, scroll speed, mouse drag, and number of images to load
  • Clean and intuitive interface

๐Ÿ”จ ย  Installation

Install python:

https://www.python.org/downloads/

Download the latest release.

https://github.com/Aeonss/WebtoonReader/releases/latest/

Download the requirements:

pip install -r requirements.txt

Run the exe from the release (WINDOWS ONLY), or run the program with:

python WebtoonReader.py

Library Setup

Library/
โ”œโ”€โ”€ Manga 1/
โ”‚   โ”œโ”€โ”€ Chapter 1/
โ”‚   โ”‚   โ”œโ”€โ”€ 0.jpg
โ”‚   โ”‚   โ”œโ”€โ”€ 1.jpg
โ”‚   โ”‚   โ””โ”€โ”€ ..
โ”‚   โ””โ”€โ”€ Chapter 2/
โ”‚       โ”œโ”€โ”€ page-0.png
โ”‚       โ”œโ”€โ”€ page-1.png
โ”‚       โ””โ”€โ”€ ..
โ””โ”€โ”€ Manga 2/
    โ”œโ”€โ”€ c-4/
    โ”‚   โ”œโ”€โ”€ image-1.jpg
    โ”‚   โ”œโ”€โ”€ image-2.jpg
    โ”‚   โ””โ”€โ”€ ...
    โ””โ”€โ”€ c-5/
        โ”œโ”€โ”€ 0001.jpg
        โ””โ”€โ”€ 0002.jpg

IMPORTANT: chapters names and images must be named alphanumerically.

To download manga/webtoon chapters, use HakuNeko.

โœ… ย  Additional Information

  • WebtoonReader was created with Python3 and Tkinter
  • Use "a" or the left arrow key to go to the previous chapter
  • Use "d" or the right arrow key to go to the next chapter
  • Use the mouse scroll wheel, mouse button 4/5, or mouse drag on the page to read
  • Use the up arrow, down arrow, page up, or page down key to navigate through pages
  • Please request any features or report any bugs

โค๏ธย  Contributions

  • Massive thanks to GustJc for finding bugs and contributing to releases.

๐Ÿค– ย  To Do

  • Squash all the bugs!
  • Automatically load next chapter (if possible) after finishing a chapter

๐Ÿ“˜ ย  License

WebtoonReader is released under the MIT license.

webtoonreader's People

Contributors

aeonss avatar gustjc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gustjc

webtoonreader's Issues

Image loading order and High RAM usage

Very nice tool for reading webtoons locally but there are a few problems.

First (Fix ordering)

I understand that it gets the images by the OS alphabetic sorting.
But it's very common that chapters are named as
1.jpg ... 9.jpg, 10.jpg, 11.jpg

As of right now (ver1.1). I've printed to order and WebtoonReader actually loads them like.
1.jpg - 10.jpg - 11.jpg - 12.jpg - 13.jpg - 14.jpg - 15.jpg - 16.jpg - 17.jpg - 18.jpg - 19.jpg - 2.jpg - 20.jpg

I fixed this by trying to do a numeric reordering at the Fill function first. So the common cases where the pages are just numbers would be correctly ordered. You just need to import re at the beginning of the file and change the fill function.

def fill(self):
    if os.path.exists(self.path):
        files = [f for f in os.listdir(self.path)]
        
        search = lambda x: re.search(r'\d+', x)
        if_search = lambda x: int(search(x).group()) if search(x) else float('inf')
        files_sorted = sorted(files, key=if_search)
        
        # Gets all images from directory and adds to list
        for name in files_sorted:

Second (HUGE RAM USAGE)

This is by far the biggest problem.
This tool is too RAM intensive.

You might not have noticed if you only tried it with small chapters. I myself only noticed it when my PC started to shutdown after trying to open a webtoon folder with 300+ pages.

Loading a 100 pages 100 mb sized webtoon is actually consuming 8.5 Gigs of RAM

I'm not sure how Tkinker handles it canvas. But it might be necessary to dynamically load the pages to solve this issue.
I don't think there is an easy way out of this.

Third (Invert mouse drag)

Just a suggestion. Maybe add a invert mouse drag options.

I actually prefer to scroll upwards to I changed it manually the yview to -deltaY

def update_scroll(self, event):  
    deltaX = event.x - self._starting_drag_position[0]
    deltaY = event.y - self._starting_drag_position[1]
    self.canvas.xview('scroll', deltaX, 'units')
    self.canvas.yview('scroll', -deltaY, 'units')
    self._starting_drag_position =  (event.x, event.y)

Edit: PS

I also deactivated the load last chapters feature here.
As it takes a while to load big chapters, the programs appears stuck before you can even select the chapter you actually want to read, so I personally don't like this feature. An option to disable this might be nice for someone who doesn't know how to change the code.

And maybe add a progress bar to show how far along the image processing is?
I put a print on the console for myself here just to know how far along it is.
For example. A 35mb, 95 pages compressed chapter takes about 20-30 seconds to load here.

Compiled released .exe version is unnecessarily too big.

The provided .exe in the releases is too big (27mb).
Using an almost clean pip I can generate a 10mb sized .exe here.

Even using pyinstaller --path and passing the virtualenv files, it still uses some of the packages installed on the main python installation for some reason.

Here is the command I'm using:
pyinstaller.exe --onefile -i='icon.ico' WebtoonReader.py --paths /d/Programs/WebtoonReader/WebtoonReader/webtoon_env/Lib/site-packages/

I was getting a 20Mb~ .exe file.
But when I uninstalled numpy from my global python 310 installation, the resulting .exe reduced to a 10 Mb file.

Not sure if this is intentional or a bug from pyinstaller. But I always thought if you specified a --paths arguments it should mean you don't want to use ANYTHING from the global python installation that is not vitally necessary. But that is not the case it seems.

Just creating this issue to keep a note that this problem exists and the final .exe can be reduced in size by quite a bit if you wanted it to.

Scrollbars doesn't update if images have different heights

It seems the scrollbars are not updated correctly when loading the next X images at the end of the scroll.

This can better be noticed if you follow this steps:

  1. Put the images to load to 2.
  2. Put 2 images named '1.jpg' and '2.jpg' with a size of 500x100px each
  3. Put 2 images named '3.jpg' and '4.jpg' with a size of 500x250px each
Image of an example

image

This is quite an easy fix.
You just need to make sure to update the scrollbar size by executing this 2 lines after you print the images to the canvas.

self.v_scroll.config(command=self.canvas.yview)
self.canvas.config(scrollregion=self.canvas.bbox('all'))

PS: Great updates. It's nice to see how fast you solved the previous issues.

Doesn't run (exe)

Just tried running it and it just outputs the following error:

Traceback (most recent call last):
  File "WebtoonReader.py", line 385, in <module>
  File "WebtoonReader.py", line 47, in __init__
  File "CustomScroller.py", line 64, in __init__
  File "CustomScroller.py", line 206, in update_title_name
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
[13224] Failed to execute script 'WebtoonReader' due to unhandled exception!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.