From ccc8d7c7a2e6d8cc14a3c930bef2bc2fdc27a613 Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Sat, 14 Aug 2021 15:49:07 -0400 Subject: [PATCH] Export cover --- audible-converter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/audible-converter.py b/audible-converter.py index 644fcf4..6d98bad 100644 --- a/audible-converter.py +++ b/audible-converter.py @@ -57,6 +57,11 @@ class AudibleBook(object): if not os.path.exists(outFilePath): os.system('ffmpeg -i {} -acodec copy -vcodec copy -ss {} -t {} {}'. format(self.convertedFilePath, start, end, outFilePath)) + def getCover(self): + outFilePath = '{}/cover.jpg'.format(self.targetDir) + if not os.path.exists(outFilePath): + os.system('ffmpeg -i {} -an -vcodec copy {}'. + format(self.convertedFilePath, outFilePath)) # getHash() returns the hash of a given file. @@ -105,4 +110,5 @@ book.setTargetDir(outputDir) book.removeDRM(name) book.splitChapters() +book.getCover()