Commit 4750f18a authored by Booloki's avatar Booloki

Merge branch 'topic/debug_refacto' into 'master'

Debug factorization

See merge request !2
parents 0781bee1 4e21f384
Pipeline #64 passed with stage
in 17 seconds
......@@ -55,10 +55,8 @@ audio_rip () {
not_recognized_exit
;;
esac
if [[ "${DEBUG}" == "1" ]]; then
echo "DEBUG AUDIO_SOURCE_FILE ${AUDIO_SOURCE_FILE}"
echo "DEBUG AUDIO_SOURCE_BITRATE ${AUDIO_SOURCE_BITRATE}"
fi
debug "AUDIO_SOURCE_FILE ${AUDIO_SOURCE_FILE}"
debug "AUDIO_SOURCE_BITRATE ${AUDIO_SOURCE_BITRATE}"
# Audio dump/demux from local working file
case "${CODEC_AUDIO}" in
......@@ -73,7 +71,7 @@ audio_rip () {
echo -ne "\n *************************************\n"
echo " Dumping ${AUDIO_SOURCE_FILE}..."
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG ionice -c \"${IONICENESS}\" nice -n \"${NICENESS}\" mplayer -nolirc \"${SOURCE_FILE}\" -aid \"${AUDIO_AID}\" -dumpaudio -dumpfile \"${AUDIO_SOURCE_FILE}\""; fi
debug "ionice -c \"${IONICENESS}\" nice -n \"${NICENESS}\" mplayer -nolirc \"${SOURCE_FILE}\" -aid \"${AUDIO_AID}\" -dumpaudio -dumpfile \"${AUDIO_SOURCE_FILE}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( ionice -c "${IONICENESS}" nice -n "${NICENESS}" mplayer -nolirc "${SOURCE_FILE}" -aid "${AUDIO_AID}" -dumpaudio -dumpfile "${AUDIO_SOURCE_FILE}" 2>&1 ) \
| zenity --progress --pulsate --title "${ZEN_TITLE}" --text "Dumping ${AUDIO_SOURCE_FILE}" --auto-close
......@@ -95,7 +93,7 @@ audio_rip () {
fi
# get PCM source map
SOURCE_PCM_BLURAY_ID=$(mediainfo '--Inform=Audio;%MenuID% %Format%\n' "${SOURCE_FILE}" | grep PCM | cut -d ' ' -f1)
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG ionice -c \"${IONICENESS}\" nice -n \"${NICENESS}\" \"${CONV_PROJECT}\" -i \"${SOURCE_FILE}\" -map 0:\"${SOURCE_PCM_BLURAY_ID}\" \"${WAV_FILE}\""; fi
debug "ionice -c \"${IONICENESS}\" nice -n \"${NICENESS}\" \"${CONV_PROJECT}\" -i \"${SOURCE_FILE}\" -map 0:\"${SOURCE_PCM_BLURAY_ID}\" \"${WAV_FILE}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( ionice -c "${IONICENESS}" nice -n "${NICENESS}" "${CONV_PROJECT}" -i "${SOURCE_FILE}" -map 0:"${SOURCE_PCM_BLURAY_ID}" "${WAV_FILE}" ) \
| zenity --progress --title="${ZEN_TITLE}" --text="Extracting ${WAV_FILE}" --auto-close --auto-kill --pulsate
......@@ -115,7 +113,7 @@ audio_rip () {
echo -ne "\n *************************************\n"
echo " Dumping ${WAV_FILE}..."
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG ionice -c \"${IONICENESS}\" nice -n \"${NICENESS}\" mplayer -nolirc \"${SOURCE_FILE}\" -aid \"${AUDIO_AID}\" -ao pcm:waveheader:fast:file=\"${WAV_FILE}\" -vc dummy -vo null"; fi
debug "ionice -c \"${IONICENESS}\" nice -n \"${NICENESS}\" mplayer -nolirc \"${SOURCE_FILE}\" -aid \"${AUDIO_AID}\" -ao pcm:waveheader:fast:file=\"${WAV_FILE}\" -vc dummy -vo null"
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( ionice -c "${IONICENESS}" nice -n "${NICENESS}" mplayer -nolirc "${SOURCE_FILE}" -aid "${AUDIO_AID}" -ao pcm:waveheader:fast:file="${WAV_FILE}" -vc dummy -vo null 2>/dev/null ) \
| zenity --progress --title="${ZEN_TITLE}" --text="Extracting ${WAV_FILE}" --auto-close --auto-kill --pulsate
......@@ -177,7 +175,7 @@ audio_rip () {
echo -ne "\n *************************************\n"
echo " Convert ${AUDIO_SOURCE_FILE} to ${AUDIO_FILE}..."
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG nice -n \"${NICENESS}\" \"${CONV_PROJECT}\" -threads \"${AUDIO_AC3_THREADS}\" -i \"${AUDIO_SOURCE_FILE}\" -acodec ac3 -ab \"${AUDIO_AC3_QUAL}\" -y \"${AUDIO_FILE}\""; fi
debug "nice -n \"${NICENESS}\" \"${CONV_PROJECT}\" -threads \"${AUDIO_AC3_THREADS}\" -i \"${AUDIO_SOURCE_FILE}\" -acodec ac3 -ab \"${AUDIO_AC3_QUAL}\" -y \"${AUDIO_FILE}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( nice -n "${NICENESS}" "${CONV_PROJECT}" -threads "${AUDIO_AC3_THREADS}" -i "${AUDIO_SOURCE_FILE}" -acodec ac3 -ab "${AUDIO_AC3_QUAL}" -y "${AUDIO_FILE}" ) \
| zenity --progress --title="${ZEN_TITLE}" --text="Encoding ${AUDIO_FILE}" --auto-close --auto-kill --pulsate
......@@ -199,7 +197,7 @@ audio_rip () {
echo -ne "\n *************************************\n"
echo " Convert ${WAV_FILE} to ${AUDIO_FILE}..."
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG nice -n \"${NICENESS}\" oggenc \"${WAV_FILE}\" -q \"${AUDIO_OGG_QUAL}\" -o \"${AUDIO_FILE}\" -a \"${TITLE_NAME}\" -t \"${AUDIO_NAME}\" -l \"${MERGE_TITLE}\" -G Soundtrack -d \"${DATE}\""; fi
debug "nice -n \"${NICENESS}\" oggenc \"${WAV_FILE}\" -q \"${AUDIO_OGG_QUAL}\" -o \"${AUDIO_FILE}\" -a \"${TITLE_NAME}\" -t \"${AUDIO_NAME}\" -l \"${MERGE_TITLE}\" -G Soundtrack -d \"${DATE}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( nice -n "${NICENESS}" oggenc "${WAV_FILE}" -q "${AUDIO_OGG_QUAL}" -o "${AUDIO_FILE}" -a "${TITLE_NAME}" -t "${AUDIO_NAME}" -l "${MERGE_TITLE}" -G Soundtrack -d "${DATE}" 2>&1 \
| awk -vRS='\r' '(NR>1){gsub(/%/," ");print $2; fflush();}' ) \
......@@ -240,7 +238,7 @@ audio_rip () {
echo -ne "\n *************************************\n"
echo " Convert ${WAV_FILE} to ${AUDIO_FILE}..."
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG nice -n \"${NICENESS}\" lame --scale \"${AUDIO_MP3_VOL}\" \"${AUDIO_MP3_MODE_OPTION}\" --ta \"${TITLE_NAME}\" --tt \"${AUDIO_NAME}\" --tl \"${MERGE_TITLE}\" --tg 24 --ty \"${DATE}\" --tc \"${COMMENT}\" -h \"${WAV_FILE}\" \"${AUDIO_FILE}\""; fi
debug "nice -n \"${NICENESS}\" lame --scale \"${AUDIO_MP3_VOL}\" \"${AUDIO_MP3_MODE_OPTION}\" --ta \"${TITLE_NAME}\" --tt \"${AUDIO_NAME}\" --tl \"${MERGE_TITLE}\" --tg 24 --ty \"${DATE}\" --tc \"${COMMENT}\" -h \"${WAV_FILE}\" \"${AUDIO_FILE}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( nice -n "${NICENESS}" lame --scale "${AUDIO_MP3_VOL}" "${AUDIO_MP3_MODE_OPTION}" \
--ta "${TITLE_NAME}" --tt "${AUDIO_NAME}" --tl "${MERGE_TITLE}" \
......@@ -288,8 +286,7 @@ audio_rip () {
echo -ne "\n *************************************\n"
echo " Encoding ${WAV_FILE} to ${AUDIO_FILE}..."
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG nice -n \"${NICENESS}\" opusenc --bitrate \"${AUDIO_OPUS_BITRATE}\" \"${AUDIO_OPUS_MODE_OPTION}\" \
--artist \"${TITLE_NAME}\" --title \"${AUDIO_NAME}\" \"${WAV_FILE}\" \"${AUDIO_FILE}\""; fi
debug "nice -n \"${NICENESS}\" opusenc --bitrate \"${AUDIO_OPUS_BITRATE}\" \"${AUDIO_OPUS_MODE_OPTION}\" --artist \"${TITLE_NAME}\" --title \"${AUDIO_NAME}\" \"${WAV_FILE}\" \"${AUDIO_FILE}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( echo 10; nice -n "${NICENESS}" opusenc --bitrate "${AUDIO_OPUS_BITRATE}" "${AUDIO_OPUS_MODE_OPTION}" --artist "${TITLE_NAME}" --title "${AUDIO_NAME}" "${WAV_FILE}" "${AUDIO_FILE}" 2>/dev/null ) \
| zenity --progress --pulsate --title "${ZEN_TITLE}" --text "Encoding ${WAV_FILE} to ${AUDIO_FILE}" --auto-close --auto-kill
......@@ -309,7 +306,7 @@ audio_rip () {
# return AUDIO_SOURCE_BITRATE
get_audio_bitrate () {
AUDIO_SOURCE_BITRATE_STRING=$(mediainfo --Inform="Audio;%ID/String%:%BitRate/String%\n" "${SOURCE_FILE}" | grep "${AUDIO_AID}" | cut -d':' -f2)
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG AUDIO_SOURCE_BITRATE_STRING ${AUDIO_SOURCE_BITRATE_STRING}"; fi
debug "AUDIO_SOURCE_BITRATE_STRING ${AUDIO_SOURCE_BITRATE_STRING}"
if [[ "${AUDIO_SOURCE_BITRATE_STRING}" == *[kK]b[/p]s* ]]
then
AUDIO_SOURCE_BITRATE=$(echo "${AUDIO_SOURCE_BITRATE_STRING}" | sed 's/ //g' | sed 's|[kK]b[/p]s||g' | sed 's|Unknown/||')
......
......@@ -12,7 +12,7 @@ checkandsource_wazzuf_conf () {
echo -ne " *************************************\n"
exit 1
else
if [[ "${DEBUG}" == 1 ]]; then echo "DEBUG Sourcing ${CONF_FILE}..."; fi
debug "Sourcing ${CONF_FILE}..."
# shellcheck source=conf/wazzuf-ripper.conf
source "${CONF_FILE}"
fi
......@@ -26,7 +26,7 @@ checkandsource_wazzuf_files () {
echo -ne " *************************************\n"
exit 1
else
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG Sourcing ${WFILE}..."; fi
debug "Sourcing ${WFILE}..."
# shellcheck source=/dev/null
source "${WFILE}"
fi
......
......@@ -7,6 +7,14 @@ wazzuf_usage () {
exit 1
}
# Debug display
function debug() {
if ${DEBUG}; then
echo "$(date "+%Y-%m-%d %H:%M:%S") [DEBUG] ${*}"
fi
return 0
}
# Iso file management
# need ISO_FILE_PATH
#
......@@ -26,11 +34,11 @@ iso_manage () {
# udisksctl does not require root privileges
check_udisksctl
if [[ ${2} == "GUI" ]]; then
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG udisksctl loop-setup -r -f \"${ISO_FILE_PATH}\"";fi
debug "udisksctl loop-setup -r -f \"${ISO_FILE_PATH}\""
udisksctl loop-setup -r -f "${ISO_FILE_PATH}"
else
echo "Mount iso file"
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG udisksctl loop-setup -r -f \"${ISO_FILE_PATH}\"";fi
debug "udisksctl loop-setup -r -f \"${ISO_FILE_PATH}\""
udisksctl loop-setup -r -f "${ISO_FILE_PATH}"
fi
# Get mount point
......@@ -56,7 +64,7 @@ iso_manage () {
get_media_device_type () {
check_mediainfo
MEDIA_FORMAT_FULL=$(mediainfo --Inform="General;%Format%" "${MOUNT_PATH}" 2> /dev/null)
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG MEDIA_FORMAT_FULL ${MEDIA_FORMAT_FULL}";fi
debug "MEDIA_FORMAT_FULL ${MEDIA_FORMAT_FULL}"
if echo "${MEDIA_FORMAT_FULL}" | grep -q Blu-ray; then
MEDIA_DEVICE_TYPE="BD"
......@@ -66,7 +74,7 @@ get_media_device_type () {
# Not a DVD nor BD
MEDIA_DEVICE_TYPE="UNKNOWN"
fi
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG MEDIA_DEVICE_TYPE ${MEDIA_DEVICE_TYPE}";fi
debug "MEDIA_DEVICE_TYPE ${MEDIA_DEVICE_TYPE}"
}
# Get the name of the mounted media device
......@@ -75,7 +83,7 @@ get_media_device_type () {
# return MEDIA_TITLE
get_media_title () {
MEDIA_TITLE=$(echo "${MOUNT_PATH}" | awk 'BEGIN {FS = "/"} ; {print $NF}')
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG MEDIA_TITLE ${MEDIA_TITLE}";fi
debug "MEDIA_TITLE ${MEDIA_TITLE}"
}
# soft_to_install_exit
......
......@@ -55,13 +55,11 @@ cover_art_convert () {
fi
fi
if [[ "${DEBUG}" == "1" ]]; then
echo "DEBUG COVER_FORMAT ${COVER_FORMAT}"
echo "DEBUG COVER_OUTPUT_SIMPLE ${COVER_OUTPUT_SIMPLE}"
echo "DEBUG COVER_DIMENSION_SIMPLE ${COVER_DIMENSION_SIMPLE}"
echo "DEBUG COVER_OUTPUT_THUMB ${COVER_OUTPUT_THUMB}"
echo "DEBUG COVER_DIMENSION_THUMB ${COVER_DIMENSION_THUMB}"
fi
debug "COVER_FORMAT ${COVER_FORMAT}"
debug "COVER_OUTPUT_SIMPLE ${COVER_OUTPUT_SIMPLE}"
debug "COVER_DIMENSION_SIMPLE ${COVER_DIMENSION_SIMPLE}"
debug "COVER_OUTPUT_THUMB ${COVER_OUTPUT_THUMB}"
debug "COVER_DIMENSION_THUMB ${COVER_DIMENSION_THUMB}"
# cover creation
if [ -f "${COVER_OUTPUT_SIMPLE}" ] && [[ ! "${WAZZUF_UI}" == "GUI" ]]; then
......
......@@ -6,7 +6,7 @@
# need TITLE_NAME
# return OMDB_RESPONSE ("True" or "False")
get_omdb_response_title () {
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" | sed -n '/^response/{n;p;}'"; fi
debug "omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" | sed -n '/^response/{n;p;}'"
OMDB_RESPONSE=$(omdbtool -t "${TITLE_NAME}" --apikey="${OMDB_API_KEY}" | sed -n '/^response/{n;p;}')
}
......@@ -14,21 +14,21 @@ get_omdb_response_title () {
# DATE
# return OMDB_RESPONSE ("True" or "False")
get_omdb_response_title_date () {
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" -y \"${DATE}\" | sed -n '/^response/{n;p;}'"; fi
debug "omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" -y \"${DATE}\" | sed -n '/^response/{n;p;}'"
IMDB_RESPONSE=$(omdbtool -t "${TITLE_NAME}" --apikey="${OMDB_API_KEY}" -y "${DATE}" | sed -n '/^response/{n;p;}')
}
# need IMDB_FILE
# return OMDB_RESPONSE ("True" or "False")
get_omdb_response_file () {
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG sed -n '/^response/{n;p;}' \"${IMDB_FILE}\""; fi
debug "sed -n '/^response/{n;p;}' \"${IMDB_FILE}\""
OMDB_RESPONSE=$(sed -n '/^response/{n;p;}' "${IMDB_FILE}")
}
# need TITLE_NAME
# return IMDB_ID
get_imdb_id_title () {
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" | sed -n '/^imdbid/{n;p;}'"; fi
debug "omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" | sed -n '/^imdbid/{n;p;}'"
IMDB_ID=$(omdbtool -t "${TITLE_NAME}" --apikey="${OMDB_API_KEY}" | sed -n '/^imdbid/{n;p;}')
}
......@@ -36,7 +36,7 @@ get_imdb_id_title () {
# DATE
# return IMDB_ID
get_imdb_id_title_date () {
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" -y \"${DATE}\" | sed -n '/^imdbid/{n;p;}'"; fi
debug "omdbtool -t \"${TITLE_NAME}\" --apikey=\"${OMDB_API_KEY}\" -y \"${DATE}\" | sed -n '/^imdbid/{n;p;}'"
IMDB_ID=$(omdbtool -t "${TITLE_NAME}" --apikey="${OMDB_API_KEY}" -y "${DATE}" | sed -n '/^imdbid/{n;p;}')
}
......@@ -49,7 +49,7 @@ download_imdb_poster () {
else
# check if IMDb cover exists
IMDB_POSTER=$(omdbtool -i "${IMDB_ID}" --apikey="${OMDB_API_KEY}" | sed -n '/^poster/{n;p;}')
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG IMDB_POSTER ${IMDB_POSTER}"; fi
debug "IMDB_POSTER ${IMDB_POSTER}"
if [[ "${IMDB_POSTER}" == "N/A" ]]; then
echo "No IMBd cover found, Skipping..."
else
......@@ -62,7 +62,7 @@ download_imdb_poster () {
* )
check_omdb
check_wget
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG wget \"${IMDB_POSTER}\" -O cover.jpg"; fi
debug "wget \"${IMDB_POSTER}\" -O cover.jpg"
wget "${IMDB_POSTER}" -O cover.jpg
;;
esac
......@@ -113,7 +113,7 @@ imdb_id_ask_gui () {
IMDB_ID=""
else
if [[ "${ZENITY_IMDBID}" == "" || "${ZENITY_IMDBID}" == "tt" ]]; then
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG Wrong IMdb ID provided !"; fi
debug "Wrong IMdb ID provided !"
IMDB_ID=""
else
IMDB_ID="${ZENITY_IMDBID}"
......
......@@ -8,7 +8,7 @@ cropdetect () {
GUI )
case "${SOURCE}" in
BD | ISO_BD )
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG mplayer br://\"${BD_LONGEST_TITLE_NUMBER}\" -bluray-device \"${BD_MOUNT}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"; fi
debug "mplayer br://\"${BD_LONGEST_TITLE_NUMBER}\" -bluray-device \"${BD_MOUNT}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"
( echo 10; mplayer br://"${BD_LONGEST_TITLE_NUMBER}" -bluray-device "${BD_MOUNT}" -vf cropdetect -nosound -vo null -frames "${CROP_FRAMES}" -sstep 1 -nocache &> /tmp/cropdetect.out ) | zenity --progress \
--title="${ZEN_TITLE}" \
--text="Crop detection in progress" \
......@@ -18,7 +18,7 @@ cropdetect () {
if [ $? = "1" ]; then wazzuf_quit; fi
;;
M2TS )
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG mplayer \"${M2TS_FILE_PATH}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"; fi
debug "mplayer \"${M2TS_FILE_PATH}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"
( echo 10; mplayer "${M2TS_FILE_PATH}" -vf cropdetect -nosound -vo null -frames "${CROP_FRAMES}" -sstep 1 -nocache &> /tmp/cropdetect.out ) | zenity --progress \
--title="${ZEN_TITLE}" \
--text="Crop detection in progress" \
......@@ -28,7 +28,7 @@ cropdetect () {
if [ $? = "1" ]; then wazzuf_quit; fi
;;
DVD | ISO_DVD)
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG mplayer dvd://\"${DVD_TITLE_NUMBER}\" -dvd-device \"${DVD_SOURCE}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"; fi
debug "mplayer dvd://\"${DVD_TITLE_NUMBER}\" -dvd-device \"${DVD_SOURCE}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"
( echo 10; mplayer dvd://"${DVD_TITLE_NUMBER}" -dvd-device "${DVD_SOURCE}" -vf cropdetect -nosound -vo null -frames "${CROP_FRAMES}" -sstep 1 -nocache &> /tmp/cropdetect.out ) | zenity --progress \
--title="${ZEN_TITLE}" \
--text="Crop detection in progress" \
......@@ -43,17 +43,17 @@ cropdetect () {
echo -ne "...\n"
case "${SOURCE}" in
BD | ISO_BD )
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG mplayer br://\"${BD_LONGEST_TITLE_NUMBER}\" -bluray-device \"${BD_MOUNT}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"; fi
debug "mplayer br://\"${BD_LONGEST_TITLE_NUMBER}\" -bluray-device \"${BD_MOUNT}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"
mplayer br://"${BD_LONGEST_TITLE_NUMBER}" -bluray-device "${BD_MOUNT}" -vf cropdetect -nosound -vo null -frames "${CROP_FRAMES}" -sstep 1 -nocache &> /tmp/cropdetect.out
wait
;;
M2TS )
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG mplayer \"${M2TS_FILE_PATH}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"; fi
debug "mplayer \"${M2TS_FILE_PATH}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"
mplayer "${M2TS_FILE_PATH}" -vf cropdetect -nosound -vo null -frames "${CROP_FRAMES}" -sstep 1 -nocache &> /tmp/cropdetect.out
wait
;;
DVD | ISO_DVD )
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG mplayer dvd://\"${DVD_TITLE_NUMBER}\" -dvd-device \"${DVD_SOURCE}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"; fi
debug "mplayer dvd://\"${DVD_TITLE_NUMBER}\" -dvd-device \"${DVD_SOURCE}\" -vf cropdetect -nosound -vo null -frames \"${CROP_FRAMES}\" -sstep 1 -nocache &> /tmp/cropdetect.out"
mplayer -dvd-device "${ISO_FILE_PATH}" dvd://"${DVD_TITLE_NUMBER}" -dvd-device "${DVD_SOURCE}" -vf cropdetect -nosound -vo null -frames "${CROP_FRAMES}" -sstep 1 -nocache &> /tmp/cropdetect.out
wait
;;
......@@ -91,7 +91,7 @@ lsdvd_decode () {
# DVD_MOUNT_PATH
copy_dvd2iso () {
check_genisoimage
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG genisoimage -allow-limited-size -dvd-video -o \"${ISO_FILE}\" \"${DVD_MOUNT_PATH}\""; fi
debug "genisoimage -allow-limited-size -dvd-video -o \"${ISO_FILE}\" \"${DVD_MOUNT_PATH}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( genisoimage -allow-limited-size -dvd-video -o "${ISO_FILE}" "${DVD_MOUNT_PATH}" 2>&1 \
| sed -u 's/.* \(.*[0-9]\)\.\([0-9]\+%\)\(.*\)/\1\n# iso file creation in progress\t\t\1.\2/' )\
......@@ -107,7 +107,7 @@ copy_dvd2iso () {
# need ISO_FILE
# DEVICE_PATH_BASE
copy_bd2iso () {
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG dd if=\"${DEVICE_PATH_BASE}\" of=\"${ISO_FILE}\"" > /dev/null 2>&1; fi
debug "dd if=\"${DEVICE_PATH_BASE}\" of=\"${ISO_FILE}\" > /dev/null 2>&1"
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( dd if="${DEVICE_PATH_BASE}" of="${ISO_FILE}" 2>&1 > /dev/null ) \
| zenity --progress \
......@@ -124,8 +124,8 @@ copy_bd2iso () {
# BD_LONGEST_LENGTH
bd_get_longest_title () {
BD_LONGEST_LENGTH=$(grep "^ID_BLURAY_TITLE_" "${MEDIA_TITLE}-mplayer.info" | grep _LENGTH | cut -d '=' -f 2 | sort -n | tail -1)
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG BD_LONGEST_LENGTH ${BD_LONGEST_LENGTH}"; fi
debug "BD_LONGEST_LENGTH ${BD_LONGEST_LENGTH}"
BD_LONGEST_TITLE_NUMBER=$(grep "${BD_LONGEST_LENGTH}" "${MEDIA_TITLE}-mplayer.info" | cut -d '_' -f 4 | head -n 1)
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG BD_LONGEST_TITLE_NUMBER ${BD_LONGEST_TITLE_NUMBER}"; fi
debug "BD_LONGEST_TITLE_NUMBER ${BD_LONGEST_TITLE_NUMBER}"
}
......@@ -22,7 +22,7 @@ subtitle_rip () {
echo -ne "\n *************************************\n"
echo " Extracting subtitle ${SUBTITLE_SID} to ${SUBTITLE_FILE} "
echo -ne " *************************************\n"
if [[ "${DEBUG}" == "1" ]]; then echo "DEBUG nice -n \"${NICENESS}\" mencoder -dvd-device \"${MPLAYER_DEVICE}\" dvd://\"${TITLE_NUMBER}\" \"${MPLAYER_CHAPTERS}\" -vobsubout \"${SUB_FILE}\" -vobsuboutindex 0 -sid \"${SUBTITLE_SID}\" -o /dev/null -nosound -ovc frameno"; fi
debug "nice -n \"${NICENESS}\" mencoder -dvd-device \"${MPLAYER_DEVICE}\" dvd://\"${TITLE_NUMBER}\" \"${MPLAYER_CHAPTERS}\" -vobsubout \"${SUB_FILE}\" -vobsuboutindex 0 -sid \"${SUBTITLE_SID}\" -o /dev/null -nosound -ovc frameno"
nice -n "${NICENESS}" mencoder -dvd-device "${MPLAYER_DEVICE}" dvd://"${TITLE_NUMBER}" "${MPLAYER_CHAPTERS}" \
-vobsubout "${SUB_FILE}" -vobsuboutindex 0 -sid "${SUBTITLE_SID}" \
-o /dev/null -nosound -ovc frameno
......@@ -92,27 +92,21 @@ subtitle_srt_check () {
iso-8859-1 )
SUBTITLE_CHARSET="ISO-8859-1"
MERGE_SUBTITLE_CHARSET="--sub-charset 0:${SUBTITLE_CHARSET}"
if [[ "${DEBUG}" == "1" ]]; then
echo "DEBUG SUBTITLE_MIME ${SUBTITLE_MIME}"
echo "DEBUG SUBTITLE_CHARSET ${SUBTITLE_CHARSET}"
fi
debug "SUBTITLE_MIME ${SUBTITLE_MIME}"
debug "SUBTITLE_CHARSET ${SUBTITLE_CHARSET}"
;;
unknown-8bit )
SUBTITLE_CHARSET="WINDOWS-1252"
MERGE_SUBTITLE_CHARSET="--sub-charset 0:${SUBTITLE_CHARSET}"
if [[ "${DEBUG}" == "1" ]]; then
echo "DEBUG SUBTITLE_MIME ${SUBTITLE_MIME}"
echo "DEBUG SUBTITLE_CHARSET ${SUBTITLE_CHARSET}"
fi
debug "SUBTITLE_MIME ${SUBTITLE_MIME}"
debug "SUBTITLE_CHARSET ${SUBTITLE_CHARSET}"
;;
* )
# unrecognized charset
SUBTITLE_CHARSET=""
MERGE_SUBTITLE_CHARSET=""
if [[ "${DEBUG}" == "1" ]]; then
echo "DEBUG SUBTITLE_MIME ${SUBTITLE_MIME}"
echo "DEBUG SUBTITLE_CHARSET TODO"
fi
debug "SUBTITLE_MIME ${SUBTITLE_MIME}"
debug "SUBTITLE_CHARSET TODO"
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
zenity --warning --title "${ZEN_TITLE}" \
--text "Provided subtitle is not Unicode and unrecognized." \
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: wazzuf-ripper 6\n"
"Report-Msgid-Bugs-To: booloki@lokizone.net\n"
"POT-Creation-Date: 2018-10-21 11:09+0200\n"
"POT-Creation-Date: 2018-10-22 11:55+0200\n"
"PO-Revision-Date: 2016-02-23 18:37+0100\n"
"Last-Translator: Nicolas Perrin <booloki@lokizone.net>\n"
"Language-Team: French\n"
......@@ -23,35 +23,35 @@ msgstr ""
msgid "\\nWazzuf Ripper failed !"
msgstr "\\nWazzuf Ripper a planté !"
#: wazzuf-ripper:250
#: wazzuf-ripper:246
msgid " Start %s %s :\\n%s\\nwith %s video codec\\nand %s %s audio codec(s)"
msgstr ""
" Démarrage de %s %s :\\n%s\\navec le codec vidéo %s\\net le(s) codec(s) "
"audio %s %s"
#: wazzuf-ripper:399
#: wazzuf-ripper:395
msgid "Work in progress:"
msgstr "Travail en cours:"
#: wazzuf-ripper:525
#: wazzuf-ripper:521
msgid "No IMdb ID provided. Skipping..."
msgstr "Aucun ID IMdb fourni. Je passe..."
#: wazzuf-ripper:537
#: wazzuf-ripper:533
msgid "Retrieving IMdb informations..."
msgstr "Récupération des informations IMdb..."
#: wazzuf-ripper:556
#: wazzuf-ripper:552
msgid "\\nManual killed script (Ctrl-C) during extracting working file"
msgstr ""
"\\nScript interrompu manuellement (Ctrl-C) pendant l'extraction de fichier "
"de travail"
#: wazzuf-ripper:602
#: wazzuf-ripper:598
msgid "Extracting %s from %s "
msgstr "Extraction de %s depuis %s "
#: wazzuf-ripper:613
#: wazzuf-ripper:609
msgid ""
"Please now run wazzuf-conf-generator with chosen M2TS file to get more "
"tracks informations,\\nor use M2TS instead of BD in %s.\\n"
......@@ -60,46 +60,46 @@ msgstr ""
"pour obtenir plus d’informations sur les pistes,\\noù utilisez M2TS à la "
"place de BD dans %s.\\n"
#: wazzuf-ripper:633
#: wazzuf-ripper:629
msgid "%s generation"
msgstr "Génération de %s"
#: wazzuf-ripper:654
#: wazzuf-ripper:650
msgid "No chapters file to create. Next..."
msgstr "Pas de fichier de chapitres à créer. Suivant..."
#: wazzuf-ripper:685
#: wazzuf-ripper:679
msgid "\\nManual killed script (Ctrl-C) during checking/extracting subtitles"
msgstr ""
"\\nScript interrompu manuellement (Ctrl-C) pendant la vérification/"
"extraction des sous-titres"
#: wazzuf-ripper:695
#: wazzuf-ripper:689
msgid "No more subtitle track choice. Next..."
msgstr "Plus de choix de piste de sous-titre. Suivant..."
#: wazzuf-ripper:828
#: wazzuf-ripper:817
msgid ""
"\\nManual killed script (Ctrl-C) during audio track(s) extraction/encoding"
msgstr ""
"\\nScript interrompu manuellement (Ctrl-C) pendant l'extraction/encodage de "
"piste(s) audio"
#: wazzuf-ripper:838
#: wazzuf-ripper:827
msgid "No more audio track choice, next..."
msgstr "Plus de choix de piste audio. Suivant..."
#: wazzuf-ripper:909
#: wazzuf-ripper:894
msgid "\\nManual killed script (Ctrl-C) during video encoding"
msgstr "\\nScript interrompu manuellement (Ctrl-C) pendant l'encodage vidéo"
#: wazzuf-ripper:923
#: wazzuf-ripper:908
msgid "Provided TARGET_SIZE is not set to CD, DVD, or an integer ! Exiting."
msgstr ""
"Le paramètre TARGET_SIZE fourni n'est pas mis à CD, DVD ou avec un entier ! "
"Je quitte."
#: wazzuf-ripper:973
#: wazzuf-ripper:956
msgid ""
"h264 video bitrate encoding estimation: %s kb/s.\\nManually adjust the "
"XXRIP_VIDEO_BITRATE value if the final size does not suit you."
......@@ -107,7 +107,7 @@ msgstr ""
"Estimation du débit d'encodage vidéo h264: %s kb/s.\\nAjustez manuellement "
"la valeur de XXRIP_VIDEO_BITRATE si la taille finale ne vous convient pas."
#: wazzuf-ripper:991
#: wazzuf-ripper:974
msgid ""
"Xvid video bitrate encoding estimation: %s kb/s.\\nManually adjust the "
"XXRIP_VIDEO_BITRATE value if the final size does not suit you."
......@@ -115,41 +115,41 @@ msgstr ""
"Estimation du débit d'encodage vidéo Xvid: %s kb/s.\\nAjustez manuellement "
"la valeur de XXRIP_VIDEO_BITRATE si la taille finale ne vous convient pas."
#: wazzuf-ripper:1021
#: wazzuf-ripper:1004
msgid ""
"Warning: VIDEO_CROP is empty ! Run wazzuf-conf-generator for crop detection."
msgstr ""
"Attention: le paramètre VIDEO_CROP est vide ! Lancez wazzuf-conf-generator "
"pour une détection de cadrage."
#: wazzuf-ripper:1035
#: wazzuf-ripper:1018
msgid "%s 2 pass %s encoding\\n"
msgstr "Encodage de %s en %s 2 passes\\n"
#: wazzuf-ripper:1066
#: wazzuf-ripper:1049
msgid "No image attachment. Skipping..."
msgstr "Pas d'image jointe. Je passe..."
#: wazzuf-ripper:1147
#: wazzuf-ripper:1126
msgid "XML tags file generation error. Skipping..."
msgstr "Erreur de génération de fichier XML d'étiquettes. Je passe..."
#: wazzuf-ripper:1165
#: wazzuf-ripper:1144
msgid "\\nManual killed script (Ctrl-C) during final mkv merge"
msgstr "\\nScript interrompu manuellement (Ctrl-C) pendant la fusion finale"
#: wazzuf-ripper:1168
#: wazzuf-ripper:1147
msgid "Final file merge"
msgstr "Fusion finale du fichier"
#: wazzuf-ripper:1227
#: wazzuf-ripper:1204
msgid "nfo file generation"
msgstr "Génération de fichier nfo"
#: wazzuf-ripper:1263
#: wazzuf-ripper:1238
msgid "Taking some screenshots"
msgstr "Prends quelques captures d'écran"
#: wazzuf-ripper:1290
#: wazzuf-ripper:1265
msgid "%s %s is finished"
msgstr "%s %s est terminé"
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: booloki@lokizone.net\n"
"POT-Creation-Date: 2018-10-21 11:10+0200\n"
"POT-Creation-Date: 2018-10-22 11:55+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -81,283 +81,283 @@ msgstr ""
msgid "Do you want to generate a <b>new Wazzuf Ripper configuration file</b> ?"
msgstr ""
#: wazzuf-conf-generator:101
#: wazzuf-conf-generator:85
msgid "Which media type do you want to rip ?"
msgstr ""
#: wazzuf-conf-generator:102
#: wazzuf-conf-generator:86
msgid "Physical DVD"
msgstr ""
#: wazzuf-conf-generator:103
#: wazzuf-conf-generator:87
msgid "DVD iso file"
msgstr ""
#: wazzuf-conf-generator:104
#: wazzuf-conf-generator:88
msgid "Physical Blu-Ray"
msgstr ""
#: wazzuf-conf-generator:105
#: wazzuf-conf-generator:89
msgid "Blu-Ray iso file"
msgstr ""
#: wazzuf-conf-generator:106
#: wazzuf-conf-generator:90
msgid "m2ts/ts file"
msgstr ""
#: wazzuf-conf-generator:115
#: wazzuf-conf-generator:99
msgid ""
"Please select your <b>source directory</b>\n"
"(m2ts/ts, iso, external subtitles, cover image, episodes list,...)."
msgstr ""
#: wazzuf-conf-generator:127
#: wazzuf-conf-generator:111
msgid "Please select your <b>Disc Directory</b>. "
msgstr ""
#: wazzuf-conf-generator:133
#: wazzuf-conf-generator:117
msgid "Please select your <b>iso file</b> (source directory only). "
msgstr ""
#: wazzuf-conf-generator:160
#: wazzuf-conf-generator:144
msgid "Please select your <b>m2ts/ts file</b> (source directory only). "
msgstr ""
#: wazzuf-conf-generator:186
#: wazzuf-conf-generator:170
msgid "Do you want to change the <b>working files directory</b> (%s) ?"
msgstr ""
#: wazzuf-conf-generator:216
#: wazzuf-conf-generator:200
msgid "What is the type of this video media ?"
msgstr ""
#: wazzuf-conf-generator:217
#: wazzuf-conf-generator:201
msgid "Movie"
msgstr ""
#: wazzuf-conf-generator:218
#: wazzuf-conf-generator:202
msgid "TV show/serie (multiple videos)"
msgstr ""
#: wazzuf-conf-generator:219
#: wazzuf-conf-generator:203
msgid "Musical video"
msgstr ""
#: wazzuf-conf-generator:228
#: wazzuf-conf-generator:212
msgid "Videos informations"
msgstr ""
#: wazzuf-conf-generator:229
#: wazzuf-conf-generator:213
msgid "Original title *"
msgstr ""
#: wazzuf-conf-generator:230
#: wazzuf-conf-generator:214
msgid "Release date"