mkb79 / audible-cli

A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files.
GNU Affero General Public License v3.0
469 stars 47 forks source link

audible decrypt skip-rebuild-chapters missing input file in base_cmd #207

Open CoolJoe72 opened 6 months ago

CoolJoe72 commented 6 months ago

So it looks like it skips the part where it's supposed to add the input file.

subprocess.CalledProcessError: Command '['ffmpeg', '-v', 'quiet', '-stats', '-activation_bytes', '########', '-c', 'copy', '/dir/to/saved/file.m4b']' returned non-zero exit status 1.

I'm sure there is a better way to do this (I know just enough programing to be dangerous) but I made a patch file skip_rebuild.patch which should highlight the issue location.

After making the change everything seems to work.

CoolJoe72 commented 1 month ago

Sorry didn't realize it would make you download the patch without viewing it. Here is what is in the patch file above or if you prefer just copy it from here.

diff --git a/plugin_cmds/cmd_decrypt.py b/plugin_cmds/cmd_decrypt.py
index 8a09304..489055b 100644
--- a/plugin_cmds/cmd_decrypt.py
+++ b/plugin_cmds/cmd_decrypt.py
@@ -495,6 +495,12 @@ class FfmpegFileDecrypter:
             except ChapterError:
                 if self._skip_rebuild_chapters:
                     echo("Skip rebuild chapters due to chapter mismatch.")
+                    base_cmd.extend(
+                        [
+                            "-i",
+                            str(self._source),
+                        ]
+                    )
                 else:
                     raise
             else: