shaikhsajid1111 / manga-down

manga_down is a tool to download manga from mangareader and mangapanda
https://pypi.org/project/manga-down/
MIT License
4 stars 0 forks source link

run from terminal #4

Closed sugizo closed 3 years ago

sugizo commented 3 years ago

manga-py we can run from terminal e.g. $ manga-py https://mangapanda.onl/chapter/one-piece_122 ref https://github.com/manga-py/manga-py

is it possible to run manga-down from terminal ? e.g. $ manga-down https://mangapanda.onl/chapter/one-piece_122

thx

shaikhsajid1111 commented 3 years ago

No, but you can use argparse which is builtin python module for command-line argument.

sugizo commented 3 years ago

yes, you right, forgot about that, another options are to use click, fire, hug, invoke, typer, etc e.g. in fire

import fire
from manga_down import *

def dl_mangapanda(manga, chapter):
    manga = mangapanda.Manga(manga)
    manga.download_chapter(chapter)

"""
python manga_down_sh.py dl_mangapanda kenji 1
"""

def dl_mangareader(manga, chapter):
    manga = mangareader.Manga(manga)
    manga.download_chapter(chapter)

"""
python manga_down_sh.py dl_mangareader kenji 1
"""

if __name__ == '__main__':
    fire.Fire()

thanks