08-25-2023, 08:23 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Aug 2023
Device: kindle paperwhite 11
|
python and converting filetypes
Hello! Sorry in advance if im posting in the wrong section! I am creating a python (3.11) script that converts epub to azw3 and im encountering an error that says "EPUB appears to be invalid ZIP file, trying a more forgiving ZIP parser". This occurs when running a command with subprocess.run. I suspected a corrupted file, however when i enter the command manually into the cli, the file sucessfully converts. To clarify, I copy paste the command obtained by python after "Running command: " into the cli and it works. I am unsure of whether this is a problem with my code or python itself when handling epub files or some kind of incompatibility with calibre... I was wondering if anybody has any suggestions to fix or workaround this error. Here is the code:
Spoiler:
Thank you for reading :) Last edited by theducks; 08-25-2023 at 10:36 PM. Reason: Please Spoiler Log files |
08-25-2023, 11:04 PM | #2 |
creator of calibre
Posts: 43,878
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
ebook-convert doesnt care about how it is launched. Most likely you are running you script before the download is completed leading to a partial/corrupted file being converted.
|
08-26-2023, 06:57 AM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Aug 2023
Device: kindle paperwhite 11
|
Thanks so much its working now
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Converting ePub Python coding books to PDF outputs Python code far too small | lysakowski | Conversion | 9 | 04-30-2023 05:44 AM |
Batch Converting Ebooks with Calibre and Python | jmeb | Conversion | 17 | 10-20-2018 11:16 AM |
Changing the filetypes associated with KPVBooklet? | Gigahawk | Kindle Developer's Corner | 1 | 02-12-2016 08:11 AM |
More filetypes? | Perkin | Editor | 1 | 11-25-2014 09:48 PM |
Export - different filetypes | marcl | Calibre | 2 | 01-14-2014 05:30 AM |