Compare commits

..

No commits in common. "main" and "0.0.0-alpha" have entirely different histories.

3 changed files with 10 additions and 38 deletions

View File

@ -10,37 +10,21 @@ This software does not utilize Adobe Digital Editions nor Wine. It is completely
1. Create a free Adobe account [here](https://account.adobe.com) if you do not already have one.
1. Install the software.
* For NixOS, include this flake in your system `flake.nix`. Then run `knock ~/path/to/my-book.acsm` to use.
* For NixOS, include this flake in your system `flake.nix`.
```nix
inputs.knock.url = github:BentonEdmondson/knock
outputs = { self, knock }: { /* knock.defaultPackage.x86_64-linux is the package */ }
```
* For non-NixOS, use the latest [release](https://github.com/BentonEdmondson/knock/releases). It is large because it includes all dependencies, allowing it to run on any system with an x86_64 Linux kernel. It was built using [`nix bundle`](https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-bundle.html). Use it by doing the following:
1. Download `knock-version-x8664-linux` and open a terminal
1. Navigate to the folder within which `knock-version-x86_64-linux` resides (e.g. `cd ~/Downloads`)
1. Run `mv knock-version-x86_64-linux knock` to rename it to `knock`
1. Run `chmod +x knock` to make it executable
1. Run `./knock ~/path/to/my-book.acsm` to convert the ebook
If you receive an error that says something like `./nix/store/...: not found` or `./nix/store/...: No such file or directory` then you might not have user namespaces enabled. Try running the following to fix it:
```
echo "kernel.unprivileged_userns_clone=1" >> /etc/sysctl.conf
sudo reboot
```
1. Enter in your Adobe email and password when prompted
1. Optionally move the executable to `~/bin` (for your user) or `/usr/local/bin/` (for all users) to allow it to run from anywhere (might not work on some distributions)
* For non-NixOS, download the latest [release](https://github.com/BentonEdmondson/knock/releases). It is large because it includes all dependencies, allowing it to run on any system with an x86_64 Linux kernel. It was built using [`nix bundle`](https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-bundle.html).
1. Download the ACSM file from wherever you bought the book.
1. Run `knock my-book.acsm`. Enter your Adobe username and password if prompted.
## Verified Book Sources
Knock should work on any ACSM file, but it has been specifically verified to work on ACSM EPUB files from the following:
* [eBooks.com](https://www.ebooks.com/en-us/)
* [Rakuten Kobo](https://www.kobo.com/us/en)
* [Google Books](https://books.google.com/)
* [Hugendubel.de](https://www.hugendubel.de/de/) (German)
Knock has been verified to work on books provided by the following
* [eBooks.com](https://www.ebooks.com/en-us/), as long as the description says
> To download and read this eBook on a PC or Mac:
> * Adobe Digital Editions (This is a free app specially developed for eBooks. It's not the same as Adobe Reader, which you probably already have on your computer.)
The resulting EPUB file can be read with any EPUB reader.

View File

@ -17,7 +17,7 @@
in {
defaultPackage.x86_64-linux = nixpkgs.stdenv.mkDerivation {
pname = "knock";
version = "0.1.0-alpha";
version = "0.0.1";
src = self;
nativeBuildInputs = [ nixpkgs.makeWrapper ];
buildInputs = [
@ -30,18 +30,6 @@
cp knock $out/bin
wrapProgram $out/bin/knock --prefix PATH : ${nixpkgs.lib.makeBinPath [libgourou-utils inept-epub]}
'';
meta = {
description = "A CLI tool to convert ACSM files to DRM-free EPUB files";
homepage = "https://github.com/BentonEdmondson/knock";
license = [ nixpkgs.lib.licenses.gpl3Only ];
maintainers = [{
name = "Benton Edmondson";
email = "bentonedmondson@gmail.com";
}];
# potentially others, but I'm only listed those tested
platforms = [ "x86_64-linux" ];
};
};
};

2
knock
View File

@ -9,7 +9,7 @@ parser.add_argument('acsm_file', metavar='file', type=str, help='the ACSM file t
args = parser.parse_args()
# these are all Path objects: https://docs.python.org/3/library/pathlib.html
args.acsm_file = Path(args.acsm_file).expanduser().resolve()
args.acsm_file = Path(args.acsm_file).expanduser()
args.drm_file = args.acsm_file.with_suffix('.drm')
args.epub_file = args.acsm_file.with_suffix('.epub')
args.adobe_dir = Path('~/.config/knock').expanduser()