Ahhhh, sorry, I didn't catch that. If the problem is that a cover isn't declared then perhaps you could have your script find it.
Here are some other options I can think of:
- convert the book to HTML using the ebook-convert commandline and then look in the /images directory for *cover*.jpg/png/gif or the first numbered image and use that image with ebook-meta
- unzip the book or unzip all images from the book into a temporary directory "unzip testbook.epub *.jpg *.png *.gif ...etc" into a temporary directory then parse and pipe back into ebook-meta
Depending on your book source, you might have to do some digging into the structure of the epubs to see what the covers are named and if they are in subfolders (cover/images/...) to get some reliable results.
You also might want to look at
this python epub-thumbnailer script for some inspiration. If you look at the
script source it shows some good options for finding the cover file.
Good luck!