Skip to content

Instantly share code, notes, and snippets.

@precurejunkie
Last active March 13, 2022 04:24
Show Gist options
  • Save precurejunkie/cdceefab4118ca79ce48744bf8d68ec5 to your computer and use it in GitHub Desktop.
Save precurejunkie/cdceefab4118ca79ce48744bf8d68ec5 to your computer and use it in GitHub Desktop.
Wrapper utilities for https://github.com/gvellut/jncep to make it easier to use
#!/bin/bash
# Put your username and password in this file:
. ~/.jncep/credentials
# in the following format: (without the # in front)
# [email protected]
# PASSWORD='password'
# This will download everything that exists in the series you point it at, assuming
# they haven't expired, consolidating parts by volume into single epubs if
# possible, then add it to your tracking list so future updates can be
# downloaded as they come out
# edit the cd line to point at where you want them downloaded to, and make sure
# jncep is in your $PATH
cd /sdcard/Books/MoonReader
jncep epub --byvolume --parts : --email "$EMAIL" --password "$PASSWORD" ${1}
jncep track add --email "$EMAIL" --password "$PASSWORD" ${1}
#!/bin/bash
# Put your username and password in this file:
. ~/.jncep/credentials
# in the following format: (without the # in front)
# [email protected]
# PASSWORD='password'
# This will update all of the series you are tracking and download anything new
# that's posted since the last time you updated. You can put -d as an argument
# to get debugging output if there are weird errors. The main point of this script
# is to avoid you having to type your username and password on the command
# line every time you run "jncep update". It also keeps your jncep up-to-date.
# edit the cd line at the bottom to point at where you want them downloaded to,
# and make sure jncep and pip are your $PATH
# the following few lines make sure that both pip and jncep are up-to-date
pip -qq install -U pip
oldver=`pip list | grep jncep | xargs echo`
pip -qq install -U jncep
newver=`pip list | grep jncep | xargs echo`
if [ "$oldver" != "$newver" ]; then
echo "Upgraded $oldver to $newver"
else
echo "Using $oldver"
fi
# and here's the meat of the script.
cd /sdcard/Books/MoonReader
jncep $@ update --email "$EMAIL" --password "$PASSWORD" -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment