DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
728 stars 72 forks source link

Running example_preprocessor.py script on windows. #1569

Closed wookielover closed 5 years ago

wookielover commented 5 years ago

To help with identifying and fixing issues, please include as much information as possible, including:

LazyLibrarian version number (at the bottom of config page) :65493e7c67a06d0d7325e9ff06e75b1e37e3f181

Operating system used: windows

Source of your LazyLibrarian installation (git)

Relevant debug log with api keys and any passwords redacted: no entries added to debug log.

I am trying to use the Preprocessor script in LL on windows. When i put in the example_preprocessor.py script into the field and hit the test button, it says:

Error running preprocessor: [WinError 193] %1 is not a valid Win32 application

no entries are logged into the debug log.

How do i use this script within LL on Windows?

philborman commented 5 years ago

I had a quick google of this, and you might be able to do it just by putting python example_preprocessor.py or maybe the full path is needed?

If not there is an alternative command we can use inside lazylibrarian, let me know if the above doesn't work.

wookielover commented 5 years ago

Thank you for the quick response. Here is more information on my file locations and whatnot:

Windows 10 PATH= C:\Python37-32\ Python Version: 3.7 Location: C:\Python37-32\python.exe Preprocessor Script Location: D:\EBOOKS\LazyLibrarian\example_preprocessor.py

Then i tested execution of the script:

Results:

Command Line When ran from the command line using the path to the script as an argument the script runs. Im guessing though since it doesn't have input parameters from LL it gives the invalid parameter item. C:\Python37-32\python.exe D:\EBOOKS\LazyLibrarian\example_preprocessor.py Invalid parameters 1

python.exe D:\EBOOKS\LazyLibrarian\example_preprocessor.py Invalid parameters 1

LL When the same paths are added to LL in the preprocessor field i get this result: C:\Python37-32\python.exe D:\EBOOKS\LazyLibrarian\example_preprocessor.py Error running preprocessor: [WinError 2] The system cannot find the file specified

python.exe D:\EBOOKS\LazyLibrarian\example_preprocessor.py Error running preprocessor: [WinError 2] The system cannot find the file specified

And when I try and enclose the argument in quotes C:\Python37-32\python.exe "D:\EBOOKS\LazyLibrarian\example_preprocessor.py" Lazy Librarian removes the stuff in quotes.

Just putting python.exe in the preprocessor field gets the following response, so it can see python. Preprocessor returned 2: res[] err[(null): can't open file 'test': [Errno 2] No such file or directory ]

None of these options worked.

philborman commented 5 years ago

ok thanks for trying. I will try one of the other suggestions from stackoverflow, there should be an update to lazylibrarian later today.

philborman commented 5 years ago

Just pushed the changes, can you try with just example_preprocessor.py in the config box, which I think should work ok. If that does not work try D:\EBOOKS\LazyLibrarian\example_preprocessor.py, thanks.

wookielover commented 5 years ago

LazyLibrarian version number updated to: ca1ac9291f6445bd1d6414180b9aa55d0cb50762

I went ahead and configured the example_preprocessor.py. using the full path to ebook-convert.exe.

In LL entering the full path D:\EBOOKS\LazyLibrarian\example_preprocessor.py or just example_preprocessor.py and run the test i get the following successful result:

Preprocessor test No suitable sourcefile found in D:\EBOOKS\LazyLibrarian - TEST No extra ebook formats created

Then I downloaded some books. I was able to successfully generate multiple formats for the book successfully and calibre also imported the books into the library successfully.

Thank-you for your help.