Browse Source

up scripts

master
Kayn Ty 1 year ago
parent
commit
4ed0bcb786
  1. 2
      conversion_simple_fr.py
  2. 7
      log_ydl.txt
  3. 8
      website/log_ydl.txt
  4. 34
      website/youtube-dl.sh

2
conversion_simple_fr.py

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
from vosk import Model, KaldiRecognizer, SetLogLevel
import sys

7
log_ydl.txt

@ -1,7 +0,0 @@
total 0
-rw-rw-r-- 1 tykayn tykayn 0 mars 27 10:27 0_output_.json
-rw-rw-r-- 1 tykayn tykayn 0 mars 27 10:27 1_converted_.txt
-rw-rw-r-- 1 tykayn tykayn 0 mars 27 10:27 2_without_nulls_.txt
-rw-rw-r-- 1 tykayn tykayn 0 mars 27 10:27 3_without_nulls_.txt
-rw-rw-r-- 1 tykayn tykayn 0 mars 27 10:27 4_phrases_.txt
sam. 27 mars 2021 10:27:22 CET ###### end conversion __ essai __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d

8
website/log_ydl.txt

@ -1,2 +1,10 @@
sam. 27 mars 2021 10:27:21 CET ###### start conversion __ essai __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
sam. 27 mars 2021 10:30:16 CET ###### start conversion __ essai __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
Sat Mar 27 13:50:27 CET 2021 ###### start conversion __ essai.wav __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
Sat Mar 27 14:00:20 CET 2021 ###### start conversion __ essai.wav __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
Sat Mar 27 14:02:25 CET 2021 ###### start conversion __ essai __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
Sat Mar 27 14:03:13 CET 2021 ###### start conversion __ essai __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
Sat Mar 27 14:03:52 CET 2021 ###### start conversion __ essai __ https://peertube.cipherbliss.com/videos/watch/e6a37508-042e-4d83-8598-5d36b764bb3d
Sat Mar 27 14:23:15 CET 2021 ###### start conversion __ batman_script __ https://peertube.cipherbliss.com/videos/watch/193545b2-3cd5-468a-b563-e17d0121e1bf
Sat Mar 27 14:23:18 CET 2021 ###### end conversion __ batman_script __ https://peertube.cipherbliss.com/videos/watch/193545b2-3cd5-468a-b563-e17d0121e1bf
Sat Mar 27 14:24:10 CET 2021 ###### start conversion __ batman_script __ https://peertube.cipherbliss.com/videos/watch/193545b2-3cd5-468a-b563-e17d0121e1bf

34
website/youtube-dl.sh

@ -3,24 +3,38 @@ touch log_ydl.txt
echo " $(date) ###### start conversion __ $1 __ $2" >> log_ydl.txt
UNIQID=$1
mkdir -p ../input/ydl
rm -rf ../input/ydl/$UNIQID.mp3
rm -rf ../input/ydl/$UNIQID
# mkdir -p ../input/ydl
# rm -rf ../input/ydl/$UNIQID.mp3
# rm -rf ../input/ydl/$UNIQID
URL=$2
OUTPUT="../input/ydl/$UNIQID/base.mp3"
echo " \n output : \n"
echo $OUTPUT
mkdir ../input/ydl/$UNIQID
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --output $OUTPUT $URL
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --output $OUTPUT $URL --no-continue
ls -larth ../input/ydl/$UNIQID
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 $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
mkdir $OUT_DIR
echo " $(date) ###### lancer la transcription"
pwd
ls -larth input/ydl/$UNIQID/
echo "\n"
cd ..
bash transcript.sh input/ydl/$UNIQID/mono_canal.wav
#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

Loading…
Cancel
Save