Compare commits
5 Commits
0.0.1-alph
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f682b82d5 | ||
|
|
d33a44a143 | ||
|
|
af4f8b2fa0 | ||
|
|
868597396c | ||
|
|
ca95a28b96 |
32
README.md
32
README.md
|
|
@ -10,21 +10,37 @@ 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`.
|
||||
* For NixOS, include this flake in your system `flake.nix`. Then run `knock ~/path/to/my-book.acsm` to use.
|
||||
```nix
|
||||
inputs.knock.url = github:BentonEdmondson/knock
|
||||
outputs = { self, knock }: { /* knock.defaultPackage.x86_64-linux is the package */ }
|
||||
```
|
||||
* 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.
|
||||
* 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)
|
||||
|
||||
|
||||
## Verified Book Sources
|
||||
|
||||
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.)
|
||||
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)
|
||||
|
||||
The resulting EPUB file can be read with any EPUB reader.
|
||||
|
||||
|
|
|
|||
14
flake.nix
14
flake.nix
|
|
@ -17,7 +17,7 @@
|
|||
in {
|
||||
defaultPackage.x86_64-linux = nixpkgs.stdenv.mkDerivation {
|
||||
pname = "knock";
|
||||
version = "0.0.1";
|
||||
version = "0.1.0-alpha";
|
||||
src = self;
|
||||
nativeBuildInputs = [ nixpkgs.makeWrapper ];
|
||||
buildInputs = [
|
||||
|
|
@ -30,6 +30,18 @@
|
|||
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
2
knock
|
|
@ -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()
|
||||
args.acsm_file = Path(args.acsm_file).expanduser().resolve()
|
||||
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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue