Last active
December 30, 2023 15:18
-
-
Save criztovyl/e747c099205e7bd609f8a9aef1b80023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# GoKoKo - libgourou kobo koreader | |
# use libgourou to download epub via ACSM (e.g. from Kobo) and remove Adobe Adept DRM | |
# to allow reading in your eBook reader app of choice (e.g. KOReader), independent of whether it supports DRM. | |
sel=$1 | |
if [ ! -f $sel ]; then | |
echo >&2 non such file $sel | |
exit 1 | |
fi | |
gourou=/data/data/com.termux/files/home/libgourou | |
books=/data/data/com.termux/files/home/storage/shared/Books/ | |
dl=$gourou/utils/acsmdownloader | |
deadept=$gourou/utils/adept_remove | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$gourou | |
export ADEPT_DIR=$gourou/.adept | |
tmp=$(mktemp -d) | |
$dl $sel -O $tmp | |
$deadept $tmp/* | |
fname=$(basename "$(ls $tmp/* | tail -n 1)") | |
fnew=$(echo -n $fname | tr -c "[:alnum:]_. -" "_") | |
mv "$tmp/$fname" "$books/$fnew" | |
rm -rf $tmp | |
rm -i $sel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment