## Author: Steve Youngs <steve@steveyoungs.com>
## Maintainer: Steve Youngs <steve@steveyoungs.com>
## Created: <2006-08-08>
-## Time-stamp: <Sunday Aug 11, 2013 12:05:54 steve>
+## Time-stamp: <Saturday Feb 20, 2021 12:38:28 steve>
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## o Partial album ripping. Specify track numbers or a range of
## track numbers to only rip/encode those tracks.
##
-## o Ripping from music DVDs
+## o Rewrite online metadata retrieval to use MusicBrainz instead
+## of freedb.org as the latter no longer exists.
##
### Bugs:
# Version info.
VERSION=@VERSION@
-COPYRIGHT="Copyright (C) 2006 - 2013 Steve Youngs <steve@steveyoungs.com>"
+COPYRIGHT="Copyright (C) 2006 - 2021 Steve Youngs <steve@steveyoungs.com>"
version_str="${ourname}: ${VERSION}
${COPYRIGHT}"
$ourname is a "frontend" to the process of ripping audio (cdda) CDs
to a hard disk and encoding the audio tracks to either MP3 format or
- Ogg Vorbis format.
+ Ogg/Vorbis format.
File names are auto-generated from track titles, with illegal
characters removed and spaces converted to underscores.
Track title, artist, and album names are added to the ID3 tags or
Vorbis comments header.
+ If the file: '\${PWD}/cover.jpg' exists it will be embedded into
+ each track file as "Front Cover" art. This is only supported for
+ Ogg/Vorbis and FLAC formats.
+
Options:
-------
Save encoded files to the directory, DIR. If flac encoding
is also requested, see '--flac_copy' option below, the flac
files will be saved to DIR/flac. If this option is omitted,
- it defaults to 'PWD/ARTIST/ALBUM' the album name is first
- converted to a sane filename.
+ it defaults to: '\${PWD}/ARTIST/ALBUM' (with sanitised
+ filenames).
-e FILE
--edit_rcfile=FILE
-f
--flac_copy
- In addition to encoding the CD audio tracks to MP3 or Ogg
- Vorbis, create a FLAC audio file for archival purposes.
+ In addition to encoding the CD audio tracks to Ogg/Vorbis or
+ MP3, create a FLAC audio file for archival purposes.
-h
--help
-o
--ogg
- Specify Ogg Vorbis encoding.
+ Specify Ogg/Vorbis encoding.
-O
--online
Attempt to grab the track info from freedb.freedb.org.
+ DO NOT USE.
+
+ freedb.org no longer exists. The plan is for zcdrip to
+ use MusicBrainz instead of freedb.org but it is not yet
+ implemented.
-p PLAYLISTFILE
--playlist=PLAYLISTFILE
lame http://www.mp3dev.org/
For encoding to MP3 format. (optional if encoding to
- Ogg Vorbis)
+ Ogg/Vorbis)
oggenc http://www.xiph.org/
- For encoding to Ogg Vorbis format (optional if encoding
+ For encoding to Ogg/Vorbis format (optional if encoding
to MP3)
flac http://flac.sourceforge.net/
Example Usage:
-------------
+ ## Note:
+ Currently, online metadata retrieval is not possible because freedb.org
+ no longer exists. We will be converting to MusicBrainz but that is yet
+ to be implemented. In the meantime, the examples below that use the
+ '-O' option are presently not valid.
Probably the most common usage would be to encode to Ogg/Vorbis
format using track info obtained from freedb.freedb.org. Like
EOF
}
+# Cover Art
+ARTWORK=$(pwd)/cover.jpg
# Convert song title to something resembling a sane filename... no
# whitespace, no punctuation, etc. Also adds .ogg/.mp3 extension.
done
}
+### FIXME: freedb.org no longer exists. Convert to MusicBrainz.
### freedb magic
_freedb_login ()
{
return 0
}
+### FIXME: freedb.org no longer exists. Convert to MusicBrainz.
_parse_cddb ()
{
local various=yes
}
+### FIXME: freedb.org no longer exists. Convert to MusicBrainz.
_freedb_read ()
{
if [[ -z $1 ]]; then
}
+### FIXME: freedb.org no longer exists. Convert to MusicBrainz.
_freedb_query ()
{
if [[ -z $1 ]]; then
esac
}
+### FIXME: freedb.org no longer exists. Convert to MusicBrainz.
do_online ()
{
autoload -U tcp_open
{
file=$1
shift # pop off $1 (flacfile)
- flac -8 --delete-input-file -o ${fdir}/${file} ${1}
+ [ -f ${ARTWORK} ] && PIC="--picture=${ARTWORK}" || PIC=""
+ flac -8 ${PIC} --delete-input-file -o ${fdir}/${file} ${1}
shift # pop off next arg (wavfile)
for tag in title artist album year genre tracknumber comment; do
metaflac --set-tag="$tag=${1}" ${fdir}/${file}
-N $i $wavfile
rm $wavfile
fi
+ [ -f ${ARTWORK} ] && album_art ${dir}/$filename[$i]
[[ $write_playlist == yes ]] && echo ${dir}/$filename[$i] >> $plfile
fi
done
# Make sure we have everything we need.
# This might be a little over the top, but I don't see any point in
# checking for `oggenc' if you are encoding to MP3, likewise, there's
-# no point in checking for `lame' if you are encoding to Ogg Vorbis.
+# no point in checking for `lame' if you are encoding to Ogg/Vorbis.
chkreqs ()
{
reqs=(cdparanoia lame oggenc flac)