Skip to content

Instantly share code, notes, and snippets.

@Elettronik
Last active February 8, 2019 16:06
Show Gist options
  • Save Elettronik/6764485 to your computer and use it in GitHub Desktop.
Save Elettronik/6764485 to your computer and use it in GitHub Desktop.
Download Manga
#!/bin/bash
TMP_FILE=$(tempfile)
echo $TMP_FILE
#Retrieve list
wget -O $TMP_FILE "http://www.mangareader.net/alphabetical" |& \
sed -n -e 's|.*[^0-9]\([0-9]\{1,3\}\)%.*|\1|p' | \
dialog --gauge " Retrieving Index" 6 100
MANGA_LIST=$(grep "<li><a" $TMP_FILE | sed -e "/_blank/d" -e "s/.*href=\"\(.*\)\">\(.*\)<\\/a>.*/\\1\t\\2/" -e "/^\\/privacy/d;/^\\/search/d;/\\/popular/d;/\\/alphabetical/d;/^#/d;/\\/\t/d")
CHOICE_LIST="dialog --no-tags --radiolist \"Select manga\" 50 100 48 "
#while read -r line; do
# #create list of choices
# #echo $line
# CHOICE_LIST="$CHOICE_LIST \"$(echo $line | cut -f2 )\" \"$(echo $line | cut -f1 )\" off "
#done <<< "$MANGA_LIST"
#echo $CHOICE_LIST
#eval $CHOICE_LIST
read line <<< "$MANGA_LIST"
echo $line | cut -d\t -f1
#Cleanup
rm $TMP_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment