diff --git a/website/download.php b/website/download.php
index e4011a9..778ea65 100644
--- a/website/download.php
+++ b/website/download.php
@@ -31,18 +31,19 @@ include( '_head.php' );
// print '[Erreur] pas de commande youtube-dl installée sur ce serveur';
// } else {
- $uniqid = time();
+ $uniqid = date('Y-M-d_').time();
// # exemple url https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
- exec( './youtube-dl.sh uniqueid_facho https://peertube.cipherbliss.com/videos/watch/b88a9568-517c-4a49-ab07-75c79323a825', $output, $result );
-// exec( '.'.$old . '/test.sh ' . $uniqid . ' ' . $url, $output, $result );
+// exec( './youtube-dl.sh uniqueid_facho https://peertube.cipherbliss.com/videos/watch/b88a9568-517c-4a49-ab07-75c79323a825', $output, $result );
+ exec( './youtube-dl.sh ' . $uniqid . ' ' . $url, $output, $result );
echo "
résultat du script.
";
var_dump( $result );
echo "
sortie du script.
";
var_dump( $output );
+
if ( $result ) {
echo( '
problème de script
' );
include( '_foot.php' );
@@ -64,7 +65,7 @@ include( '_head.php' );
echo "
pas d'url envoyée. Vérifiez le formulaire. Retour";
}
- exec( './youtube-dl.sh canadien https://www.youtube.com/watch?v=w97pAEr3svc', $output, $result );
+// exec( './youtube-dl.sh canadien https://www.youtube.com/watch?v=w97pAEr3svc', $output, $result );
?>
diff --git a/info.php b/website/info.php
similarity index 100%
rename from info.php
rename to website/info.php
diff --git a/website/youtube-dl.sh b/website/youtube-dl.sh
index f9ffa54..3d7b446 100755
--- a/website/youtube-dl.sh
+++ b/website/youtube-dl.sh
@@ -1,5 +1,6 @@
#!/bin/bash
-
+touch log_ydl.txt
+echo " $(date) ###### start conversion __ $1 __ $2" >> log_ydl.txt
UNIQID=$1
mkdir -p ../input/ydl
@@ -7,16 +8,20 @@ rm -rf ../input/ydl/$UNIQID.mp3
rm -rf ../input/ydl/$UNIQID
URL=$2
-OUTPUT="../input/ydl/$UNIQID.mp3"
-
-youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --output $OUTPUT $URL
+OUTPUT="../input/ydl/$UNIQID/base.mp3"
mkdir ../input/ydl/$UNIQID
-ffmpeg -i "../input/ydl/$UNIQID.mp3" -ac 1 "../input/ydl/$UNIQID/$UNIQID.wav"
+youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --output $OUTPUT $URL
+
+ffmpeg -i "../input/ydl/$UNIQID/base.mp3" -ac 1 "../input/ydl/$UNIQID/mono_canal.wav"
cd ..
OUT_DIR="input/ydl/$UNIQID"
-python3 ./conversion_simple_fr.py "input/ydl/$UNIQID/$UNIQID.wav" > $OUT_DIR/0_output_$FILE_NAME.json
+python3 ./conversion_simple_fr.py $OUT_DIR/mono_canal.wav > $OUT_DIR/0_output_$FILE_NAME.json
jq .text $OUT_DIR/0_output_$FILE_NAME.json > $OUT_DIR/1_converted_$FILE_NAME.txt
sed 's/null//g' $OUT_DIR/1_converted_$FILE_NAME.txt > $OUT_DIR/2_without_nulls_$FILE_NAME.txt
sed 's/^ *//; s/ *$//; /^$/d' $OUT_DIR/2_without_nulls_$FILE_NAME.txt > $OUT_DIR/3_without_nulls_$FILE_NAME.txt
sed 's/\"//g' $OUT_DIR/3_without_nulls_$FILE_NAME.txt > $OUT_DIR/4_phrases_$FILE_NAME.txt
+
+ls -l $OUT_DIR >> log_ydl.txt
+echo " $(date) ###### end conversion __ $1 __ $2" >> log_ydl.txt
+