Back

JDIC sound files

#13
brandon7s Wrote:
Pauline Wrote:Usage
1) Create a file with two columns: kana kanji (use space or tab between them)
2) Run ./script.sh < file.txt
3) Check log.txt for failed downloads
Does your script with work Cygwin, do you know? If so, that'd be quite handy.
Not completely, I think. Seems like md5sum is not included by default in Cygwin, but that only affects the detection of missing audio (uses hashes to identify them). The important program is wget.

Here is the script without removal of missing audio:
Code:
#!/bin/bash

if [ $# -ne 0 ]
then
  echo "Usage: `basename $0` < input"
  echo "input: Field 1: かな, Field 2: 漢字"
  exit 65 # Bad arguments
fi

while read kana kanji
do
  wget -q "http://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kana=$kana&kanji=$kanji" \
         -O "$kana-$kanji.mp3"
done
Reply

Messages In This Thread