From edabd932de1378d10b3ee98e55c10429e82ee6a6 Mon Sep 17 00:00:00 2001 From: kassarole Date: Tue, 28 Mar 2023 21:41:47 -0400 Subject: [PATCH] Updated to add webgui --- README.md | 9 ++++++--- __pycache__/bookrequest.cpython-310.pyc | Bin 0 -> 1801 bytes main.py => bookrequest.py | 2 +- gui.py | 10 ++++++++++ requirments.txt | 3 ++- 5 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 __pycache__/bookrequest.cpython-310.pyc rename main.py => bookrequest.py (95%) create mode 100644 gui.py 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 0000000000000000000000000000000000000000..c6accb13f0be63362960b4245dc7595405a4467b GIT binary patch literal 1801 zcmZ8hTW=dh6rP#Ac;rU0%>?D5s*BYRF>_T#G7n(o!N2H zSZk>wM5uA(W*)oD7iE?w!p;!Rijvhs>GJsHRU^ z&16vcui0; zBTj%j21Rhru?yr4NUB$-bdzh`47jSC{nZ)OirOZNZf@A>(-%gid7Pz9SM>)S%>lyj z&PEn$l@Ah=hdbFIm5uPbL2Tl5x6x==Z!0#5T7S!b7&^~a!Z)SK=ier(ovScciRzlr z^iZZC_w z$_5u+bR9@qf2{R8(~Dr=K9DQh->ZI>$0pOU%C{ATSiZ1PdYgEy4hJeXjsA(PjeqM) zNU2})haf%=c%8fWg3EV~*Dm(~7cYbIoMbof3hw{yy80fByOgbqhgyN$mgWBh8-q41 z%Z~4f0?o6)B+C3}G2+Gnk8+a!Eha0c;><1ho_9_SfYL78jiIEf8^dsIl5dntSp$u5 zQX9wZ*r0$)WVXGyDnJV#R-<9>ZO0eI3^=)JNH z!ffZN5l^x~*w!jc@Vk_molLKUL#NkS8G1dH^dApBLhErPhGMxl^p}@OI$R{-RY8W! zo$wKf$^fgSa)*>jhMej-AcHJTW6?K>P|=lWS|6#(`lifaRIzSb?;h!Q>G&21CDEWi zAw^cPw+^=d&zgJCj?)P0`5lmP2h{nzpdD5FxGTg<_pN?FPJ>p9ELts1V?N^R7#y{v z92~87Kh~6ZJwt??US0OmI&B{)Sl_2pYT;|7ETiDjK_&-@TBW|qXF&pXo7Y5eH>d=& I^W6RCU!Q!(CjbBd literal 0 HcmV?d00001 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