diff --git a/README.md b/README.md index 2b6232c..decf798 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ # EBook Downloader -This script searches for books on libgen and then downloads them. It supports being run interactivly as well as running with options from the command line. +This script searches for books on libgen and then downloads them. It supports being run interactivly as well as running with options from the command line. Additionally there is a simple WebUI that can be used for multiple users to request books. ### Installing 1. Download/clone the repo 2. `pip install -r requirments.txt` +### WebUI +1. run `python gui.py` + ### Interactive Mode -1. Run `python main.py` +1. Run `python bookrequest.py` 2. Follow the prompts on screen ### Unattended Mode -1. `python main.py -b ` \ No newline at end of file +1. `python bookrequest.py -b ` \ No newline at end of file diff --git a/__pycache__/bookrequest.cpython-310.pyc b/__pycache__/bookrequest.cpython-310.pyc new file mode 100644 index 0000000..c6accb1 Binary files /dev/null and b/__pycache__/bookrequest.cpython-310.pyc differ diff --git a/main.py b/bookrequest.py similarity index 95% rename from main.py rename to bookrequest.py index f4e298a..eb0fcbc 100644 --- a/main.py +++ b/bookrequest.py @@ -47,7 +47,7 @@ def main(argv): opts, args = getopt.getopt(argv, "hb:",["help=","book="]) for opt, arg in opts: if opt in ('-h', "--help"): - print('main.py -b ') + print('bookrequest.py -b ') elif opt in ('-b', '--book'): book = arg results = searchBook(book, unattended=True) diff --git a/gui.py b/gui.py new file mode 100644 index 0000000..52ad9a9 --- /dev/null +++ b/gui.py @@ -0,0 +1,10 @@ +from nicegui import * +from bookrequest import * +def pass_command() -> None: + if title.value != '': + result = searchBook(title.value, unattended=True) + ui.notify('Searching and Downloading Book!') + downloadBook(result) +with ui.card().classes('absolute-center'): + title = ui.input('Title').on('keydown.enter', pass_command) +ui.run() \ No newline at end of file diff --git a/requirments.txt b/requirments.txt index e836f14..15ebea2 100644 --- a/requirments.txt +++ b/requirments.txt @@ -1 +1,2 @@ -libgen_api==1.0.0 \ No newline at end of file +libgen_api==1.0.0 +nicegui==1.2.2 \ No newline at end of file