Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#101 Le 20/06/2013, à 15:40

WeetabiX

Re : boomeranga! pour les amateurs de mangas

Nouvelle version : 0.9.7

0.9.7
support scan-manga.com
amélioration du support mangafox
poursuite séries en 1 clic
ajout fonction conversion .pdf post dl
ajout modif option conversion + suppression question pdf
##à faire :
nettoyage du code
correction échec()
quelques erreurs sur scan-manga

#!/bin/bash
#weetabix' 2013

##################
#  Boomeranga!   #
##################

####description###########################################################################################
# boomeranga! a pour but d'améliorer le confort de lecture des planches de mangas disponibles sur le net #
# en les téléchargeant, puis en les compressant en .cbz (pour comix) et .pdf (si souhaité).				 #
# 																										 #
# Le script crée un dossier .boomeranga dans le home de l'utilisateur et y conserve 2 informations :     #
# 					-le chemin vers le dossier de téléchargement										 #
#					-le changelog																		 #
#																										 #
# N'hésitez pas à participer au projet en postant vos idées, remarques, bugs							 #
#																										 #		
# Info de versions : les versions <1 se concentrent sur le support de sites et les fonctionnalités.		 #
#					 la version 1.0 ne sortira que lorsque celles-ci seront jugées suffisantes.          #
#                       L'interface	graphique sera sa principale évolution.								 #	
##########################################################################################################



####dépendances#####################
# bash, wget, zip, calibre, zenity #
####################################

v=0.9.7
#gestion dépendances
paquet=(bash calibre wget zip)

function télécharger {
if [[ ${an} != 1 ]]
then
manga=`zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?"` || menu
fi

mkdir $manga
cd $PWD/$manga/

#vérif page 404
if [[ -z $(grep ${manga} ../.404) ]]
then zenity --error --title "boomeranga" --text "manga non trouvé - abandon"
	cd $ch
	mv $PWD/$manga $HOME/.local/share/Trash/files & menu
fi

#connaitre chapitre max d'1 manga
wget http://www.lecture-en-ligne.com/$manga/1/0/0/1.html -O infochap
grep -A 1 'id="chap"' infochap > infochap2
head -2 infochap2 | tail -1 > infochap
cut -d ">" -f2 infochap | cut -d "<" -f1 > infochap2
chap_man=$(cat $PWD/infochap2)

chap=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Commencer à quel chapitre ?") || exit

im=01
chapn=$(($chap_man-$chap+1)) # définir chapitres restant

zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "$manga - Télécharger tous les chapitres disponibles ?   [$chap_man paru(s) / $chapn nouveau(x)]"
if [ $? = 0 ]
then
	chapmax=$chap_man
	((chapmax++))
else
	chapmax=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --cancel-label "Quitter" --entry --text "Stopper à quel chapitre ?   [vous êtes au n°$chap]") || exit
	((chapmax++))
fi

while [ $chap != $chapmax ]
do
mkdir $chap
cd $PWD/$chap/

#rechercher le nb de pages du chapitre
wget http://www.lecture-en-ligne.com/$manga/$chap/0/0/1.html -O info
grep 'current_total_pages' info > info2
cut -d "'" -f2 info2 > info3
imax=`cat $PWD/info3`

#vérif page 404 - chapitre
if [[ -z $(grep -c 'ERREUR 404' info) ]]
then zenity --error --title "boomeranga!" --text "chapitre non trouvé - abandon"
	cd $ch
	mv $PWD/$manga $HOME/.local/share/Trash/files & menu
fi

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement du chapitre $chap"
#récupérer les images
for im in $(seq -w ${imax})
do
  wget -T 15 http://www.lecture-en-ligne.com/images/mangas/$manga/$chap/$im.jpg
done

#création du .cbz
rm $PWD/info & rm $PWD/info2 & rm $PWD/info3
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
im=01
done

rm $PWD/infochap
echo $chapmax > $PWD/chaplast

#inscrire manga dans liste 'séries' sauf si déjà présent
cd ..
grep ${manga} séries
if [ $? != 0 ]
then
	echo ${manga} >> séries
fi

zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Vous trouverez les chapitres téléchargés dans le dossier <b>$ch</b> Bonne lecture! "
#on désactive variable annuaire
an=0
menu
}
function télécharger_poursuite {
cd $manga
wget http://www.lecture-en-ligne.com/$manga/1/0/0/1.html -O infochap
#vérification pour mangas sans n°1
grep "ERREUR 404" infochap
if [ $? = 1 ]
then
grep -A 1 'id="chap"' infochap > infochap2
head -2 infochap2 | tail -1 > infochap
cut -d ">" -f2 infochap | cut -d "<" -f1 > infochap2
chap_man=$(cat $PWD/infochap2)

chap=$(cat $PWD/chaplast)

im=01
chapn=$(($chap_man-$chap+1)) # définir chapitres restant

chapmax=$chap_man
((chapmax++))

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement de la suite de $manga"

while [ $chap != $chapmax ]
do

mkdir $chap
cd $PWD/$chap/

#rechercher le nb de pages du chapitre
wget http://www.lecture-en-ligne.com/$manga/$chap/0/0/1.html -O info
grep 'current_total_pages' info > info2
cut -d "'" -f2 info2 > info3
imax=$(cat $PWD/info3)

#récupérer les images
for im in $(seq -w ${imax})
do
  wget -T 15 http://www.lecture-en-ligne.com/images/mangas/$manga/$chap/$im.jpg
done

#création du .cbz
rm $PWD/info & rm $PWD/info2 & rm $PWD/info3
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
im=01
done

rm $PWD/infochap
echo $chapmax > $PWD/chaplast

fi
cd ..
}

function poursuite_series {
zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "Poursuivre les séries en cours :
<b>$(cat séries)</b> ?"
if [ $? = 0 ]
then
	nb_ligm=$(wc -l séries | cut -d " " -f1)
	((nb_ligm++))
	nb_lig=1
	while [ $nb_lig != $nb_ligm ]
	do
	manga=$(head -n $nb_lig séries | tail -n 1)
	télécharger_poursuite
	((nb_lig++))
	done
	zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
	menu
else
	manga=`zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?"` || menu
	
	#si manga vide
	if [ -z $manga ]
	then zenity --error --title "boomeranga!" --text "Erreur dans le nom - abandon" & exit
	fi
	télécharger
fi
}
function poursuite_series_mangafox {
zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "Poursuivre les séries en cours : 
<b>$(cat séries.mfox)</b> ?"
if [ $? = 0 ]
then
	nb_ligm=$(wc -l séries.mfox | cut -d " " -f1)
	((nb_ligm++))
	nb_lig=1
	while [ $nb_lig != $nb_ligm ]
	do
	manga=$(head -n $nb_lig séries.mfox | tail -n 1)
	télécharger_poursuite_mfox
	((nb_lig++))
	done
	zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
	menu
else
	manga=$(zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?") || menu

	#si manga vide
	if [ -z $manga ]
	then zenity --error --title "boomeranga!" --text "Erreur dans le nom - abandon" & exit
	fi
	télécharger_mangafox
fi
}
function poursuite_series_scan-manga() {
zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "Poursuivre les séries en cours :
<b>$(cat séries.scan-manga)</b> ?"
if [ $? = 0 ]
then
	nb_ligm=$(wc -l séries.scan-manga | cut -d " " -f1)
	((nb_ligm++))
	nb_lig=1
	while [ $nb_lig != $nb_ligm ]
	do
	manga=$(head -n $nb_lig séries.scan-manga | tail -n 1)
	dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
	télécharger_poursuite_scan-manga
	((nb_lig++))
	done
	zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
	menu
fi
}
function poursuite_all() {
#poursuite lecture-en-ligne.com
zenity --progress --pulsate --timeout "1" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" \
--text "Mise à jour des séries :
<b>$(cat séries)</b>"
nb_ligm=$(wc -l séries | cut -d " " -f1)
((nb_ligm++))
nb_lig=1
while [ $nb_lig != $nb_ligm ]
do
manga=$(head -n $nb_lig séries | tail -n 1)
télécharger_poursuite
((nb_lig++))
done

#poursuite mangafox.me
zenity --progress --pulsate --timeout "1" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" \
--text "Mise à jour des séries :
<b>$(cat séries.mfox)</b>"
nb_ligm=$(wc -l séries.mfox | cut -d " " -f1)
((nb_ligm++))
nb_lig=1
while [ $nb_lig != $nb_ligm ]
do
manga=$(head -n $nb_lig séries.mfox | tail -n 1)
télécharger_poursuite_mfox
((nb_lig++))
done

#poursuite scan-manga.com
zenity --progress --pulsate --timeout "1" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" \
--text "Mise à jour des séries :
<b>$(cat séries.scan-manga)</b>"
nb_ligm=$(wc -l séries.scan-manga | cut -d " " -f1)
((nb_ligm++))
nb_lig=1
while [ $nb_lig != $nb_ligm ]
do
manga=$(head -n $nb_lig séries.scan-manga | tail -n 1)
dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
télécharger_poursuite_scan-manga
((nb_lig++))
done

zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
menu
}

function télécharger_mangafox {
if [[ ${an} != 1 ]]
then
manga=`zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?"` || menu
fi

mkdir $manga
cd $PWD/$manga/

#dernier chapitre
chap_man=$(wget -U=firefox -qO - "http://mangafox.me/manga/${manga}/" | grep -A 1 "Chapters</h2><hr/>" | grep "Chapter " | sed "s@.*Chapter@@ ; s@.* - @@ ; s@</span></h3></div><ul class=\"chlist\" style=\"display:block\">@@")

info=$(zenity --forms --title "boomeranga" --cancel-label "Quitter" --add-entry "Chapitre début" --add-entry "Chapitre fin (dernier : ${chap_man})" --window-icon "/usr/share/pixmaps/boomeranga.svg")

#chap=${info%|*}
chap=$(echo $info | cut -d "|" -f 1)
((chap++))
#chapmax=c${info#*|}
chapmax=$(echo $info | cut -d "|" -f 2)
((chapmax++))

#formatage
if test ${#chap} = 1
then chap="c00"$(echo $info | cut -d "|" -f 1)
elif test ${#chap} = 2
then chap="c0"$(echo $info | cut -d "|" -f 1)
else
chap="c"$(echo $info | cut -d "|" -f 1)
fi

#formatage
if test ${#chapmax} = 1
then chapmax="c00"$(echo $info | cut -d "|" -f 2)
elif test ${#chapmax} = 2
then chapmax="c0"$(echo $info | cut -d "|" -f 2)
else
chapmax="c"$(echo $info | cut -d "|" -f 2)
fi

vol="v01"
im=1

while [ $chap != $chapmax ]
do
mkdir -p $vol$chap
cd $PWD/$vol$chap/

#rechercher le nb de pages du chapitre
wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O info
grep 'var total_pages=' info > info2
cut -d "=" -f2 info2 | cut -d ";" -f1 > info3
imax=$(cat $PWD/info3)
let imaxi=imax+1

#404
if [[ -z $(cat $PWD/info) ]]
then
	zenity --error --title "boomeranga!" --text "Manga/chapitre non trouvé - abandon"
	cd $ch
	mv $PWD/$manga $HOME/.local/share/Trash/files & exit
fi

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement du chapitre $chap"

#récupérer les images du chapitre
while [ $im != $imaxi ]
do 
	wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O infochap
	grep -A 1 'onclick="return enlarge()"><img src=' infochap > infochap2
	head -1 infochap2 > infochap
	cut -d '"' -f6 infochap | cut -d '"' -f1 > infochap2
	chi=$(< $PWD/infochap2)
	wget -U=firefox $chi
	((im++))
done

#création du .cbz
mv $PWD/info $HOME/.local/share/Trash/files ; mv $PWD/info2 $HOME/.local/share/Trash/files ; mv $PWD/info3 $HOME/.local/share/Trash/files
mv $PWD/infochap $HOME/.local/share/Trash/files ; mv $PWD/infochap2 $HOME/.local/share/Trash/files

zip -r $vol$chap.cbz .
mv $vol$chap.cbz ..
cd ..
rm -r $PWD/$vol$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $vol$chap.cbz $vol$chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $vol$chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre / volume
chap=$(echo ${chap} | sed "s@.*c@@")
#incrément
((chap++))
#formatage
if test ${#chap} = 1
then chap="c00"${chap}
elif test ${#chap} = 2
then chap="c0"${chap}
else
chap="c"${chap}
fi

im=1

done

echo $chapmax > $PWD/chaplast

#inscrire manga dans liste 'séries' sauf si déjà présent
cd ..
grep ${manga} séries.mfox
if [ $? != 0 ]
then
	echo ${manga} >> séries.mfox
fi

zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Vous trouverez les chapitres téléchargés dans le dossier <b>$ch</b> Bonne lecture! "
cd $ch
menu
}
function télécharger_poursuite_mfox {
cd $manga
vol="v01"
chap=$(cat $PWD/chaplast)
chapmax=$(wget -U=firefox -qO - "http://mangafox.me/manga/${manga}/" | grep -A 1 "Chapters</h2><hr/>" | grep "Chapter " | sed "s@.*Chapter@@ ; s@.* - @@ ; s@</span></h3></div><ul class=\"chlist\" style=\"display:block\">@@")
((chapmax++))
#compter longueur variable et comparer avec commande test
if test ${#chapmax} = 1
then chapmax="c00"${chapmax}
elif test ${#chapmax} = 2
then chapmax="c0"${chapmax}
else
chapmax="c"${chapmax}
fi

im=1

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement de la suite de $manga"

while [ $chap != $chapmax ]
do
mkdir -p $vol$chap
cd $PWD/$vol$chap/

wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O info
grep 'var total_pages=' info > info2
cut -d "=" -f2 info2 | cut -d ";" -f1 > info3
imax=$(cat $PWD/info3)
let imaxi=imax+1

#récupérer les images du chapitre
while [ $im != $imaxi ]
do 
	wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O infochap
	grep -A 1 'onclick="return enlarge()"><img src=' infochap > infochap2
	head -1 infochap2 > infochap
	cut -d '"' -f6 infochap | cut -d '"' -f1 > infochap2
	chi=$(cat $PWD/infochap2)
	wget -U=firefox $chi
	((im++))
done

#nettoyage
mv $PWD/info $HOME/.local/share/Trash/files ; mv $PWD/info2 $HOME/.local/share/Trash/files ; mv $PWD/info3 $HOME/.local/share/Trash/files
mv $PWD/infochap $HOME/.local/share/Trash/files ; mv $PWD/infochap2 $HOME/.local/share/Trash/files

#création du .cbz
zip -r $vol$chap.cbz .
mv $vol$chap.cbz ..
cd ..
rm -r $PWD/$vol$chap
#vérif opération précédente
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $vol$chap.cbz $vol$chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $vol$chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre / volume
chap=$(echo ${chap} | sed "s@.*c@@")
#incrément
((chap++))
#formatage
if test ${#chap} = 1
then chap="c00"${chap}
elif test ${#chap} = 2
then chap="c0"${chap}
else
chap="c"${chap}
fi

im=1
done

echo $chapmax > $PWD/chaplast

cd ..
}

function telecharger_scan-manga() {
mkdir $dir
cd $PWD/$dir/

#vérif page 404

chap=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Commencer à quel chapitre ?") || exit

chapmax=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --cancel-label "Quitter" --entry --text "Stopper à quel chapitre ?   [vous êtes au n°$chap]") || exit
((chapmax++))

while [ $chap != $chapmax ]
do
mkdir $chap
cd $PWD/$chap/

wget "${manga}" -O titre 
grep -A 3 "Chapitre ${chap} :" titre > titre1
grep "http://www.scan-manga.com/lecture-en-ligne" titre1 > titre
sed -i "s@.*http://www.scan-manga.com/lecture-en-ligne@http://www.scan-manga.com/lecture-en-ligne@" titre
sed -i "s@.html.*@.html@" titre
lienp=$(cat titre)

wget ${lienp} -O info
lien=$(grep "#image_lel').attr('src','http://leI" info | cut -d "'" -f6)
grep "var u = new Array;" info > totim
sed -i "s@\"@\n@g" totim 
sed -i "/^var/d ; /;/d" totim

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement du chapitre $chap"

nb_imx=$(wc -l totim | cut -d " " -f1)
((nb_imx++))
nb_im=1
	while [ $nb_im != $nb_imx ]
	do
	im=$(head -n ${nb_im} totim | tail -n 1)
	wget ${lien}${im}
	((nb_im++))
	done

#création du .cbz
rm $PWD/info & rm $PWD/titre & rm $PWD/titre1 & rm $PWD/totim
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
done

#rm $PWD/infochap
echo $chapmax > $PWD/chaplast

#inscrire manga dans liste 'séries' sauf si déjà présent
cd ..
grep ${manga} séries.scan-manga
if [ $? != 0 ]
then
	echo ${manga} >> séries.scan-manga
fi
menu
}
function télécharger_poursuite_scan-manga {
cd $dir

#connaitre chapitre max d'1 manga
#sed -n "/^Vol/p" supprime tout ce qui ne commence pas par "Vol"
chapmax=$(grep -A 5 "${manga}" ../.mangas_scan-manga | sed -n "/^Vol/p" | sed "s@.*Ch @@")
((chapmax++))

chap=$(cat $PWD/chaplast)

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement de la suite de $dir"

while [ $chap != $chapmax ]
do
mkdir $chap
cd $PWD/$chap/

wget "${manga}" -O titre 
grep -A 3 "Chapitre ${chap} :" titre > titre1
grep "http://www.scan-manga.com/lecture-en-ligne" titre1 > titre
sed -i "s@.*http://www.scan-manga.com/lecture-en-ligne@http://www.scan-manga.com/lecture-en-ligne@" titre
sed -i "s@.html.*@.html@" titre
lienp=$(cat titre)

wget ${lienp} -O info
lien=$(grep "#image_lel').attr('src','http://leI" info | cut -d "'" -f6)
grep "var u = new Array;" info > totim
sed -i "s@\"@\n@g" totim 
sed -i "/^var/d ; /;/d" totim

nb_imx=$(wc -l totim | cut -d " " -f1)
((nb_imx++))
nb_im=1
	while [ $nb_im != $nb_imx ]
	do
	im=$(head -n ${nb_im} totim | tail -n 1)
	wget ${lien}${im}
	((nb_im++))
	done

#création du .cbz
rm $PWD/info & rm $PWD/titre & rm $PWD/titre1 & rm $PWD/totim
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
done

#rm $PWD/infochap
echo $chapmax > $PWD/chaplast

cd ..
}

### annuaires ###
annuaire() {
test -f $PWD/.mangas2
if [ $? = 1 ]
then
zenity --question --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Lors du premier lancement cette option prend 2-3 minutes, l'exécuter ?" || menu
(nb_page=$(wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=1" | sed -n "/pagination/ s@.*>\([0-9]*\)</a>  ).*@\1@p")
for i in $(seq ${nb_page})
do
  wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=${i}" | grep -A 7 "tr onmouseover" | sed "s@^[[:space:]]*@@ ; s@</a>.*@@ ; s@<td class=\"td\">@@ ; s@</td>@@ ; /tr onmouseover\|<table class\|<td>\|--/d ; s@>@\n@ ; s@<a href=\"manga/@@ ; s@/\" class=\"infoImages\"@@"
done > .mangas
sed "s@<a href=@--@ ; /--/d ; /fois/d" .mangas > .mangas2
imax=$(wc -l .mangas2 | awk '{print $1}') ; let imax=imax/3 # détermine nb lignes
j=4
for (( i=1 ; i < $imax ; i=i+2 ))
do
# awk -v permet d'ajouter variable, print $NF = dernier mot
type=$(cat .mangas2 | grep "(" | awk -v i=$i 'NR == i {print;}' | awk '{print $NF}')
# insère le $type à la ligne j
sed -i "${j}i$type" .mangas2
let j=j+7
done
#supprime ( en début de ligne, ) en fin et (...
sed -i "s@^(@@ ; s@)\$@@ ; s@(.*@@" .mangas2
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Récupération des données"
fi
manga=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Veuillez choisir une série" --width "1200" --height "400" --hide-column="1" --column="Référence" --column="Nom du manga" --column="Genre" --column="Type" --column="Note" --column="Nb chap." --column="Dernier paru" < $PWD/.mangas2) || menu
#initialisation variable annuaire
an=1
télécharger
}
annuaire_mfox() {
test -f $PWD/.mangas_mfox
if [ $? = 1 ]
then
zenity --question --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Lors du premier lancement cette option prend environ 5 minutes, l'exécuter ?" || menu
(
nb_page=300 #préciser nb pages par recherche sed
for i in $(seq ${nb_page})
do
  wget -U=firefox -qO - "http://mangafox.me/directory/${i}.htm" | grep -A 4 "<div class=\"manga_text\">" | sed "s@^[[:space:]]*@@ ; /<div class=\"manga_text\">/d ; s@^<a class=\"title\" href=\"http://mangafox.me/manga/@@ ; 
  s@^<p class=\"info\" title=\"@@ ; s@/\" rel=\"[0-9]*\">@\n@ ; s@^.*\"rate\">@@ ; s@<p class=\"info\"><label>@@ ; s@.*</label> @@ ; s@\">.*@@ ; s@</a>@@ ; s@</span>@@ ; s@</p>@@ ; /--/d"
done > .mangas_mfox
#correction erreur sur 1 ligne
sed -i "s@ - &quot.*@@" .mangas_mfox
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Récupération des données"
fi
manga=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Veuillez choisir une série" --width "1200" --height "400" --hide-column="1" --column="Référence" --column="Nom du manga" --column="Note" --column="Genre" --column="Visites" < $PWD/.mangas_mfox) || menu
#initialisation variable annuaire
an=1
télécharger_mangafox
}
annuaire_scan-manga() {
test -f $PWD/.mangas_scan-manga
if [ $? = 1 ]
then
(
wget -qO - http://www.scan-manga.com/scanlation/liste_des_mangas.html | grep "<div class=\"texte_lettre\">" -A 15 > .mangas_scan-manga
sed -i "/<div class=\"texte_lettre/d ; /<div class=\"texte_manga book_open\">/d ; s@<span class=\"hover_text_manga\"@\n@ 
s@<h3><a class=\"texte_manga\" href=\"@@ ; /<div class=\"texte_note\">/d ; s@<div class=\"texte_genre\"><span>@@ ; s@^>@@ ; s@</span></a></h3>@@ ; 
/<div class='/d ; /^<span/d ; /^\"display/d ; s@.*average\"@@ ; s@^>@@ ; s@</span> <span style=@@ ; s@<div class=\"texte_statut\"><span>@@ ; 
s@.*texte_der_chpt\">@@ ; s@</div>@--@" .mangas_scan-manga
sed -i "s@^ rel=\"[0-9]*\"@@ ; s@</a> le @\n@ ; /<div/d ; s@\">@@ ; s@^>@@ ; s@</span>--@@ ; /--/d" .mangas_scan-manga
#résolution accents
sed -i "s@&#224;@à@ ; s@&#226;@â@ ; s@&#233;@é@ ; s@&#234;@ê@ ; s@&#232;@è@ ; s@&#244;@ô@ ; s@&#235;@ë@ ; s@&#212;@Ô@ ; 
s@&#251;@û@ ; s@&#8217;@'@ ; s@&#239;@ï@ ; s@amp;@@ ; s@&#228;@ä@ ; s@&#201;@E@" .mangas_scan-manga
#màj
sed -i "s@<span class.*@@ ; s@</a> @\n@" .mangas_scan-manga
#correction temp
sed -i "s@Junketsu + Kareshi@Junketsu + Kareshi\n@ ; s@Watashi no + Okusuri@Watashi no + Okusuri\n@" .mangas_scan-manga
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Récupération des données"
fi
manga=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Veuillez choisir une série" --width "1000" --height "400" --hide-column="1" --column="Référence" --column="Nom du manga" --column="Genre" --column="Note" --column="Statut" --column="Dernier chapitre" --column="Dernière màj" < $PWD/.mangas_scan-manga) || menu
dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
telecharger_scan-manga
}
#################

### init ###
dep() {
cd $HOME/.boomeranga/
(for (( i=0 ; i < ${#paquet[*]} ; i++ ))
do
#recherche paquets non installés et les inscrit en supprimant le retour à la ligne
[[ $(aptitude show ${paquet[i]} | grep "État: non installé") ]] && echo "${paquet[i]} " | tr -d "\n" >> dépendances
done) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Vérification des dépendances"
test -f $PWD/dépendances
if [ $? = 0 ]
then
	zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --info --text "Les dépendances suivantes sont nécessaires pour le bon 
	fonctionnement de boomeranga! :

	<b>$(cat dépendances)</b>

	Il est conseillé de les installer avant de redémarrer le script."
	exit
else
	zenity --info --ok-label "Go!" --timeout "2" --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les dépendances
sont satisfaites"
fi
}
function ch() {
ch=$(cat $HOME/.boomeranga/ch)
mkdir -p $ch/
cd $ch
}
#vérification présence fichiers 'séries' et création si besoin
function séries {
test -f $PWD/séries
if [ $? = 1 ]
then
	> séries
fi
test -f $PWD/séries.mfox
if [ $? = 1 ]
then
	> séries.mfox
fi
test -f $PWD/séries.scan-manga
if [ $? = 1 ]
then
	> séries.scan-manga
fi
}
liste_manga() {
#récupération liste manga lel.com pour 404 / _new pour conserver ancien tant que nouveau incomplet
nb_page=$(wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=1" | sed -n "/pagination/ s@.*>\([0-9]*\)</a>  ).*@\1@p")
for i in $(seq ${nb_page})
do
  wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=${i}" | grep -A 7 "tr onmouseover" | sed "s@^[[:space:]]*@@ ; s@Ch.*@@ ; /td class=/d ; /--/d ; /<td>/d ; /<tr onmouseover/d ; /<table class/d"
done > .404_new
mv .404_new .404
}
############

### options ###
function ch_maj {
ch_tmp=$(zenity --file-selection --window-icon "/usr/share/pixmaps/boomeranga.svg" --title "Choisir le dossier des téléchargements boomeranga!" --directory)
echo $ch_tmp/boomeranga > $HOME/.boomeranga/ch_new
ch=$(cat $HOME/.boomeranga/ch)
ch_new=$(cat $HOME/.boomeranga/ch_new)
mv $ch $ch_new
mv $HOME/.boomeranga/ch_new $HOME/.boomeranga/ch
zenity --info --ok-label "bye!" --timeout "5" --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Merci de redémarrer boomeranga! pour que les
changements soient effectifs" & exit
}
function convert_pdf {
pdf=$(zenity --list --checklist --cancel-label "Quitter" --title "boomeranga!" --text "Convertir en .pdf ?" --column=option --column=description 1 "activer conversion pdf") || menu
case "${pdf}" in
"") pdf=""
;;
esac

if [[ -z $pdf ]]
then pdf="n"
else pdf="o"
fi
}
simple_convert() {
zenity --info --title="Conversion .cbz vers .pdf" --text="1. Choisir fichier source
2. Choisir fichier cible"

fichier1=`zenity --file-selection --title="Sélectionnez un fichier"`
fichier2=`zenity --file-selection --save`

ebook-convert $fichier1 $fichier2 --right2left | zenity --progress --text "Conversion en cours" --auto-close --auto-kill

zenity --info --title="Info" --text="Conversion de <b>$fichier1</b> terminée"
}
#à vérif. pour activ.
échec() {
while [ ${?} -ne 0 ]
do
	zenity --title "boomeranga!" --info --text "Echec de l'opération - retour au menu"
	menu
done
}
###############

### stop ###
nettoyage_annuaires() {
[[ -f $PWD/.mangas2 ]] && mv $PWD/.mangas2 $HOME/.local/share/Trash/files
[[ -f $PWD/.mangas_mfox ]] && mv $PWD/.mangas_mfox $HOME/.local/share/Trash/files
[[ -f $PWD/.mangas_scan-manga ]] && mv $PWD/.mangas_scan-manga $HOME/.local/share/Trash/files
}
bye() {
cd ${ch}
nettoyage_annuaires
mv $PWD/wget* $HOME/.local/share/Trash/files
[[ -f $PWD/.mangas ]] && mv $PWD/.mangas $HOME/.local/share/Trash/files
exit
}
############

### menus ###
function menu {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "420" --cancel-label "Quitter" --title "boomeranga!" --text "Menu principal" --column=option --column=description 0 "Poursuivre toutes les séries" 1 "===== Menus dédiés =====" \
2 "lecture-en-ligne.com" 3 "mangafox.me" 4 "scan-manga.com" 5 "======= Options ========" 6 "Modifier le chemin de boomeranga!" 7 "Modifier préférences de conversion" 8 "======== Extra =========" 9 "Convertir .cbz en .pdf" 10 "Demander une fonctionnalité" 11 "Site du projet") || bye
case "${option}" in
0) poursuite_all
;;
1) echo "y'a rien ici :p" && menu
;;
2) menu_lecture-en-ligne.com
;;
3) menu_mangafox.me
;;
4) menu_scan-manga.com
;;
5) echo "y'a rien ici :p" && menu
;;
6) ch_maj && menu
;;
7) convert_pdf
;;
8) echo "y'a rien ici :p" && menu
;;
9) simple_convert && menu
;;
10) xdg-open 'http://forum.ubuntu-fr.org/viewtopic.php?id=1282211' & menu
;;
11) xdg-open 'http://blog.goupil.eu/?boomeranga' & menu
;;
esac
}
function menu_lecture-en-ligne.com() {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "225" --cancel-label "Retour" --title "boomeranga!" --text "Menu lecture-en-ligne.com" --column=option --column=description 1 "Télécharger mangas" 2 "Voir/Modifier liste de suivi" \
3 "Annuaire mangas") || menu
case "${option}" in
1) télécharger
;;
2) zenity --text-info --editable --cancel-label "Quitter" --filename "$ch/séries" > $ch/séries_maj &&
mv $PWD/séries $HOME/.local/share/Trash/files && mv $PWD/séries_maj $PWD/séries && menu_lecture-en-ligne.com || menu
;;
3) annuaire
;;
esac
}
function menu_mangafox.me() {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "225" --cancel-label "Retour" --title "boomeranga!" --text "Menu mangafox.me" --column=option --column=description 1 "Télécharger mangas" 2 "Voir/Modifier liste de suivi" \
3 "Annuaire mangas") || menu
case "${option}" in
1) télécharger_mangafox
;;
2) zenity --text-info --editable --cancel-label "Retour" --filename "$ch/séries.mfox" > $ch/séries.mfox_maj &&
mv $PWD/séries.mfox $HOME/.local/share/Trash/files && mv $PWD/séries.mfox_maj $PWD/séries.mfox && menu_mangafox.me || menu_mangafox.me
;;
3) annuaire_mfox
;;
esac
}
function menu_scan-manga.com() {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "200" --cancel-label "Retour" --title "boomeranga!" --text "Menu scan-manga.com" --column=option --column=description 1 "Annuaire mangas" \
2 "Voir/Modifier liste de suivi") || menu
case "${option}" in
1) annuaire_scan-manga
;;
2) zenity --text-info --width "500" --height "300" --editable --cancel-label "Retour" --filename "$ch/séries.scan-manga" > $ch/séries.scan-manga_maj &&
mv $PWD/séries.scan-manga $HOME/.local/share/Trash/files && mv $PWD/séries.scan-manga_maj $PWD/séries.scan-manga && menu_scan-manga.com || menu_scan-manga.com
;;
esac
}
#############

#### lancement boomeranga! ####

zenity --progress --pulsate --timeout "8" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Chargement informations" &
nb=$(wget -qO - http://www.lecture-en-ligne.com/ | grep -A 1 "<td class=\"count1\">Mangas :</td>" | sed "/Mangas/d ; s@<td class=\"count3\">@@ ; s@</td>@@")
nb_mfox=$(wget -U=firefox -qO - "http://mangafox.me/manga/#idx_#" | grep "<li><a href=\"http://mangafox.me/manga/" | wc -l)
nb_scanman=$(wget -qO - http://www.scan-manga.com/ | grep "Nombre de mangas :" | sed "s@.* : @@ ; s@<br>@@")

#### intro ####
zenity --info --ok-label "Go!" --title "boomeranga! v$v" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "<b>boomeranga!</b> vous permet de télécharger 
des planches de manga depuis :

   * lecture-en-ligne.com : <b>${nb} titres</b>
   * mangafox.me : 					        <b>${nb_mfox} titres</b>
   * scan-manga.com :                                                      <b>${nb_scanman} titres</b>

Bonne lecture!"

#vérif au premier lancement : création chemin boomeranga + dépendances
test -f $HOME/.boomeranga/ch
if [ $? = 1 ]
then
	mkdir -p $HOME/.boomeranga
	ch_tmp=$(zenity --file-selection --window-icon "/usr/share/pixmaps/boomeranga.svg" --title "Choisir le dossier des téléchargements boomeranga!" --directory)
	echo $ch_tmp/boomeranga > $HOME/.boomeranga/ch
	dep
fi

#info màj
cd $HOME/.boomeranga/
wget http://goupil.eu/repo/boomeranga_version -O version
v2=$(head -n 1 $HOME/.boomeranga/version)
[ $v = $v2 ] || zenity --info --ok-label "Ok" --timeout "2" --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "La version $v2 est disponible"

#
ch
liste_manga &
séries
menu

A vos tests !

Dernière modification par WeetabiX (Le 20/06/2013, à 15:42)

Hors ligne

#102 Le 20/06/2013, à 17:55

hishaime

Re : boomeranga! pour les amateurs de mangas

Au poil ! Merci je vais tester ça wink

Hors ligne

#103 Le 21/06/2013, à 00:49

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Super mise à jour !
Merci ! big_smile


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#104 Le 23/06/2013, à 09:26

Hizoka

Re : boomeranga! pour les amateurs de mangas

Bon voila une petite photo pour vous montrer un peu ce qu'il en est smile

http://hizo.fr/linux/mangapanda/05.png

Me reste 2-3 trucs à paufiner, mais ca marche nickel (je viens de dl 179 chap d'une serie smile )

Dernière modification par Hizoka (Le 23/06/2013, à 22:50)


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#105 Le 23/06/2013, à 14:04

chachatte

Re : boomeranga! pour les amateurs de mangas

J'attend avec impatience ta nouvelle version en esperant de pas avoirs de soucis smile

Hors ligne

#106 Le 23/06/2013, à 15:13

ljere

Re : boomeranga! pour les amateurs de mangas

c'est du beau boulot hizoka


ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon

Hors ligne

#107 Le 23/06/2013, à 15:57

WeetabiX

Re : boomeranga! pour les amateurs de mangas

Nouvelle version : 0.9.8. Elle ajoute un moteur de recherche à partir du nom complet ou partiel d'un manga sur les 3 sites supportés.

0.9.8
recherche manga multisites
corrections mineures
##à faire :
nettoyage du code
correction échec()
quelques erreurs sur scan-manga
ajout mangahere.com

#!/bin/bash
#weetabix' 2013

##################
#  Boomeranga!   #
##################

####description###########################################################################################
# boomeranga! a pour but d'améliorer le confort de lecture des planches de mangas disponibles sur le net #
# en les téléchargeant, puis en les compressant en .cbz (pour comix) et .pdf (si souhaité).				 #
# 																										 #
# Le script crée un dossier .boomeranga dans le home de l'utilisateur et y conserve 2 informations :     #
# 					-le chemin vers le dossier de téléchargement										 #
#					-le changelog																		 #
#																										 #
# N'hésitez pas à participer au projet en postant vos idées, remarques, bugs							 #
#																										 #		
# Info de versions : les versions <1 se concentrent sur le support de sites et les fonctionnalités.		 #
#					 la version 1.0 ne sortira que lorsque celles-ci seront jugées suffisantes.          #
#                       L'interface	graphique sera sa principale évolution.								 #	
##########################################################################################################


####dépendances#####################
# bash, wget, zip, calibre, zenity #
####################################

v=0.9.8
#gestion dépendances
paquet=(bash calibre wget zip)

function télécharger {
#vérif si appel fonction depuis annuaire ou gb
if [[ ${an} != 1 ]]
then
	if [[ ${gb} != 1 ]]
	then
	manga=`zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?"` || menu
	fi
fi

mkdir $manga
cd $PWD/$manga/

#vérif page 404
if [[ -z $(grep ${manga} ../.404) ]]
then zenity --error --title "boomeranga" --text "manga non trouvé - abandon"
	cd $ch
	mv $PWD/$manga $HOME/.local/share/Trash/files & menu
fi

#connaitre chapitre max d'1 manga
wget http://www.lecture-en-ligne.com/$manga/1/0/0/1.html -O infochap
grep -A 1 'id="chap"' infochap > infochap2
head -2 infochap2 | tail -1 > infochap
cut -d ">" -f2 infochap | cut -d "<" -f1 > infochap2
chap_man=$(cat $PWD/infochap2)

chap=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Commencer à quel chapitre ?") || exit

im=01
chapn=$(($chap_man-$chap+1)) # définir chapitres restant

zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "$manga - Télécharger tous les chapitres disponibles ?   [$chap_man paru(s) / $chapn nouveau(x)]"
if [ $? = 0 ]
then
	chapmax=$chap_man
	((chapmax++))
else
	chapmax=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --cancel-label "Quitter" --entry --text "Stopper à quel chapitre ?   [vous êtes au n°$chap]") || exit
	((chapmax++))
fi

while [ $chap != $chapmax ]
do
mkdir $chap
cd $PWD/$chap/

#rechercher le nb de pages du chapitre
wget http://www.lecture-en-ligne.com/$manga/$chap/0/0/1.html -O info
grep 'current_total_pages' info > info2
cut -d "'" -f2 info2 > info3
imax=`cat $PWD/info3`

#vérif page 404 - chapitre
if [[ -z $(grep -c 'ERREUR 404' info) ]]
then zenity --error --title "boomeranga!" --text "chapitre non trouvé - abandon"
	cd $ch
	mv $PWD/$manga $HOME/.local/share/Trash/files & menu
fi

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement du chapitre $chap"
#récupérer les images
for im in $(seq -w ${imax})
do
  wget -T 15 http://www.lecture-en-ligne.com/images/mangas/$manga/$chap/$im.jpg
done

#création du .cbz
rm $PWD/info & rm $PWD/info2 & rm $PWD/info3
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
im=01
done

rm $PWD/infochap
echo $chapmax > $PWD/chaplast

#inscrire manga dans liste 'séries' sauf si déjà présent
cd ..
grep ${manga} séries
if [ $? != 0 ]
then
	echo ${manga} >> séries
fi

zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Vous trouverez les chapitres téléchargés dans le dossier <b>$ch</b> Bonne lecture! "
#on désactive variable annuaire
an=0 & gb=0
menu
}
function télécharger_poursuite {
cd $manga
wget http://www.lecture-en-ligne.com/$manga/1/0/0/1.html -O infochap
#vérification pour mangas sans n°1
grep "ERREUR 404" infochap
if [ $? = 1 ]
then
grep -A 1 'id="chap"' infochap > infochap2
head -2 infochap2 | tail -1 > infochap
cut -d ">" -f2 infochap | cut -d "<" -f1 > infochap2
chap_man=$(cat $PWD/infochap2)

chap=$(cat $PWD/chaplast)

im=01
chapn=$(($chap_man-$chap+1)) # définir chapitres restant

chapmax=$chap_man
((chapmax++))

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement de la suite de $manga"

while [ $chap != $chapmax ]
do

mkdir $chap
cd $PWD/$chap/

#rechercher le nb de pages du chapitre
wget http://www.lecture-en-ligne.com/$manga/$chap/0/0/1.html -O info
grep 'current_total_pages' info > info2
cut -d "'" -f2 info2 > info3
imax=$(cat $PWD/info3)

#récupérer les images
for im in $(seq -w ${imax})
do
  wget -T 15 http://www.lecture-en-ligne.com/images/mangas/$manga/$chap/$im.jpg
done

#création du .cbz
rm $PWD/info & rm $PWD/info2 & rm $PWD/info3
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
im=01
done

rm $PWD/infochap
echo $chapmax > $PWD/chaplast

fi
cd ..
}

function poursuite_series {
zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "Poursuivre les séries en cours :
<b>$(cat séries)</b> ?"
if [ $? = 0 ]
then
	nb_ligm=$(wc -l séries | cut -d " " -f1)
	((nb_ligm++))
	nb_lig=1
	while [ $nb_lig != $nb_ligm ]
	do
	manga=$(head -n $nb_lig séries | tail -n 1)
	télécharger_poursuite
	((nb_lig++))
	done
	zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
	menu
else
	manga=`zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?"` || menu
	
	#si manga vide
	if [ -z $manga ]
	then zenity --error --title "boomeranga!" --text "Erreur dans le nom - abandon" & exit
	fi
	télécharger
fi
}
function poursuite_series_mangafox {
zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "Poursuivre les séries en cours : 
<b>$(cat séries.mfox)</b> ?"
if [ $? = 0 ]
then
	nb_ligm=$(wc -l séries.mfox | cut -d " " -f1)
	((nb_ligm++))
	nb_lig=1
	while [ $nb_lig != $nb_ligm ]
	do
	manga=$(head -n $nb_lig séries.mfox | tail -n 1)
	télécharger_poursuite_mfox
	((nb_lig++))
	done
	zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
	menu
else
	manga=$(zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?") || menu

	#si manga vide
	if [ -z $manga ]
	then zenity --error --title "boomeranga!" --text "Erreur dans le nom - abandon" & exit
	fi
	télécharger_mangafox
fi
}
function poursuite_series_scan-manga() {
zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --question --text "Poursuivre les séries en cours :
<b>$(cat séries.scan-manga)</b> ?"
if [ $? = 0 ]
then
	nb_ligm=$(wc -l séries.scan-manga | cut -d " " -f1)
	((nb_ligm++))
	nb_lig=1
	while [ $nb_lig != $nb_ligm ]
	do
	manga=$(head -n $nb_lig séries.scan-manga | tail -n 1)
	dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
	télécharger_poursuite_scan-manga
	((nb_lig++))
	done
	zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
	menu
fi
}
function poursuite_all() {
#poursuite lecture-en-ligne.com
zenity --progress --pulsate --timeout "1" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" \
--text "Mise à jour des séries :
<b>$(cat séries)</b>"
nb_ligm=$(wc -l séries | cut -d " " -f1)
((nb_ligm++))
nb_lig=1
while [ $nb_lig != $nb_ligm ]
do
manga=$(head -n $nb_lig séries | tail -n 1)
télécharger_poursuite
((nb_lig++))
done

#poursuite mangafox.me
zenity --progress --pulsate --timeout "1" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" \
--text "Mise à jour des séries :
<b>$(cat séries.mfox)</b>"
nb_ligm=$(wc -l séries.mfox | cut -d " " -f1)
((nb_ligm++))
nb_lig=1
while [ $nb_lig != $nb_ligm ]
do
manga=$(head -n $nb_lig séries.mfox | tail -n 1)
télécharger_poursuite_mfox
((nb_lig++))
done

#poursuite scan-manga.com
zenity --progress --pulsate --timeout "1" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" \
--text "Mise à jour des séries :
<b>$(cat séries.scan-manga)</b>"
nb_ligm=$(wc -l séries.scan-manga | cut -d " " -f1)
((nb_ligm++))
nb_lig=1
while [ $nb_lig != $nb_ligm ]
do
manga=$(head -n $nb_lig séries.scan-manga | tail -n 1)
dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
télécharger_poursuite_scan-manga
((nb_lig++))
done

zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les séries sont à jour"
menu
}

function télécharger_mangafox {
if [[ ${an} != 1 ]]
then
	if [[ ${gb} != 1 ]]
	then
	manga=`zenity --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Nouveau manga - nom du manga ?"` || menu
	fi
fi

mkdir $manga
cd $PWD/$manga/

#dernier chapitre
chap_man=$(wget -U=firefox -qO - "http://mangafox.me/manga/${manga}/" | grep -A 1 "Chapters</h2><hr/>" | grep "Chapter " | sed "s@.*Chapter@@ ; s@.* - @@ ; s@</span></h3></div><ul class=\"chlist\" style=\"display:block\">@@")

info=$(zenity --forms --title "boomeranga" --text "Choix des chapitres" --cancel-label "Quitter" --add-entry "Chapitre début" --add-entry "Chapitre fin (dernier : ${chap_man})" --window-icon "/usr/share/pixmaps/boomeranga.svg")

#chap=${info%|*}
chap=$(echo $info | cut -d "|" -f 1)
((chap++))
#chapmax=c${info#*|}
chapmax=$(echo $info | cut -d "|" -f 2)
((chapmax++))

#formatage
if test ${#chap} = 1
then chap="c00"$(echo $info | cut -d "|" -f 1)
elif test ${#chap} = 2
then chap="c0"$(echo $info | cut -d "|" -f 1)
else
chap="c"$(echo $info | cut -d "|" -f 1)
fi

#formatage
if test ${#chapmax} = 1
then chapmax="c00"$(echo $info | cut -d "|" -f 2)
elif test ${#chapmax} = 2
then chapmax="c0"$(echo $info | cut -d "|" -f 2)
else
chapmax="c"$(echo $info | cut -d "|" -f 2)
fi

vol="v01"
im=1

while [ $chap != $chapmax ]
do
mkdir -p $vol$chap
cd $PWD/$vol$chap/

#rechercher le nb de pages du chapitre
wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O info
grep 'var total_pages=' info > info2
cut -d "=" -f2 info2 | cut -d ";" -f1 > info3
imax=$(cat $PWD/info3)
let imaxi=imax+1

#404
if [[ -z $(cat $PWD/info) ]]
then
	zenity --error --title "boomeranga!" --text "Manga/chapitre non trouvé - abandon"
	cd $ch
	mv $PWD/$manga $HOME/.local/share/Trash/files & exit
fi

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement du chapitre $chap"

#récupérer les images du chapitre
while [ $im != $imaxi ]
do 
	wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O infochap
	grep -A 1 'onclick="return enlarge()"><img src=' infochap > infochap2
	head -1 infochap2 > infochap
	cut -d '"' -f6 infochap | cut -d '"' -f1 > infochap2
	chi=$(< $PWD/infochap2)
	wget -U=firefox $chi
	((im++))
done

#création du .cbz
mv $PWD/info $HOME/.local/share/Trash/files ; mv $PWD/info2 $HOME/.local/share/Trash/files ; mv $PWD/info3 $HOME/.local/share/Trash/files
mv $PWD/infochap $HOME/.local/share/Trash/files ; mv $PWD/infochap2 $HOME/.local/share/Trash/files

zip -r $vol$chap.cbz .
mv $vol$chap.cbz ..
cd ..
rm -r $PWD/$vol$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $vol$chap.cbz $vol$chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $vol$chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre / volume
chap=$(echo ${chap} | sed "s@.*c@@")
#incrément
((chap++))
#formatage
if test ${#chap} = 1
then chap="c00"${chap}
elif test ${#chap} = 2
then chap="c0"${chap}
else
chap="c"${chap}
fi

im=1

done

echo $chapmax > $PWD/chaplast

#inscrire manga dans liste 'séries' sauf si déjà présent
cd ..
grep ${manga} séries.mfox
if [ $? != 0 ]
then
	echo ${manga} >> séries.mfox
fi

zenity --info --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Vous trouverez les chapitres téléchargés dans le dossier <b>$ch</b> Bonne lecture! "
cd $ch

an=0 & gb=0

menu
}
function télécharger_poursuite_mfox {
cd $manga
vol="v01"
chap=$(cat $PWD/chaplast)
chapmax=$(wget -U=firefox -qO - "http://mangafox.me/manga/${manga}/" | grep -A 1 "Chapters</h2><hr/>" | grep "Chapter " | sed "s@.*Chapter@@ ; s@.* - @@ ; s@</span></h3></div><ul class=\"chlist\" style=\"display:block\">@@")
((chapmax++))
#compter longueur variable et comparer avec commande test
if test ${#chapmax} = 1
then chapmax="c00"${chapmax}
elif test ${#chapmax} = 2
then chapmax="c0"${chapmax}
else
chapmax="c"${chapmax}
fi

im=1

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement de la suite de $manga"

while [ $chap != $chapmax ]
do
mkdir -p $vol$chap
cd $PWD/$vol$chap/

wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O info
grep 'var total_pages=' info > info2
cut -d "=" -f2 info2 | cut -d ";" -f1 > info3
imax=$(cat $PWD/info3)
let imaxi=imax+1

#récupérer les images du chapitre
while [ $im != $imaxi ]
do 
	wget -U=firefox http://mangafox.me/manga/$manga/$vol/$chap/$im.html -O infochap
	grep -A 1 'onclick="return enlarge()"><img src=' infochap > infochap2
	head -1 infochap2 > infochap
	cut -d '"' -f6 infochap | cut -d '"' -f1 > infochap2
	chi=$(cat $PWD/infochap2)
	wget -U=firefox $chi
	((im++))
done

#nettoyage
mv $PWD/info $HOME/.local/share/Trash/files ; mv $PWD/info2 $HOME/.local/share/Trash/files ; mv $PWD/info3 $HOME/.local/share/Trash/files
mv $PWD/infochap $HOME/.local/share/Trash/files ; mv $PWD/infochap2 $HOME/.local/share/Trash/files

#création du .cbz
zip -r $vol$chap.cbz .
mv $vol$chap.cbz ..
cd ..
rm -r $PWD/$vol$chap
#vérif opération précédente
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $vol$chap.cbz $vol$chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $vol$chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre / volume
chap=$(echo ${chap} | sed "s@.*c@@")
#incrément
((chap++))
#formatage
if test ${#chap} = 1
then chap="c00"${chap}
elif test ${#chap} = 2
then chap="c0"${chap}
else
chap="c"${chap}
fi

im=1
done

echo $chapmax > $PWD/chaplast

cd ..
}

function telecharger_scan-manga() {
mkdir $dir
cd $PWD/$dir/

#vérif page 404

chap=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Commencer à quel chapitre ?") || exit

chapmax=$(zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --cancel-label "Quitter" --entry --text "Stopper à quel chapitre ?   [vous êtes au n°$chap]") || exit
((chapmax++))

while [ $chap != $chapmax ]
do
mkdir $chap
cd $PWD/$chap/

wget "${manga}" -O titre 
grep -A 3 "Chapitre ${chap} :" titre > titre1
grep "http://www.scan-manga.com/lecture-en-ligne" titre1 > titre
sed -i "s@.*http://www.scan-manga.com/lecture-en-ligne@http://www.scan-manga.com/lecture-en-ligne@" titre
sed -i "s@.html.*@.html@" titre
lienp=$(cat titre)

wget ${lienp} -O info
lien=$(grep "#image_lel').attr('src','http://leI" info | cut -d "'" -f6)
grep "var u = new Array;" info > totim
sed -i "s@\"@\n@g" totim 
sed -i "/^var/d ; /;/d" totim

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement du chapitre $chap"

nb_imx=$(wc -l totim | cut -d " " -f1)
((nb_imx++))
nb_im=1
	while [ $nb_im != $nb_imx ]
	do
	im=$(head -n ${nb_im} totim | tail -n 1)
	wget ${lien}${im}
	((nb_im++))
	done

#création du .cbz
rm $PWD/info & rm $PWD/titre & rm $PWD/titre1 & rm $PWD/totim
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
done

#rm $PWD/infochap
echo $chapmax > $PWD/chaplast

#inscrire manga dans liste 'séries' sauf si déjà présent
cd ..
grep ${manga} séries.scan-manga
if [ $? != 0 ]
then
	echo ${manga} >> séries.scan-manga
fi
menu
}
function télécharger_poursuite_scan-manga {
cd $dir

#connaitre chapitre max d'1 manga
#sed -n "/^Vol/p" supprime tout ce qui ne commence pas par "Vol"
chapmax=$(grep -A 5 "${manga}" ../.mangas_scan-manga | sed -n "/^Vol/p" | sed "s@.*Ch @@")
((chapmax++))

chap=$(cat $PWD/chaplast)

#info
notify-send -i /usr/share/pixmaps/boomeranga.svg -t 1000 "Téléchargement de la suite de $dir"

while [ $chap != $chapmax ]
do
mkdir $chap
cd $PWD/$chap/

wget "${manga}" -O titre 
grep -A 3 "Chapitre ${chap} :" titre > titre1
grep "http://www.scan-manga.com/lecture-en-ligne" titre1 > titre
sed -i "s@.*http://www.scan-manga.com/lecture-en-ligne@http://www.scan-manga.com/lecture-en-ligne@" titre
sed -i "s@.html.*@.html@" titre
lienp=$(cat titre)

wget ${lienp} -O info
lien=$(grep "#image_lel').attr('src','http://leI" info | cut -d "'" -f6)
grep "var u = new Array;" info > totim
sed -i "s@\"@\n@g" totim 
sed -i "/^var/d ; /;/d" totim

nb_imx=$(wc -l totim | cut -d " " -f1)
((nb_imx++))
nb_im=1
	while [ $nb_im != $nb_imx ]
	do
	im=$(head -n ${nb_im} totim | tail -n 1)
	wget ${lien}${im}
	((nb_im++))
	done

#création du .cbz
rm $PWD/info & rm $PWD/titre & rm $PWD/titre1 & rm $PWD/totim
zip -r $chap.cbz .
mv $chap.cbz ..
cd ..
rm -r $PWD/$chap
#échec

#conversion pdf
[[ ${pdf} = "o" ]] && ebook-convert $chap.cbz $chap.pdf --right2left | zenity --title "boomeranga!" --progress --text "Création de $manga $chap.pdf" --auto-close --auto-kill
#échec

#changement de chapitre
((chap++))
done

#rm $PWD/infochap
echo $chapmax > $PWD/chaplast

cd ..
}

### annuaires ###
annuaire() {
test -f $PWD/.mangas2
if [ $? = 1 ]
then
zenity --question --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Lors du premier lancement cette option prend 2-3 minutes, l'exécuter ?" || menu
(nb_page=$(wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=1" | sed -n "/pagination/ s@.*>\([0-9]*\)</a>  ).*@\1@p")
for i in $(seq ${nb_page})
do
  wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=${i}" | grep -A 7 "tr onmouseover" | sed "s@^[[:space:]]*@@ ; s@</a>.*@@ ; s@<td class=\"td\">@@ ; s@</td>@@ ; /tr onmouseover\|<table class\|<td>\|--/d ; s@>@\n@ ; s@<a href=\"manga/@@ ; s@/\" class=\"infoImages\"@@"
done > .mangas
sed "s@<a href=@--@ ; /--/d ; /fois/d" .mangas > .mangas2
imax=$(wc -l .mangas2 | awk '{print $1}') ; let imax=imax/3 # détermine nb lignes
j=4
for (( i=1 ; i < $imax ; i=i+2 ))
do
# awk -v permet d'ajouter variable, print $NF = dernier mot
type=$(cat .mangas2 | grep "(" | awk -v i=$i 'NR == i {print;}' | awk '{print $NF}')
# insère le $type à la ligne j
sed -i "${j}i$type" .mangas2
let j=j+7
done
#supprime ( en début de ligne, ) en fin et (...
sed -i "s@^(@@ ; s@)\$@@ ; s@(.*@@" .mangas2
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Récupération des données"
fi
manga=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Veuillez choisir une série" --width "1200" --height "400" --hide-column="1" --column="Référence" --column="Nom du manga" --column="Genre" --column="Type" --column="Note" --column="Nb chap." --column="Dernier paru" < $PWD/.mangas2) || menu
#initialisation variable annuaire
an=1
télécharger
}
annuaire_mfox() {
test -f $PWD/.mangas_mfox
if [ $? = 1 ]
then
zenity --question --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Lors du premier lancement cette option prend environ 5 minutes, l'exécuter ?" || menu
(
nb_page=300 #préciser nb pages par recherche sed
for i in $(seq ${nb_page})
do
  wget -U=firefox -qO - "http://mangafox.me/directory/${i}.htm" | grep -A 4 "<div class=\"manga_text\">" | sed "s@^[[:space:]]*@@ ; /<div class=\"manga_text\">/d ; s@^<a class=\"title\" href=\"http://mangafox.me/manga/@@ ; 
  s@^<p class=\"info\" title=\"@@ ; s@/\" rel=\"[0-9]*\">@\n@ ; s@^.*\"rate\">@@ ; s@<p class=\"info\"><label>@@ ; s@.*</label> @@ ; s@\">.*@@ ; s@</a>@@ ; s@</span>@@ ; s@</p>@@ ; /--/d"
done > .mangas_mfox
#correction erreur sur 1 ligne
sed -i "s@ - &quot.*@@" .mangas_mfox
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Récupération des données"
fi
manga=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Veuillez choisir une série" --width "1200" --height "400" --hide-column="1" --column="Référence" --column="Nom du manga" --column="Note" --column="Genre" --column="Visites" < $PWD/.mangas_mfox) || menu
#initialisation variable annuaire
an=1
télécharger_mangafox
}
annuaire_scan-manga() {
test -f $PWD/.mangas_scan-manga
if [ $? = 1 ]
then
(
wget -qO - http://www.scan-manga.com/scanlation/liste_des_mangas.html | grep "<div class=\"texte_lettre\">" -A 15 > .mangas_scan-manga
sed -i "/<div class=\"texte_lettre/d ; /<div class=\"texte_manga book_open\">/d ; s@<span class=\"hover_text_manga\"@\n@ 
s@<h3><a class=\"texte_manga\" href=\"@@ ; /<div class=\"texte_note\">/d ; s@<div class=\"texte_genre\"><span>@@ ; s@^>@@ ; s@</span></a></h3>@@ ; 
/<div class='/d ; /^<span/d ; /^\"display/d ; s@.*average\"@@ ; s@^>@@ ; s@</span> <span style=@@ ; s@<div class=\"texte_statut\"><span>@@ ; 
s@.*texte_der_chpt\">@@ ; s@</div>@--@" .mangas_scan-manga
sed -i "s@^ rel=\"[0-9]*\"@@ ; s@</a> le @\n@ ; /<div/d ; s@\">@@ ; s@^>@@ ; s@</span>--@@ ; /--/d" .mangas_scan-manga
#résolution accents
sed -i "s@&#224;@à@ ; s@&#226;@â@ ; s@&#233;@é@ ; s@&#234;@ê@ ; s@&#232;@è@ ; s@&#244;@ô@ ; s@&#235;@ë@ ; s@&#212;@Ô@ ; 
s@&#251;@û@ ; s@&#8217;@'@ ; s@&#239;@ï@ ; s@amp;@@ ; s@&#228;@ä@ ; s@&#201;@E@" .mangas_scan-manga
#màj
sed -i "s@<span class.*@@ ; s@</a> @\n@" .mangas_scan-manga
#correction temp
sed -i "s@Junketsu + Kareshi@Junketsu + Kareshi\n@ ; s@Watashi no + Okusuri@Watashi no + Okusuri\n@" .mangas_scan-manga
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Récupération des données"
fi
manga=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Veuillez choisir une série" --width "1000" --height "400" --hide-column="1" --column="Référence" --column="Nom du manga" --column="Genre" --column="Note" --column="Statut" --column="Dernier chapitre" --column="Dernière màj" < $PWD/.mangas_scan-manga) || menu
dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
telecharger_scan-manga
}
#################

### init ###
dep() {
cd $HOME/.boomeranga/
(for (( i=0 ; i < ${#paquet[*]} ; i++ ))
do
#recherche paquets non installés et les inscrit en supprimant le retour à la ligne
[[ $(aptitude show ${paquet[i]} | grep "État: non installé") ]] && echo "${paquet[i]} " | tr -d "\n" >> dépendances
done) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Vérification des dépendances"
test -f $PWD/dépendances
if [ $? = 0 ]
then
	zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --info --text "Les dépendances suivantes sont nécessaires pour le bon 
	fonctionnement de boomeranga! :

	<b>$(cat dépendances)</b>

	Il est conseillé de les installer avant de redémarrer le script."
	exit
else
	zenity --info --ok-label "Go!" --timeout "2" --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Toutes les dépendances
sont satisfaites"
fi
}
function ch() {
ch=$(cat $HOME/.boomeranga/ch)
mkdir -p $ch/
cd $ch
}
#vérification présence fichiers 'séries' et création si besoin
function séries {
test -f $PWD/séries
if [ $? = 1 ]
then
	> séries
fi
test -f $PWD/séries.mfox
if [ $? = 1 ]
then
	> séries.mfox
fi
test -f $PWD/séries.scan-manga
if [ $? = 1 ]
then
	> séries.scan-manga
fi
}
liste_manga() {
#récupération liste manga lel.com pour 404 / _new pour conserver ancien tant que nouveau incomplet
nb_page=$(wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=1" | sed -n "/pagination/ s@.*>\([0-9]*\)</a>  ).*@\1@p")
for i in $(seq ${nb_page})
do
  wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=${i}" | grep -A 7 "tr onmouseover" | sed "s@^[[:space:]]*@@ ; s@Ch.*@@ ; /td class=/d ; /--/d ; /<td>/d ; /<tr onmouseover/d ; /<table class/d"
done > .404_new
mv .404_new .404
}
############

### options ###
function ch_maj {
ch_tmp=$(zenity --file-selection --window-icon "/usr/share/pixmaps/boomeranga.svg" --title "Choisir le dossier des téléchargements boomeranga!" --directory)
echo $ch_tmp/boomeranga > $HOME/.boomeranga/ch_new
ch=$(cat $HOME/.boomeranga/ch)
ch_new=$(cat $HOME/.boomeranga/ch_new)
mv $ch $ch_new
mv $HOME/.boomeranga/ch_new $HOME/.boomeranga/ch
zenity --info --ok-label "bye!" --timeout "5" --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Merci de redémarrer boomeranga! pour que les
changements soient effectifs" & exit
}
function convert_pdf {
pdf=$(zenity --list --checklist --cancel-label "Quitter" --title "boomeranga!" --text "Convertir en .pdf ?" --column=option --column=description 1 "activer conversion pdf") || menu
case "${pdf}" in
"") pdf=""
;;
esac

if [[ -z $pdf ]]
then pdf="n"
else pdf="o"
fi
}
simple_convert() {
zenity --info --title="Conversion .cbz vers .pdf" --text="1. Choisir fichier source
2. Choisir fichier cible"

fichier1=`zenity --file-selection --title="Sélectionnez un fichier"`
fichier2=`zenity --file-selection --save`

ebook-convert $fichier1 $fichier2 --right2left | zenity --progress --text "Conversion en cours" --auto-close --auto-kill

zenity --info --title="Info" --text="Conversion de <b>$fichier1</b> terminée"
}
#à vérif. pour activ.
échec() {
while [ ${?} -ne 0 ]
do
	zenity --title "boomeranga!" --info --text "Echec de l'opération - retour au menu"
	menu
done
}
#fonctions annuaire général permettant de voir quel site est le plus avancé pour une série
gb_lel() {
nb_page=$(wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=1" | sed -n "/pagination/ s@.*>\([0-9]*\)</a>  ).*@\1@p")
for i in $(seq ${nb_page})
do
wget -qO - "http://www.lecture-en-ligne.com/index.php?page=liste&ordre=titre&p=${i}" | grep -A 7 "tr onmouseover" | grep -A 6 -i "manga/.*${manga}" | sed "s@<td class=\"td\"><a href=\"manga/@@ ; 
s@/\" class=\"infoImages\">@\n@ ; s@</a></td>@@ ; /<tr onmouseover/d ; /<td class/d ; s@.*Ch. @@ ; s@</a>.*@@ ; /<td>/d ; /--/d ; s@^[[:space:]]*@@ ; s@N/A.*@0@"
done > .mangas
#correction temp
sed -i "s@no Aneki@no Aneki\n@" .mangas
imax=$(($(wc -l .mangas | awk '{print$1}') * 2))
for (( i=3 ; i < $imax ; i=i+4 ))
do
sed -i "$i s@\$@\nLEL@" .mangas
done
}
gb_scm() {
wget -qO - http://www.scan-manga.com/scanlation/liste_des_mangas.html | grep -A 12 "\"><span class=\"hover_text_manga"  | grep -A 1 -i ">.*${manga}" > .mangas_scan-manga 
sed -i "/<div class=\"texte_lettre\">/d ; /<div class=\"texte_manga book_close\">/d ; s@<h3><a class=\"texte_manga\" href=\"@@ ; 
s@\"><span class=\"hover_text_manga\" rel=\"[0-9]*\">@\n@ ; s@</span></a></h3>@@ ; /<div class=\"texte_genre/d ; /<div class=\"texte_note/d ; 
/<div class='bl_vote/d ; /<div class='sub/d ; /.*\"display:none/d ; /<div class=\"texte_statut/d ; s@.*class=\"texte_der_chpt\">@@ ; s@</a>.*@@ ; 
/.*div.*/d ; /--/d" .mangas_scan-manga
#résolution accents
sed -i "s@&#224;@à@ ; s@&#226;@â@ ; s@&#233;@é@ ; s@&#234;@ê@ ; s@&#232;@è@ ; s@&#244;@ô@ ; s@&#235;@ë@ ; s@&#212;@Ô@ ; 
s@&#251;@û@ ; s@&#8217;@'@ ; s@&#239;@ï@ ; s@amp;@@ ; s@&#228;@ä@ ; s@&#201;@E@" .mangas_scan-manga
#màj
sed -i "s@<span class.*@@ ; s@</a> @\n@" .mangas_scan-manga
#correction temp
sed -i "s@Junketsu + Kareshi@Junketsu + Kareshi\n@ ; s@Watashi no + Okusuri@Watashi no + Okusuri\n@" .mangas_scan-manga
sed -i "s@Hô&#244; @@" .mangas_scan-manga
#suppression lignes
sed -i "1549d" .mangas_scan-manga
sed -i "3733d" .mangas_scan-manga
#formatage
sed -i "s@Vol [0-9]* @@" .mangas_scan-manga
sed -i "s@^Ch @@" .mangas_scan-manga
imax=$(($(wc -l .mangas_scan-manga | awk '{print$1}') * 2))
for (( i=3 ; i < $imax ; i=i+4 ))
do
sed -i "$i s@\$@\nSCM@" .mangas_scan-manga
done
}
gb_mfx() {
nb_page=300 #préciser nb pages par recherche sed
for i in $(seq ${nb_page})
do
wget -U=firefox -qO - "http://mangafox.me/directory/${i}.htm" | grep -A 4 "<div class=\"manga_text\">" | grep -A 2 -i "${manga}" | sed "s@^[[:space:]]*@@ ; /<div class=\"manga_text\">/d ; 
s@^<a class=\"title\" href=\"http://mangafox.me/manga/@@ ; s@/\" rel=\"[0-9]*\">@\n@ ; s@</a>@@ ; /.*class.*/d ; /--/d"
done > .mangas_mfox
#correction erreur sur 1 ligne
sed -i "s@ - &quot.*@@" .mangas_mfox
#ajouter nb chap.
imax=$(($(wc -l .mangas_mfox | awk '{print$1}') * 2))
for (( i=1 ; i < $imax ; i=i+3 ))
do
manga=$(head -n $i .mangas_mfox | tail -n 1)
chap_man=$(wget -U=firefox -qO - "http://mangafox.me/manga/${manga}/" | grep -A 1 "Chapters</h2><hr/>" | grep "Chapter " | sed "s@.*Chapter@@ ; s@.* - @@ ; s@</span></h3></div><ul class=\"chlist\" style=\"display:block\">@@")
((i++))
sed -i "$i s@\$@\n$chap_man@" .mangas_mfox
((i--))
done
#formatage
for (( i=3 ; i < $imax ; i=i+4 ))
do
sed -i "$i s@\$@\nMFX@" .mangas_mfox
done
sed -i "s@^[[:space:]]*@@" .mangas_mfox
}
gb() {
manga=`zenity --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --entry --cancel-label "Quitter" --text "Le titre du manga contient :"` || menu
(gb_lel
gb_scm
gb_mfx
cp .mangas .gb
cat .mangas_scan-manga >> .gb
cat .mangas_mfox >> .gb
) | zenity --progress --pulsate --auto-close --no-cancel --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Recherche en cours"
choix=$(zenity --list --multiple --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Double-clic sur une série" --width "600" --height "400" --hide-column="1" --print-column="1,4" --column="Référence" --column="Nom du manga" --column="Dernier paru" --column="Site" < $PWD/.gb)
manga=$(echo ${choix} | cut -d "|" -f 1)
site=$(echo ${choix} | cut -d "|" -f 2)
#nettoyage
nettoyage_annuaires
gb=1
if [[ ${site} = "LEL" ]]
then télécharger
elif [[ ${site} = "MFX" ]]
then télécharger_mangafox
elif [[ ${site} = "SCM" ]]
then 
	dir=$(echo ${manga} | cut -d "/" -f5 | cut -d "." -f1)
	telecharger_scan-manga
fi
}
###############

### stop ###
nettoyage_annuaires() {
[[ -f $PWD/.mangas ]] && mv -f $PWD/.mangas $HOME/.local/share/Trash/files
[[ -f $PWD/.mangas2 ]] && mv -f $PWD/.mangas2 $HOME/.local/share/Trash/files
[[ -f $PWD/.mangas_mfox ]] && mv -f $PWD/.mangas_mfox $HOME/.local/share/Trash/files
[[ -f $PWD/.mangas_scan-manga ]] && mv -f $PWD/.mangas_scan-manga $HOME/.local/share/Trash/files
}
bye() {
cd ${ch}
nettoyage_annuaires
mv $PWD/wget* $HOME/.local/share/Trash/files
exit
}
############

### menus ###
function menu {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "450" --cancel-label "Quitter" --title "boomeranga!" --text "Menu principal" --column=option --column=description 0 "Rechercher un manga" 0 "Poursuivre toutes les séries" 1 "===== Menus dédiés =====" \
2 "lecture-en-ligne.com" 3 "mangafox.me" 4 "scan-manga.com" 5 "======= Options ========" 6 "Modifier le chemin de boomeranga!" 7 "Modifier préférences de conversion" 8 "======== Extra =========" 9 "Convertir .cbz en .pdf" 10 "Demander une fonctionnalité" 11 "Site du projet") || bye
case "${option}" in
0) gb
;;
0) poursuite_all
;;
1) echo "y'a rien ici :p" && menu
;;
2) menu_lecture-en-ligne.com
;;
3) menu_mangafox.me
;;
4) menu_scan-manga.com
;;
5) echo "y'a rien ici :p" && menu
;;
6) ch_maj && menu
;;
7) convert_pdf
;;
8) echo "y'a rien ici :p" && menu
;;
9) simple_convert && menu
;;
10) xdg-open 'http://forum.ubuntu-fr.org/viewtopic.php?id=1282211' & menu
;;
11) xdg-open 'http://blog.goupil.eu/?boomeranga' & menu
;;
esac
}
function menu_lecture-en-ligne.com() {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "225" --cancel-label "Retour" --title "boomeranga!" --text "Menu lecture-en-ligne.com" --column=option --column=description 1 "Télécharger mangas" 2 "Voir/Modifier liste de suivi" \
3 "Annuaire mangas") || menu
case "${option}" in
1) télécharger
;;
2) zenity --text-info --editable --cancel-label "Quitter" --filename "$ch/séries" > $ch/séries_maj &&
mv $PWD/séries $HOME/.local/share/Trash/files && mv $PWD/séries_maj $PWD/séries && menu_lecture-en-ligne.com || menu
;;
3) annuaire
;;
esac
}
function menu_mangafox.me() {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "225" --cancel-label "Retour" --title "boomeranga!" --text "Menu mangafox.me" --column=option --column=description 1 "Télécharger mangas" 2 "Voir/Modifier liste de suivi" \
3 "Annuaire mangas") || menu
case "${option}" in
1) télécharger_mangafox
;;
2) zenity --text-info --editable --cancel-label "Retour" --filename "$ch/séries.mfox" > $ch/séries.mfox_maj &&
mv $PWD/séries.mfox $HOME/.local/share/Trash/files && mv $PWD/séries.mfox_maj $PWD/séries.mfox && menu_mangafox.me || menu_mangafox.me
;;
3) annuaire_mfox
;;
esac
}
function menu_scan-manga.com() {
option=$(zenity --list --window-icon "/usr/share/pixmaps/boomeranga.svg" --width "350" --height "200" --cancel-label "Retour" --title "boomeranga!" --text "Menu scan-manga.com" --column=option --column=description 1 "Annuaire mangas" \
2 "Voir/Modifier liste de suivi") || menu
case "${option}" in
1) annuaire_scan-manga
;;
2) zenity --text-info --width "500" --height "300" --editable --cancel-label "Retour" --filename "$ch/séries.scan-manga" > $ch/séries.scan-manga_maj &&
mv $PWD/séries.scan-manga $HOME/.local/share/Trash/files && mv $PWD/séries.scan-manga_maj $PWD/séries.scan-manga && menu_scan-manga.com || menu_scan-manga.com
;;
esac
}
#############

#### lancement boomeranga! ####

zenity --progress --pulsate --timeout "8" --no-cancel --auto-close --title "boomeranga" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "Chargement informations" &
nb=$(wget -qO - http://www.lecture-en-ligne.com/ | grep -A 1 "<td class=\"count1\">Mangas :</td>" | sed "/Mangas/d ; s@<td class=\"count3\">@@ ; s@</td>@@")
nb_mfox=$(wget -U=firefox -qO - "http://mangafox.me/manga/#idx_#" | grep "<li><a href=\"http://mangafox.me/manga/" | wc -l)
nb_scanman=$(wget -qO - http://www.scan-manga.com/ | grep "Nombre de mangas :" | sed "s@.* : @@ ; s@<br>@@")

#### intro ####
zenity --info --ok-label "Go!" --title "boomeranga! v$v" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "<b>boomeranga!</b> vous permet de télécharger 
des planches de manga depuis :

   * lecture-en-ligne.com : <b>${nb} titres</b>
   * mangafox.me : 					        <b>${nb_mfox} titres</b>
   * scan-manga.com :                                                      <b>${nb_scanman} titres</b>

Bonne lecture!"

#vérif au premier lancement : création chemin boomeranga + dépendances
test -f $HOME/.boomeranga/ch
if [ $? = 1 ]
then
	mkdir -p $HOME/.boomeranga
	ch_tmp=$(zenity --file-selection --window-icon "/usr/share/pixmaps/boomeranga.svg" --title "Choisir le dossier des téléchargements boomeranga!" --directory)
	echo $ch_tmp/boomeranga > $HOME/.boomeranga/ch
	dep
fi

#info màj
cd $HOME/.boomeranga/
wget http://goupil.eu/repo/boomeranga_version -O version
v2=$(head -n 1 $HOME/.boomeranga/version)
[ $v = $v2 ] || zenity --info --ok-label "Ok" --timeout "2" --title "boomeranga!" --window-icon "/usr/share/pixmaps/boomeranga.svg" --text "La version $v2 est disponible"

#
ch
liste_manga &
séries
menu

@Hizoka : ce serait peut-être bien de changer le nom de ta version afin qu'il n'y ait pas de confusion ?

Hors ligne

#108 Le 23/06/2013, à 21:06

Hizoka

Re : boomeranga! pour les amateurs de mangas

J'étais pas parti pour faire un fork mais bon...
je cherche une idée de nom sympa...

Pour le moment j'en suis à Top Manga avec pour icone une Taupe tongue

Vous savez pas ou je pourrais chopper des icones de taupes gratos et de preference libres ?


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#109 Le 23/06/2013, à 21:43

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Très belle présentation Hizoka, j'aime beaucoup ce projet.
Je regrette je ne sais pas où tu pourrais trouver ça.
Et puis une taupe comme icône ?
J'aurais vu un animal qui représente plus le Japon, genre un panda, ou tu sais le chat de la fortune avec la patte qui bouge, c'est pas mal ca tongue mdr
Enfin ce n'est que mon avis smile


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#110 Le 23/06/2013, à 22:05

Hizoka

Re : boomeranga! pour les amateurs de mangas

ouais la je suis sur : MangaPanda avec un panda en icone qui lit un manga.
je look un peu ce que je peux trouver


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#111 Le 23/06/2013, à 22:50

Hizoka

Re : boomeranga! pour les amateurs de mangas

Bon, voila donc ma version de Boomeranga, MangaPanda!

mangapanda.png

Pour tester : http://hizo.fr/linux/mangapanda/mangapanda.tar.gz

Pour info, il récupère les listes depuis mon serveur (qui les met à jour régulièrement), ca fait gagner beaucoup de temps.

PS : je peux squatter ce topic ?

Dernière modification par Hizoka (Le 23/06/2013, à 23:07)


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#112 Le 24/06/2013, à 00:07

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Super je vais tester ce MangaPanda big_smile
Je vous propose d'ajouter ce site : http://www.anime-story.com

Dernière modification par Sink-soul (Le 24/06/2013, à 00:57)


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#113 Le 24/06/2013, à 19:11

Hizoka

Re : boomeranga! pour les amateurs de mangas

c'est presque fait smile

Sinon, des retours ?


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#114 Le 24/06/2013, à 21:32

Hizoka

Re : boomeranga! pour les amateurs de mangas

Bon bah voila la nouvelle version qui prend en compte anime-story.

http://hizo.fr/linux/mangapanda/mangapanda.tar.gz


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#115 Le 25/06/2013, à 11:16

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Bah écoute ça marche niquel.
Ça télécharge correctement, pas de problèmes rencontrés.
Il manque une fonction de recherche de mangas par mot clé selon moi smile
Et un onglet "mes mangas" ? Pour voir les séries qu'on a téléchargé, cliquer sur un manga qu'on a pour mettre à jour la série directement ?

Dernière modification par Sink-soul (Le 25/06/2013, à 12:23)


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#116 Le 25/06/2013, à 14:23

Hizoka

Re : boomeranga! pour les amateurs de mangas

J'ai vu qu'il y avait quelques soucis avec certains mangas au niveau de la récupération d'infos, je vais ameliorer le truc mais c'est assez compliqué.

la fonction de recherche existe plus ou moins, un clic sur la liste et on tape ses lettre ou on fait ctrl + f, mais il faut connaitre le debut du nom.
mais je peux toujours ajouter une fonction de recherche...

Pour l'onglet mes mangas, j'y pense deja, mais je vois pas encore comment je vais m'y prendre, en scannant le dossier des mangas ou un systeme de sauvegarder via un bouton favori...

je pensais aussi ajouter un lien vers les pages que je scanne afin qu'en cas de manque d'info ou de chapitre, on puisse verifier que ca vient du site ou non.

Donc ca va continuer de s'ameliorer smile


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#117 Le 26/06/2013, à 15:14

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Ah oui d'accord, mais une fonction rechercher serait vraiment bien je trouve.
Pour l'onglet mes mangas, je pense que oui le mieux c'est de scanner un dossier choisi.


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#118 Le 26/06/2013, à 15:33

Hizoka

Re : boomeranga! pour les amateurs de mangas

Je taf bcp dessus la.

Car vu que tout depend du travail de codage des sites, il y a pein de trucs qui passent mal, du coup j'ai grandement amelioré mes commandes de scans des infos et des chapitres.

Le soucis en se limitant a scanner un dosier de manga, c'est que je ne sais pas sur quel site ca a ete dl...
et du coup ca donne une sorte de "manga recemment telechargé"...
il faut pluto ajouter une option pour conserver en memoire ce manga ci ou ce manga la...


Mais bon j'ai changé pas mal de code, amelioré les systeme de listages des mangas (fait via mon serveur ou vous a votre demande).

je continue tout ça tongue


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#119 Le 26/06/2013, à 18:29

Hizoka

Re : boomeranga! pour les amateurs de mangas

Plutot bien avancé smile

Systeme de suivi ok
systeme de recherche ok

je continue d'essayé d'améliorer le code smile

EDIT : quelques soucis avec le scan des listes...

Dernière modification par Hizoka (Le 26/06/2013, à 19:03)


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#120 Le 26/06/2013, à 19:06

Sink-soul

Re : boomeranga! pour les amateurs de mangas

C'est vraiment très bien, tu te débrouilles super bien.
C'est vrai que la seule contrainte c'est le code des sites et leurs contenus.
En tout cas très bon travail wink


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#121 Le 26/06/2013, à 19:39

Hizoka

Re : boomeranga! pour les amateurs de mangas

bon bah c'est good.

http://hizo.fr/linux/mangapanda/mangapanda.tar.gz

Bah comme quoi se prendre un lapin ca peut servir à d'autres tongue

La vrai galere c'est tous les caracters speciaux...
j'ai fait un sed de + de 200 lignes mais je continue a avoir des soucis avec...

Du coup j'attends vos retour, signalez moi tout bug ou soucis.
Et des idées si besoin...

Sinon je suis toujours sur mon sed de 250 lignes pour les caracteres.

et la  prochaine etape c'est la creation d'un depot

2 nouvelles photos :
http://hizo.fr/linux/mangapanda/06.png
http://hizo.fr/linux/mangapanda/07.png

Dernière modification par Hizoka (Le 27/06/2013, à 02:03)


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#122 Le 28/06/2013, à 00:31

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Salut
Du coup j'ai réfléchi, et j'ai pensé, pourquoi ne pas aller encore plus loin que dans le téléchargement des scans ?
Je propose donc, si c'est possible, d'étendre le logiciel aux téléchargement de vidéos et musiques (des épisodes d'anim de manga et des opening et ending des anims).

Pour les openings et endings, j'ai trouvé ce site qui m'a l'air très complet : http://gendou.com/amusic/
Pour les vidéos, http://www.sky-animes.com/index.php?fil … orie&cat=8 et http://www.univers-anime.com/

Vu la tournure du projet, je pense qu'il mérite effectivement son propre post wink

Voilà smile

Dernière modification par Sink-soul (Le 28/06/2013, à 00:32)


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne

#123 Le 28/06/2013, à 06:49

ljere

Re : boomeranga! pour les amateurs de mangas

hizoka tu devrais le porter en python ça pourrait être moins lourd à gérer et surtout éviter d'avoir des sed monumentales


ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon

Hors ligne

#124 Le 28/06/2013, à 16:50

Hizoka

Re : boomeranga! pour les amateurs de mangas

Sink-soul => sur le principe c'est faisable mais ca s'eloigne vachement du principe de base quand meme...

ljere => je ne sais pas coder en python sinon je l'aurais fait direct smile


KDE Neon 64bits
Tous mes softs (MKVExtractorQt, HizoSelect, HizoProgress, Qtesseract, Keneric, Services menus...) sont sur github

Hors ligne

#125 Le 28/06/2013, à 20:09

Sink-soul

Re : boomeranga! pour les amateurs de mangas

Oui j'avoue...c'était une tite idée comme ça ^^


Voyager 13.10 sur HP-DV7
avec Windows 7 en Dual Boot

Hors ligne