vace117 / calibre-dedrm-docker-image

Calibre + DeDRM + Kindle for PC
37 stars 3 forks source link

Easy way to copy decrypted book files from docker image to host filesystem? #1

Open ghost opened 4 years ago

ghost commented 4 years ago

Thanks for this fantastic project! It worked flawlessly and saved a lot of further trouble trying to decrypt a kindle ebook using the kindle reader program in wine.

One suggestion, would it be possible to also include a mount point or other simple way to access converted ebooks in the docker calibre library from the local host so they could be copied over? In my use case, I do not have a kindle e-reader but wanted to be able to load the converted epubs on my nook using the host install of Calibre. I was able to use the "docker cp" command to do so but maybe there is an easier method.

Thanks for your incredible effort!

vace117 commented 4 years ago

@lymankj Glad you found this project useful!

I am not sure I understand why you had to use docker cp to get your converted files out though... Did you run the Docker image using the setup script (launch_book_manager.sh)?

If you did, a directory called '$HOME/Calibre_DeDRM_Volume' should have been created on your host OS, and you can find all of your converted Kindle books in 'Calibre_DeDRM_Volume/My Kindle Content'. Did that not work for you? If not, there might be a bug, so please send me some more details about your workflow and I'll attempt to fix this.

ghost commented 4 years ago

I believe maybe this issue was because I launched the script with sudo after getting a permission error trying to run docker as user?

After the directions followed at here I can launch the script as a user.

However, now the script cannot pull the python 2.7.16 MSI binary from the network (the URL is accessible on the host outside of docker):

Downloading https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi to /home/calibre/.cache/winetricks/python27 --2020-08-24 15:17:57-- https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi Resolving www.python.org (www.python.org)... failed: Connection timed out. wget: unable to resolve host address 'www.python.org' Executing cd /home/calibre/.cache/winetricks/python27 Downloading https://web.archive.org/web/2000/https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi to /home/calibre/.cache/winetricks/python27 --2020-08-24 15:18:42-- https://web.archive.org/web/2000/https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi Resolving web.archive.org (web.archive.org)... failed: Connection timed out. wget: unable to resolve host address 'web.archive.org'

However, the script is able to download the Cryptopython installer, which then of course fails when it cannot detect Python in the image. Any ideas?

vace117 commented 4 years ago

@lymankj Hmm, this looks like you Docker installation is still not quite right. It seems to be failing on the very 1st external download from the container, which suggests that the container simply doesn't have access to the Internet.

You can do some troubleshooting by getting a shell inside the container and trying to resolve some hosts manually (any Internet host will do, I suspect).

 $ docker run -it --entrypoint bash vace117/calibre-dedrm

And then do some tests:

 $ wget www.google.ca
 $ wget https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi

Make sure that the above works, but I suspect it won't.

Now you need to figure out why your Docker's network stack is messed up. An easy way to bypass the problem could be to tell the container to use the host's network rather than bridging a local subnet. So you could run the container like this:

$ docker run -it --network host --entrypoint bash vace117/calibre-dedrm

And now run the same tests, and they'll probably work.

So you can either solve your Docker install issue, or just modify 'launch_book_manager.sh' script to use that '--network' switch.

Good luck!