Add manga reader downloader

This commit is contained in:
Alex 2020-06-13 22:11:29 +02:00
parent 8bbd141020
commit 3fdb04cd97
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
local link=("" "$1")
local IFS=$'/'
local img
local data
while [[ ! -z $link ]]; do
data=$(curl -sS "http://www.mangareader.net/${link[2]}/${link[3]:-1}/${link[4]:-1}" | grep '<div id="imgholder">')
img=$(print $data | grep -oP '(?<=src=").*\.jpg(?=")')
if [[ ! -d "${link[3]:-1}/" ]]; then
mkdir "${link[3]:-1}/"
fi
curl -\#L "$img" -o "${link[3]:-1}/${link[4]:-1}.jpg"
link=($(print $data | grep -oP '(?<=\<a href=").*\/\d*(\/\d*)?(?=")'))
done