Updated to add webgui

This commit is contained in:
kassarole 2023-03-28 21:41:47 -04:00
parent 2979c9672b
commit edabd932de
5 changed files with 19 additions and 5 deletions

View File

@ -1,13 +1,16 @@
# EBook Downloader # 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 ### Installing
1. Download/clone the repo 1. Download/clone the repo
2. `pip install -r requirments.txt` 2. `pip install -r requirments.txt`
### WebUI
1. run `python gui.py`
### Interactive Mode ### Interactive Mode
1. Run `python main.py` 1. Run `python bookrequest.py`
2. Follow the prompts on screen 2. Follow the prompts on screen
### Unattended Mode ### Unattended Mode
1. `python main.py -b <booktitle>` 1. `python bookrequest.py -b <booktitle>`

Binary file not shown.

View File

@ -47,7 +47,7 @@ def main(argv):
opts, args = getopt.getopt(argv, "hb:",["help=","book="]) opts, args = getopt.getopt(argv, "hb:",["help=","book="])
for opt, arg in opts: for opt, arg in opts:
if opt in ('-h', "--help"): if opt in ('-h', "--help"):
print('main.py -b <booktitle>') print('bookrequest.py -b <booktitle>')
elif opt in ('-b', '--book'): elif opt in ('-b', '--book'):
book = arg book = arg
results = searchBook(book, unattended=True) results = searchBook(book, unattended=True)

10
gui.py Normal file
View File

@ -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()

View File

@ -1 +1,2 @@
libgen_api==1.0.0 libgen_api==1.0.0
nicegui==1.2.2