From b237f6b4da3a9931c541beb5f0d27dd54bb8bfe4 Mon Sep 17 00:00:00 2001 From: Mysaa Date: Fri, 21 May 2021 21:36:37 +0200 Subject: [PATCH] =?UTF-8?q?Premier=20commit=20-=20Inclusion=20dans=20le=20?= =?UTF-8?q?syst=C3=A8me=20git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ fuckYouMusescore | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .gitignore create mode 100755 fuckYouMusescore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2bdf59b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +score_*.png +score_*.svg +*.pdf diff --git a/fuckYouMusescore b/fuckYouMusescore new file mode 100755 index 0000000..3fc6e68 --- /dev/null +++ b/fuckYouMusescore @@ -0,0 +1,37 @@ +#!/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!" +