#!/bin/bash wget $1 -qO webpage.html starturl=$(grep -Poe "https://musescore.com/static/musescore/scoredata/gen/[^?@&]+(\?|@|&)" webpage.html | head -1 | sed -e 's#/[^/]*$##') echo "Téléchargement à l'addresse : $starturl" rm webpage.html download () { i=0 local imgext=$1 echo "Test du téléchargement en $imgext" while (wget -q "$starturl/score_$i.$imgext" -O "score_$i.$imgext") do echo "Convertion de la page $i en pdf" inkscape "score_$i.$imgext" --export-pdf="score_$i.pdf" --without-gui if [ $i = 0 ] then cp "score_0.pdf" "out.pdf" else pdfunite "out.pdf" "score_$i.pdf" "tout.pdf" cp "tout.pdf" "out.pdf" rm "tout.pdf" fi rm "score_$i.pdf" let "i++" done } download "svg" if [ $i = 0 ] then echo "J'y suis pas arrivé" echo "Test du téléchargement en png" download "png" fi echo "Tadaaa, ca fait $i pages!"