logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 07-06-2016 23:13:52

Anonyme
Invité

Script pour copier un Compact Disc Audio.

Bonsoir,

je me suis fait ce petit script pour copier ou sauvegarder mes Compact Disc Audio.

./COPIE-AUDIOCD.sh


#!/bin/sh

## Programmes cdrdao cdrskin

## Recherche sur freedb  des informations sur le disque compact audio.
## RIP du CDA vers une image BIN + fichier TOC
## Correction des mauvais caractères dans le fichier TOC  ... [à compléter le cas échéant]
## Éjection et attente chargement du média
## N'écrase pas l'image existante si présente. [à améliorer]

 DEVICE=/dev/sr0

eject $DEVICE

echo "Appuyer Sur Touche [Entrée], Une Fois Le CD Chargé"
read touche
case $touche in
*)  echo "Reprise Du Travail..."
  ;;
esac

## CDDB INFO
 ALBUMNAME=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | sed 's/\// - /g'|awk '{$1=""; $2=""; $3=""; sub("  ", " "); print}'| sed s'/.$//' | awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1') \
 CDID=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | head -n1 | awk '{print $3}';) \
 TRACKLIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep TTITLE | awk -F  "=" '{print $2}';) \
 ARTIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep DTITLE | awk -F "=" '{print $2}' | awk -F "/" '{print $1}')

## RIP DU CD-AUDIO VERS UNE IMAGE BIN &  SON FICHIER TOC
read -p "RIP Du CD ? (yes/no)" reply
choice=$(echo $reply)
if [ "$choice" = 'yes' ]
then
  echo "Oui Sélectionné, RIP Dans Les 3 Seconds ";
  sleep 3;
cdrdao read-cd --source-device $DEVICE --driver generic-mmc --with-cddb --datafile  "$ALBUMNAME.bin" "$ALBUMNAME.toc"  
# CORRECTION DES MAUVAIS CARACTÈRES DANS LE FICHIERS
sed -i  -e 's/\\351/é/g' -e 's/\\350/è/g' -e 's/\\353/ë/g'  -e 's/\\352/ê/g' -e 's/\\340/à/g'  -e 's/\\342/â/g' -e 's/\\347/ç/g'  -e 's/\\356/î/g'  -e 's/\\364/ô/g' -e 's/\\373/û/g'  -e 's/\\371/ù/g'   "$ALBUMNAME.toc"  
elif [ "$choice" = 'no'  ]
then
echo "Non Sélectionné, Éjection Du CD ";
eject $DEVICE
exit
fi

read -p "Lancer La Gravure ? (yes/no)" reply
choice=$(echo $reply)
if [ "$choice" = 'yes' ]
then
eject $DEVICE
echo "Appuyer Sur La Touche [Entrée] Une Fois Le CD Chargé..."
read touche
case $touche in
*)  echo "Reprise Du Script..."
  ;;
esac
cdrskin -v dev=$DEVICE blank=fast  && cdrdao write --device $DEVICE "$ALBUMNAME.toc"  ;
elif [ "$choice" = 'no'  ]
then
echo "Non Sélectionné, Éjection Du CD ";
eject $DEVICE
exit
fi

eject $DEVICE
exit

 



Résultat :




./COPIE-AUDIOCD.sh
 





Appuyer Sur Touche [Entrée], Une Fois Le CD Chargé

Reprise Du Travail...

RIP Du CD ? (yes/no)yes
Oui Sélectionné, RIP Dans Les 3 Seconds

Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:00(     0)     04:22:47( 19697)
 2      AUDIO   0      04:22:47( 19697)     04:08:63( 18663)
Leadout AUDIO   0      08:31:35( 38360)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-2: start 00:00:00, length 08:31:35 to "Lara Fabian - Je t'aime.bin"...
Track 1...
Found ISRC code.
Track 2...
Found pre-gap: 00:00:16
Found ISRC code.
Found 267 Q sub-channels with CRC errors.
Found disk catalogue number.
CDDB: Connecting to cddbp://freedb.freedb.org:888 ...
CDDB: Ok.
Reading CDDB record for: 0e01ff02-misc-Lara Fabian / Je t'aime
CD-TEXT data was added to toc-file.
Reading of toc and track data finished successfully.
Lancer La Gravure ? (yes/no)yes
Appuyer Sur La Touche [Entrée] Une Fois Le CD Chargé...

Reprise Du Script...

cdrskin 1.3.2 : limited cdrecord compatibility wrapper for libburn
cdrskin: verbosity level : 1
cdrskin: NOTE : greying out all drives besides given dev='/dev/sr0'
cdrskin: scanning for devices ...
cdrskin: ... scanning for devices done
cdrskin: status 4 burn_disc_full "There is a disc with data on it in the drive"
Current: CD-RW
cdrskin: beginning to blank disc
Starting to write CD/DVD at speed MAX in real BLANK mode for single session.
Last chance to quit, starting real write in   0 seconds. Operation starts.
cdrskin: blanking done                                        
Blanking time:   23.003s
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Starting write at speed 10...
Pausing 10 seconds - hit CTRL-C to abort.
Process can be aborted with QUIT signal (usually CTRL-\).
WARNING: No super user permission to setup real time scheduling.
Turning BURN-Proof on
Enabling JustSpeed.
Executing power calibration...
Power calibration successful.
Writing track 01 (mode AUDIO/AUDIO )...
Writing track 02 (mode AUDIO/AUDIO )...
Wrote 86 of 86 MB (Buffers 100% 100%).
Wrote 38360 blocks. Buffer fill min 93%/max 100%.
Flushing cache...
Writing finished successfully
 

Dernière modification par Anonyme (10-06-2016 12:42:51)

#2 08-06-2016 12:48:56

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Quelques petites modifications :

Création du dossier avec le nom et titre.
Ouverture et Fermeture du tiroir


#!/bin/sh

## Programmes cdrdao cdrskin

## Recherche sur freedb  des informations sur le disque compact audio.
## Création du dossier ayant le nom de l'artiste et le titre de l'album [ le fichier BIN + TOC seront à l'intérieur ]
## RIP du CDA vers une image BIN + fichier TOC
## Correction des mauvais caractères dans le fichier TOC  ... [à compléter le cas échéant]
## Éjection et attente chargement du média
## Fermeture Auto
## N'écrase pas l'image existante si présente. [à améliorer]

 DEVICE=/dev/sr0

eject $DEVICE

echo "Mettre Le CD Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]"
read touche
case $touche in
*)  echo "Fermeture Du Tiroir Et Lancement Du RIP..."
  ;;
esac
eject -t $DEVICE
## CDDB INFO
 ALBUMNAME=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | sed 's/\// - /g'|awk '{$1=""; $2=""; $3=""; sub("  ", " "); print}'| sed s'/.$//' | awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1') \
 CDID=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | head -n1 | awk '{print $3}';) \
 TRACKLIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep TTITLE | awk -F  "=" '{print $2}';) \
 ARTIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep DTITLE | awk -F "=" '{print $2}' | awk -F "/" '{print $1}')

## TEST 2
################################################################
echo "Artist detected as: $ALBUMNAME"
# PERMET À L'UTILISATEUR DE MODIFIER LE NOM
# CRÉATION DU DOSSIER "ARTISTE + TITRE"
read -p "Le Nom Et Le Titre Sont-ils Correct ? (y/n) "  yn
case $yn in
        [Yy]* )
    mkdir "$ALBUMNAME" ;;
        [Nn]* )
    read -p "Entrez Les Informations Correctes: " ALBUMNAME
    mkdir "$ALBUMNAME";;
        * ) echo "Répondez Par Oui Ou Par Non, S'il Vous Plait.";;

esac
#################################################################



## RIP DU CD-AUDIO VERS UNE IMAGE BIN &  SON FICHIER TOC
read -p "RIP Du CD ? (yes/no)" reply
choice=$(echo $reply)
if [ "$choice" = 'yes' ]
then
  echo "Oui Sélectionné, RIP ... ";
  sleep 3;
cdrdao read-cd --source-device $DEVICE --driver generic-mmc --with-cddb --datafile  "$ALBUMNAME.bin" "$ALBUMNAME.toc"  
# CORRECTION DES MAUVAIS CARACTÈRES DANS LE FICHIERS
sed -i  -e 's/\\351/é/g' -e 's/\\350/è/g' -e 's/\\353/ë/g'  -e 's/\\352/ê/g' -e 's/\\340/à/g'  -e 's/\\342/â/g' -e 's/\\347/ç/g'  -e 's/\\356/î/g'  -e 's/\\364/ô/g' -e 's/\\373/û/g'  -e 's/\\371/ù/g'   "$ALBUMNAME.toc"  
elif [ "$choice" = 'no'  ]
then
echo "Non Sélectionné, Éjection Du CD ";
eject $DEVICE
exit
fi

## TEST 3 Pour ne pas avoir dans le fichier TOC un FILE / à rallonge  
###############################################################
# DÉPLACEMENT DES 3 FICHIERS DANS LE SOUS DOSSIER
mv "$ALBUMNAME.bin" "$ALBUMNAME"
mv "$ALBUMNAME.toc" "$ALBUMNAME"
################################################################

read -p "Lancer La Gravure ? (yes/no)" reply
choice=$(echo $reply)
if [ "$choice" = 'yes' ]
then
eject $DEVICE
echo "Mettre Le CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]"
read touche
case $touche in
*)  echo "Commencement De L'enregistrement ..."
  ;;
esac
eject -t $DEVICE


## TEST 1
#############################################
read -p "Enregistrement Du CD-R Ou Formatage Du CD-RW  ? (yes/no)" reply
choice=$(echo $reply)
if [ "$choice" = 'yes' ]
then
echo "Oui Sélectionné, Lancement Formatage ... ";
elif [ "$choice" = 'no'  ]
then
echo "Non Sélectionné, Éjection Du CD ";
eject $DEVICE
exit
fi
#############################################


cdrskin -v dev=$DEVICE blank=fast  && cdrdao write --device $DEVICE "$ALBUMNAME/$ALBUMNAME.toc"  ;
elif [ "$choice" = 'no'  ]
then
echo "Non Sélectionné, Éjection Du CD ";
eject $DEVICE
exit
fi

eject $DEVICE
exit

 



Terminal


patrick@debian:~/Bureau$ ./COPIE-AUDIOCD.sh
Mettre Le CD Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

Fermeture Du Tiroir Et Lancement Du RIP...
Artist detected as: Lara Fabian - Je t'aime
Le Nom Et Le Titre Sont-ils Correct ? (y/n) y
RIP Du CD ? (yes/no)yes
Oui Sélectionné, RIP ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:00(     0)     04:22:47( 19697)
 2      AUDIO   0      04:22:47( 19697)     04:08:63( 18663)
Leadout AUDIO   0      08:31:35( 38360)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-2: start 00:00:00, length 08:31:35 to "Lara Fabian - Je t'aime.bin"...
Track 1...
Found ISRC code.
Track 2...
Found pre-gap: 00:00:16
Found ISRC code.
Found 267 Q sub-channels with CRC errors.
Found disk catalogue number.
CDDB: Connecting to cddbp://freedb.freedb.org:888 ...
CDDB: Ok.
Reading CDDB record for: 0e01ff02-misc-Lara Fabian / Je t'aime
CD-TEXT data was added to toc-file.
Reading of toc and track data finished successfully.
Lancer La Gravure ? (yes/no)yes
Mettre Le CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

Commencement De L'enregistrement ...
Enregistrement Du CD-R Ou Formatage Du CD-RW  ? (yes/no)yes
Oui Sélectionné, Lancement Formatage ...
cdrskin 1.3.2 : limited cdrecord compatibility wrapper for libburn
cdrskin: verbosity level : 1
cdrskin: NOTE : greying out all drives besides given dev='/dev/sr0'
cdrskin: scanning for devices ...
cdrskin: ... scanning for devices done
cdrskin: status 4 burn_disc_full "There is a disc with data on it in the drive"
Current: CD-RW
cdrskin: beginning to blank disc
Starting to write CD/DVD at speed MAX in real BLANK mode for single session.
Last chance to quit, starting real write in   0 seconds. Operation starts.
cdrskin: blanking done                                        
Blanking time:   22.002s
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Starting write at speed 10...
Pausing 10 seconds - hit CTRL-C to abort.
Process can be aborted with QUIT signal (usually CTRL-\).
WARNING: No super user permission to setup real time scheduling.
Turning BURN-Proof on
Enabling JustSpeed.
Executing power calibration...
Power calibration successful.
Writing track 01 (mode AUDIO/AUDIO )...
Writing track 02 (mode AUDIO/AUDIO )...
Wrote 86 of 86 MB (Buffers 100% 100%).
Wrote 38360 blocks. Buffer fill min 93%/max 100%.
Flushing cache...
Writing finished successfully.
patrick@debian:~/Bureau$
 



Je continue à faire mumuse  smile

Dernière modification par Anonyme (08-06-2016 12:52:28)

#3 10-06-2016 08:26:14

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.


#!/bin/sh

## Programmes cdrdao

## Recherche sur freedb  des informations sur le disque compact audio.
## Création du dossier ayant le nom de l'artiste et le titre de l'album. [ les fichier *.bin + *.toc seront déplacé à l'intérieur ]
## RIP du CDA vers une image *.bin et un fichier *.toc sera crée.
## Correction des mauvais caractères dans le fichier T*.toc  ... [à compléter le cas échéant]
## Possibilité de créer un fichier *.cue.
## Éjection et attente chargement du média.
## Fermeture Auto
## N'écrase pas l'image existante si présente. [à améliorer]
## Vérification si le CD contient des données ou est vierge. ( Choix pour effacer ou pour changer de support )

 DEVICE=/dev/sr0

eject $DEVICE
echo "Charger Le CD Et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "Fermeture, Recherche Infos ..."
  ;;
esac
eject -t $DEVICE

## CDDB INFO
 ALBUMNAME=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | sed 's/\// - /g'|awk '{$1=""; $2=""; $3=""; sub("  ", " "); print}'| sed s'/.$//' | awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1') \
 CDID=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | head -n1 | awk '{print $3}';) \
 TRACKLIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep TTITLE | awk -F  "=" '{print $2}';) \
 ARTIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep DTITLE | awk -F "=" '{print $2}' | awk -F "/" '{print $1}')


# CRÉATION DU DOSSIER "ARTISTE + TITRE"
# PERMET À L'UTILISATEUR DE MODIFIER LE NOM
echo "Album Identifié : $ALBUMNAME"
read -p "Ces Informations Sont-elles Correctes ? (y/n) "  yn
case $yn in
        [Yy]* )
    mkdir "$ALBUMNAME" ;;
        [Nn]* )
    read -p "Entrez Les Informations Correctes: " ALBUMNAME
    mkdir "$ALBUMNAME";;
        * ) echo "Répondez Par Oui Ou Par Non, S'il Vous Plait.";;
esac

## RIP DU CD-AUDIO VERS UNE IMAGE BIN &  SON FICHIER TOC
read -p "Ripper Le CD ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "Création De L'image En Cours ... ";

cdrdao read-cd --source-device $DEVICE --driver generic-mmc --with-cddb --datafile  "$ALBUMNAME.bin" "$ALBUMNAME.toc"  

# CORRECTION DES MAUVAIS CARACTÈRES DANS LE FICHIERS
sed -i  -e 's/\\351/é/g' -e 's/\\350/è/g' -e 's/\\353/ë/g'  -e 's/\\352/ê/g' -e 's/\\340/à/g'  -e 's/\\342/â/g' -e 's/\\347/ç/g'  -e 's/\\356/î/g'  -e 's/\\364/ô/g' -e 's/\\373/û/g'  -e 's/\\371/ù/g'   "$ALBUMNAME.toc"  
elif [ "$choice" = 'n'  ]
then
echo "Éjection Du CD ";
rm -R  "$ALBUMNAME"
eject $DEVICE
exit
fi

## Création Du Fichier *.cue
read -p "Créer Le Fichier CUE ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
  echo "Création Du Fichier CUE ... ";

cueconvert -i toc -o cue "$ALBUMNAME.toc" "$ALBUMNAME.cue"
mv "$ALBUMNAME.cue" "$ALBUMNAME"
elif [ "$choice" = 'n'  ]
then
echo "Étape Suivante ... ";
fi

## DÉPLACEMENT DES 3 FICHIERS DANS LE SOUS DOSSIER
mv "$ALBUMNAME.bin" "$ALBUMNAME"
mv "$ALBUMNAME.toc" "$ALBUMNAME"


## GRAVAGE
read -p "Lancer La Gravure ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
eject $DEVICE
echo "Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]"
read touche
case $touche in
*)  echo "Chargement Du CD [Ré]inscriptible ..."
  ;;
esac
eject -t $DEVICE

echo "Vérification si le support présent dans le lecteur est bien vide ..."
cdrdao disk-info $DEVICE 2>&1 | grep 'empty ' | grep yes ;
 STATUS=$?
while [ $STATUS != "0" ] ; do

echo "Ce CD contient des données "
read -p "Faut-il [c]hanger de support ou [e]ffacer ce CD ? (c/e)" reply
choice=$(echo $reply)
if [ "$choice" = 'c' ]
then
  echo "Éjection Du CD ";
eject $DEVICE
echo "Charger le nouveau  CD et appuyer sur [Entrée]"
read touche
case $touche in
*)  echo "Fermeture ..."
  ;;
esac
eject -t $DEVICE

sleep 10

elif [ "$choice" = 'e'  ]
then
echo "Effacement en cours ... ";
cdrdao blank –device $DEVICE –blank-mode minimal

fi

cdrdao disk-info $DEVICE 2>&1 | grep 'empty' | grep yes ;
STATUS=$?
done
echo "Le CD est vide : OK"

fi

read -p "Graver le CD maintenant ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "Création du CD-Audio ... ";
cdrdao write --device  $DEVICE  --driver generic-mmc-raw  "$ALBUMNAME/$ALBUMNAME.toc"  ;
elif [ "$choice" = 'n'  ]
then
echo "Éjection Du CD";
eject $DEVICE
exit
fi
eject $DEVICE
exit
 

#4 10-06-2016 12:34:24

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Ça me parait pas mal pour l'instant :


patrick@debian:~/Bureau$ ./Compact-Disc-Audio.sh
Charger Le Compact Disc Audio Et Appuyer Sur [Entrée]

Fermeture, Recherche Infos ...
Album Identifié : Lara Fabian - Je t'aime
Ces Informations Sont-elles Exactes ? (y/n) y
Ripper Le Compact Disc Audio ? (y/n)y
Création De L'image En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:00(     0)     04:22:47( 19697)
 2      AUDIO   0      04:22:47( 19697)     04:08:63( 18663)
Leadout AUDIO   0      08:31:35( 38360)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-2: start 00:00:00, length 08:31:35 to "Lara Fabian - Je t'aime.bin"...
Track 1...
Found ISRC code.
Track 2...
Found pre-gap: 00:00:16
Found ISRC code.
Found 262 Q sub-channels with CRC errors.
Found disk catalogue number.
CDDB: Connecting to cddbp://freedb.freedb.org:888 ...
CDDB: Ok.
Reading CDDB record for: 0e01ff02-misc-Lara Fabian / Je t'aime
CD-TEXT data was added to toc-file.
Reading of toc and track data finished successfully.
Créer Le Fichier CUE ? (y/n)y
Création Du Fichier CUE ...
Lancer La Gravure ? (y/n)y
Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

Chargement Du CD [Ré]inscriptible ...
Vérification Si Le Support Inséré Est Bien Vide ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support Ou [E]ffacer Ce CD ? (c/e)c
Éjection Du CD
Charger Le Nouveau CD Et Appuyer Sur [Entrée]

Fermeture ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support Ou [E]ffacer Ce CD ? (c/e)e
Effacement En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Blanking disk...
ERROR: Cannot erase CD-RW.
ERROR: Blanking failed.
Ce CD Contient Des Données
Faut-il [C]hanger De Support Ou [E]ffacer Ce CD ? (c/e)c
Éjection Du CD
Charger Le Nouveau CD Et Appuyer Sur [Entrée]

Fermeture ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support Ou [E]ffacer Ce CD ? (c/e)e
Effacement En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Blanking disk...
Blanking time: 22 seconds
CD-R empty           : yes
Le CD Est Vide : OK
Graver Le CD Maintenant ? (y/n)y
Création Du CD-Audio ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC (raw writing) - Version 2.0 (options 0x0000)

Starting write at speed 10...
Pausing 10 seconds - hit CTRL-C to abort.
Process can be aborted with QUIT signal (usually CTRL-\).
Turning BURN-Proof on
Enabling JustSpeed.
Using 96 byte raw P-W sub-channel data mode for CD-TEXT.
Executing power calibration...
Power calibration successful.
WARNING: No super user permission to setup real time scheduling.
Writing lead-in and gap...
Writing track 01 (mode AUDIO/AUDIO )...
Writing track 02 (mode AUDIO/AUDIO )...
Wrote 86 of 86 MB (Buffers 100% 100%).
Wrote 38360 blocks. Buffer fill min 100%/max 100%.
Writing lead-out...
Wrote 15 of 15 MB.
Flushing cache...
Writing finished successfully.
patrick@debian:~/Bureau$
 

Dernière modification par Anonyme (10-06-2016 12:35:55)

#5 10-06-2016 12:41:06

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

J'aurais bien voulu qu'a la détection d'un support non-réinscriptible et non vide que le support soit éjecté directement.  Mais je ne trouve pas le moyen de mettre ça dans le script tongue

#6 10-06-2016 18:04:13

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : Script pour copier un Compact Disc Audio.

Salut mon pote ! cool

Tu as bien bossé j'avais aussi comme projet de faire un script pour copier mes 300 CD sur disque dur.
Ben j'ai plus qu'à me servir ! tonguecool

Je teste ça au plus vite... 

Anonyme a écrit :

J'aurais bien voulu qu'a la détection d'un support non-réinscriptible et non vide que le support soit éjecté directement.  Mais je ne trouve pas le moyen de mettre ça dans le script tongue



Je te promets rien mais j'y réfléchis et je te fais savoir si j'ai une inspiration !

A+

Dernière modification par Slyfox (10-06-2016 18:05:34)

Hors ligne

#7 10-06-2016 19:30:14

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Salut Slyfox smile


cdrdao disk-info /dev/sr0 2>&1 | grep 'CD-R empty, CD-RW '  | grep yes ;
 



Je pense que cette commande est bonne:
Je cherche des CD-R vide ou tous CD-RW vides ou pleins .... si le média chargé ne correspond pas

Là, je met "1"
STATUS=$?
while [ $STATUS != "1" ] ; do

Ça  éjecte les CD illico  tant que le bon média n'est pas chargé. Qu'en penses-tu ? tongue

Dernière modification par Anonyme (10-06-2016 19:31:12)

#8 10-06-2016 22:22:52

Slyfox
Membre
Distrib. : Linux pop-os
Noyau : Linux 6.2.6-76060206-generic
(G)UI : GNOME
Inscription : 15-12-2013

Re : Script pour copier un Compact Disc Audio.

Anonyme a écrit :

Ça  éjecte les CD illico  tant que le bon média n'est pas chargé. Qu'en penses-tu ? tongue



Personnellement je pense que "utilisateur" doit pouvoir avoir la possibilité de faire ce choix. J’opterai plutôt pour un "message d'erreur" dans une boucle while, qui peut être interrompu soit par un quitter ou une éjection ou une autre option.

A+

Hors ligne

#9 10-06-2016 23:06:41

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Regarde ici :

wink

Les deux lignes magiques :
http://ubuntuforums.org/archive/index.p … 87752.html

Je les teste:



#!/bin/sh


eject -t /dev/sr0

echo "Vérification Si Le Support Inséré Est Bien Le Bon ..."
cdrdao disk-info --device /dev/sr0 2>&1 | grep CD-RW | awk '{print $3}' | grep  yes;
cdrdao disk-info --device /dev/sr0 2>&1 | grep "CD-R empty" | awk '{print $4}' | grep  yes;

STATUS=$?
while [ $STATUS != "0" ] ; do

echo "Éjection Du CD ";

eject /dev/sr0
echo "Charger Le Bon CD Et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "Fermeture ..."
  ;;
esac
eject -t /dev/sr0


cdrdao disk-info --device /dev/sr0 2>&1 | grep CD-RW | awk '{print $3}' | grep  yes;
cdrdao disk-info --device /dev/sr0 2>&1 | grep "CD-R empty" | awk '{print $4}' | grep  yes;
STATUS=$?
done
echo "C'est Le Bon Support !!!"
 





./TEST-SUPPORT

Vérification Si Le Support Inséré Est Bien Le Bon ...
yes
yes
C'est Le Bon Support !!!



CD-R Vierge
YES
YES

CD-R Utilisé
0
0

CD-RW Plein
YES
0                  ==============================>   C'est là que ça merdouille et en plus c'est logique    tongue

CD-RW Vide
YES
YES

CD-A
0
0

smile

Slyfox a écrit :


Personnellement je pense que "utilisateur" doit pouvoir avoir la possibilité de faire ce choix. J’opterai plutôt pour un "message d'erreur" dans une boucle while, qui peut être interrompu soit par un quitter ou une éjection ou une autre option.



C'est ce que fait dans le même genre mon script  smile

Dernière modification par Anonyme (11-06-2016 00:07:54)

#10 11-06-2016 10:58:26

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Bonjour,

il manque la possibilité de quitter le programme après la création du BIN + TOC + CUE
Je rajoute ça .... et je post smile

#11 11-06-2016 12:38:45

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.


#!/bin/sh

## @Anonyme @Slyfox
## Programmes cdrdao cuetools

## Recherche sur freedb  des informations sur le disque compact audio.
## Création du dossier ayant le nom de l'artiste et le titre de l'album. [ les fichier *.bin + *.toc seront déplacé à l'intérieur ]
## RIP du CDA vers une image *.bin et un fichier *.toc sera crée.
## Correction des mauvais caractères dans le fichier T*.toc  ... [à compléter le cas échéant]
## Possibilité de créer un fichier *.cue.
## Éjection et attente chargement du média.
## Fermeture Auto
## N'écrase pas l'image existante si présente. [à améliorer]
## Vérification si le CD contient des données ou est vierge. ( Choix pour effacer ou pour changer de support )
## N'efface pas  un CD-RW vide.
## Pas de CD-R ou CD-RW lors du lancement de la gravure. [ possibilité de quitter]

 DEVICE=/dev/sr0

eject $DEVICE
echo "Charger Le CD Et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "Fermeture, Recherche Infos ..."
  ;;
esac
eject -t $DEVICE

## CDDB INFO
 ALBUMNAME=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | sed 's/\// - /g'|awk '{$1=""; $2=""; $3=""; sub("  ", " "); print}'| sed s'/.$//' | awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1') \
 CDID=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | head -n1 | awk '{print $3}';) \
 TRACKLIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep TTITLE | awk -F  "=" '{print $2}';) \
 ARTIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep DTITLE | awk -F "=" '{print $2}' | awk -F "/" '{print $1}')


## CRÉATION DU DOSSIER "ARTISTE + TITRE" /  PERMET À L'UTILISATEUR DE MODIFIER LE NOM

echo "Album Identifié : $ALBUMNAME"
read -p "Ces Informations Sont-elles Correctes ? (y/n) "  yn
case $yn in
        [Yy]* )
    mkdir "$ALBUMNAME" ;;
        [Nn]* )
    read -p "Entrez Les Informations Correctes: " ALBUMNAME
    mkdir "$ALBUMNAME";;
        * ) echo "Répondez Par Oui Ou Par Non, S'il Vous Plait.";;
esac

## RIP DU CD-AUDIO VERS UNE IMAGE BIN &  SON FICHIER TOC
read -p "Ripper Le CD ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "Création De L'image En Cours ... ";

cdrdao read-cd --source-device $DEVICE --driver generic-mmc --with-cddb --datafile  "$ALBUMNAME.bin" "$ALBUMNAME.toc"  

## CORRECTION DES MAUVAIS CARACTÈRES DANS LE FICHIER TOC
sed -i  -e 's/\\351/é/g' -e 's/\\350/è/g' -e 's/\\353/ë/g'  -e 's/\\352/ê/g' -e 's/\\340/à/g'  -e 's/\\342/â/g' -e 's/\\347/ç/g'  -e 's/\\356/î/g'  -e 's/\\364/ô/g' -e 's/\\373/û/g'  -e 's/\\371/ù/g'   "$ALBUMNAME.toc"  
elif [ "$choice" = 'n'  ]
then
echo "Éjection Du CD ";
rm -R  "$ALBUMNAME"
eject $DEVICE
exit
fi

## CRÉATION DU FICHIER CUE
read -p "Créer Le Fichier CUE ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
  echo "Création Du Fichier CUE ... ";

cueconvert -i toc -o cue "$ALBUMNAME.toc" "$ALBUMNAME.cue"
mv "$ALBUMNAME.cue" "$ALBUMNAME"
elif [ "$choice" = 'n'  ]
then
echo "Étape Suivante ... ";
fi

## DÉPLACEMENT DES 2 FICHIERS DANS LE DOSSIER
mv "$ALBUMNAME.bin" "$ALBUMNAME"
mv "$ALBUMNAME.toc" "$ALBUMNAME"


## GRAVAGE
read -p "Lancer La Gravure ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
eject $DEVICE
echo "Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]"
read touche
case $touche in
*)  echo "Chargement Du CD [Ré]inscriptible ..."
  ;;
esac
eject -t $DEVICE
elif [ "$choice" = 'n'  ]
then
echo "Opération Terminée ";
eject $DEVICE
exit
fi

echo "Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ..."
cdrdao disk-info $DEVICE 2>&1 | grep 'empty ' | grep yes ;
 STATUS=$?
while [ $STATUS != "0" ] ; do

echo "Ce CD contient des données "
read -p "Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [N] Abandonner La Gravure ? (c/e/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'c' ]
then
  echo "Éjection Du CD ";
eject $DEVICE
echo "Charger Un Nouveau Support et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "Fermeture ..."
  ;;
esac
eject -t $DEVICE

sleep 10

elif [ "$choice" = 'e'  ]
then
echo "Effacement En Cours ... ";
cdrdao blank –device $DEVICE –blank-mode minimal
elif [ "$choice" = 'n'  ]
then
echo "Pas De CD-R[W] Vide Sous La Main - Opération Terminée.  ";
eject $DEVICE
exit

fi

cdrdao disk-info $DEVICE 2>&1 | grep 'empty' | grep yes ;
STATUS=$?
done
echo "Le CD Est Vide : OK"
read -p "Graver le CD Maintenant ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "Création Du CD-Audio ... ";
## cdrdao write image.cue ????
cdrdao write --device  $DEVICE  --driver generic-mmc-raw  "$ALBUMNAME/$ALBUMNAME.toc"  ;
elif [ "$choice" = 'n'  ]
then
echo "Éjection Du CD";
eject $DEVICE
exit
fi
eject $DEVICE
exit
 

Dernière modification par Anonyme (11-06-2016 12:40:03)

#12 11-06-2016 17:46:59

MicP
Membre
Inscription : 29-02-2016

Re : Script pour copier un Compact Disc Audio.

Anonyme a écrit :

…J'aurais bien voulu qu'a la détection d'un support non-réinscriptible et non vide que le support soit éjecté directement.  Mais je ne trouve pas le moyen de mettre ça dans le script…

Regarde du côté de udisksctl : Tu entre la commande suivante et tu regarde ce qu'il se passe quand tu insère un CD (audio ou autre…) dans le lecteur.

udisksctl monitor

Hors ligne

#13 11-06-2016 18:48:19

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Bonsoir MicP

Très intéressant, ça doit être faisable avec ça !!!  smile

Je n'ai pas de CD-R vierges sous la main pour voir si les info diffèrent avec les CD-R utilisés

CD-R utilisés


udisksctl monitor

Monitoring the udisks daemon. Press Ctrl+C to exit.
19:40:59.968: The udisks-daemon is running (name-owner :1.17).
19:41:13.515: /org/freedesktop/UDisks2/drives/PLEXTOR_DVDR___PX_880SA_3743524162_238028500: org.freedesktop.UDisks2.Drive: Properties Changed
  TimeMediaDetected:            1465666873514032
  OpticalNumAudioTracks:        11
  OpticalNumTracks:             11
  OpticalNumSessions:           1
  Optical:                      true
  Media:                        optical_cd_r
  MediaAvailable:               true
  Size:                         702908416
19:41:13.515: /org/freedesktop/UDisks2/block_devices/sr0: org.freedesktop.UDisks2.Block: Properties Changed
  Size:                 702908416

 



Si tu en as un sous la main, pourrais-tu me poster le résultat pour la différence d'info   (Si il y a) ?  ... C'est là que ça pourra ce faire.

EDIT : j'ai parlé trop vite, on peut jouer sur ça :


  OpticalNumAudioTracks:        11
  OpticalNumTracks:             11
  OpticalNumSessions:           1
 



Un CD-R non utilisé devrait indiqué


  OpticalNumAudioTracks:       0
  OpticalNumTracks:             0
  OpticalNumSessions:          0
 



Ou une info allant dans ce sens ....

Dernière modification par Anonyme (11-06-2016 18:51:53)

#14 11-06-2016 21:49:11

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

La solution est peut-être là  !!!!   smile

http://ubuntuforums.org/archive/index.p … 87752.html

En tout cas, en bidouillant .... le CD-R déjà enregistré ... il est ejecté illico mais pour bidouiller mon script je rame comme c'est pas possible !!! lol

#15 12-06-2016 00:58:22

MicP
Membre
Inscription : 29-02-2016

Re : Script pour copier un Compact Disc Audio.

Une fois qu'un disque audio est inséré dans le lecteur, tu peux utiliser cette ligne de commande pour extraire le nombre de pistes audio détectées

udisksctl info -d PLEXTOR_DVDR___PX_880SA_3743524162_238028500 | awk '/OpticalNumAudioTracks:/ {print $2}'

Dans la ligne de commande ci-dessus, tu pourra changer OpticalNumAudioTracks: par ce qui te conviens en fonction du retour de :

udisksctl info -d PLEXTOR_DVDR___PX_880SA_3743524162_238028500

Dernière modification par MicP (12-06-2016 00:59:18)

Hors ligne

#16 12-06-2016 20:15:46

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

@MicP

Merci wink

Moi, de mon coté, j'arrive pas à faire ce que je veux. Détection du CDR PLEIN qui s'éjecte hmm
Bon, c'est pas grave.

#17 12-06-2016 20:26:43

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Si quelqu'un peut essayer ce script et me faire retour :

Le script dans son état actuel :


#!/bin/sh

## @Anonyme
## Programmes cdrdao cuetools

## Recherche sur freedb  des informations sur le disque compact audio.
## Création du dossier ayant le nom de l'artiste et le titre de l'album. [ les fichier *.bin + *.toc seront déplacé à l'intérieur ]
## RIP du CDA vers une image *.bin et un fichier *.toc sera crée.
## Correction des mauvais caractères dans le fichier T*.toc  ... [à compléter le cas échéant]
## Possibilité de créer un fichier *.cue.
## Éjection et attente chargement du média.
## Fermeture Auto
## N'écrase pas l'image existante si présente. [à améliorer]
## Vérification si le CD contient des données ou est vierge. ( Choix pour effacer ou pour changer de support )
## N'efface pas  un CD-RW vide.
## Pas de CD-R ou CD-RW lors du lancement de la gravure. [ possibilité de quitter]

VERT="\\033[1;32m"
VERTCLAIR="\033[32m"
NORMAL="\\033[0;39m"
ROUGE="\\033[1;31m"
ROSE="\\033[1;35m"
BLEU="\\033[1;34m"
BLANC="\\033[0;02m"
BLANCLAIR="\\033[1;08m"
JAUNE="\\033[1;33m"
CYAN="\\033[1;36m"





DEVICE=/dev/sr0

echo "$VERTCLAIR Ouverture Du Lecteur $NORMAL"
 eject $DEVICE
echo "Charger Le Compact Disc Audio, Puis Touche $BLEU[Entrée]$NORMAL "
read touche
case $touche in
*)  echo "$VERTCLAIR Fermeture, Recherche Infos ...$NORMAL"
  ;;
esac
eject -t $DEVICE

## CDDB INFO
 ALBUMNAME=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | sed 's/\// - /g'|awk '{$1=""; $2=""; $3=""; sub("  ", " "); print}'| sed s'/.$//' | awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1') \
 CDID=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | head -n1 | awk '{print $3}';) \
 TRACKLIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep TTITLE | awk -F  "=" '{print $2}';) \
 ARTIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep DTITLE | awk -F "=" '{print $2}' | awk -F "/" '{print $1}')


## CRÉATION DU DOSSIER "ARTISTE + TITRE" /  PERMET À L'UTILISATEUR DE MODIFIER LE NOM

echo "Album Identifié : $JAUNE $ALBUMNAME $NORMAL"
read -p "Ces Informations Sont-elles Correctes ? (y/n) "  yn
case $yn in
        [Yy]* )
    mkdir "$ALBUMNAME" ;;
        [Nn]* )
    read -p "Entrez Les Informations Correctes: " ALBUMNAME
    mkdir "$ALBUMNAME";;
        * ) echo "Répondre Par Oui Ou Par Non.";;
esac

## RIP DU CD-AUDIO VERS UNE IMAGE BIN &  SON FICHIER TOC
read -p "Ripper Le Compact Disc Audio ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "$VERTCLAIR Création De L'image En Cours ...$NORMAL";

cdrdao read-cd --source-device $DEVICE --driver generic-mmc --with-cddb --datafile  "$ALBUMNAME.bin" "$ALBUMNAME.toc"  

## CORRECTION DES MAUVAIS CARACTÈRES DANS LE FICHIER TOC
sed -i  -e 's/\\351/é/g' -e 's/\\350/è/g' -e 's/\\353/ë/g'  -e 's/\\352/ê/g' -e 's/\\340/à/g'  -e 's/\\342/â/g' -e 's/\\347/ç/g'  -e 's/\\356/î/g'  -e 's/\\364/ô/g' -e 's/\\373/û/g'  -e 's/\\371/ù/g'   "$ALBUMNAME.toc"  
elif [ "$choice" = 'n'  ]
then
echo "Éjection Du CD";
rm -R  "$ALBUMNAME"
eject $DEVICE
echo "$VERTCLAIR Opération Abandonnée $VERTCLAIR"
exit
fi

## CRÉATION DU FICHIER CUE
read -p "Créer Le Fichier CUE ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
  echo "$VERTCLAIR Création Du Fichier CUE ...$NORMAL";

cueconvert -i toc -o cue "$ALBUMNAME.toc" "$ALBUMNAME.cue"
mv "$ALBUMNAME.cue" "$ALBUMNAME"
elif [ "$choice" = 'n'  ]
then
echo "$VERTCLAIR Étape Suivante ...$NORMAL";
fi

## DÉPLACEMENT DES 2 FICHIERS DANS LE DOSSIER
mv "$ALBUMNAME.bin" "$ALBUMNAME"
mv "$ALBUMNAME.toc" "$ALBUMNAME"


## GRAVAGE
read -p "Lancer La Gravure ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
eject $DEVICE
echo "Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]"
read touche
case $touche in
*)  echo "$VERTCLAIR Chargement Du CD [Ré]inscriptible ...$NORMAL"
  ;;
esac
eject -t $DEVICE
elif [ "$choice" = 'n'  ]
then
echo "$VERTCLAIR Opération Terminée $NORMAL";
eject $DEVICE
exit
fi

echo "$VERTCLAIR Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...$NORMAL"
cdrdao disk-info $DEVICE 2>&1 | grep 'empty ' | grep yes ;
 STATUS=$?
while [ $STATUS != "0" ] ; do

echo "Ce CD Contient Des Données "
read -p "Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)" reply
choice=$(echo $reply)
if [ "$choice" = 'c' ]
then
  echo "$VERTCLAIR Éjection Du CD $VERTCLAIR";
eject $DEVICE
echo "Charger Un Nouveau Support et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "$VERTCLAIR Fermeture ...$NORMAL"
  ;;
esac
eject -t $DEVICE

sleep 10

elif [ "$choice" = 'e'  ]
then
echo "$VERTCLAIR Effacement En Cours ...$NORMAL";
cdrdao blank –device $DEVICE –blank-mode minimal
elif [ "$choice" = 'a'  ]
then
echo "Pas De CD-R[W] Vide Sous La Main - Opération Terminée.  ";
eject $DEVICE
exit

fi

cdrdao disk-info $DEVICE 2>&1 | grep 'empty' | grep yes ;
STATUS=$?
done
echo "Le CD Est Vide : OK"
read -p "Graver le CD Maintenant ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "$VERTCLAIR Création Du CD-Audio ...$NORMAL";
cdrdao write --device  $DEVICE  --driver generic-mmc-raw  "$ALBUMNAME/$ALBUMNAME.toc"  ;
elif [ "$choice" = 'n'  ]
then
echo "$VERTCLAIR Éjection Du CD $NORMAL";
eject $DEVICE
exit
fi
eject $DEVICE
exit
 



J'ai fais un test complet en me trompant volontairement lors de l'insertion d'un support vierge. J'ai mis un CD-R déjà enregistré.


patrick@debian:~/Bureau$ ./Compact-Disc-Audio.sh
 Ouverture Du Lecteur
Charger Le Compact Disc Audio, Puis Touche [Entrée]

 Fermeture, Recherche Infos ...
Album Identifié :  Lara Fabian - Je t'aime
Ces Informations Sont-elles Correctes ? (y/n) y
Ripper Le Compact Disc Audio ? (y/n)y
 Création De L'image En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:00(     0)     04:22:47( 19697)
 2      AUDIO   0      04:22:47( 19697)     04:08:63( 18663)
Leadout AUDIO   0      08:31:35( 38360)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-2: start 00:00:00, length 08:31:35 to "Lara Fabian - Je t'aime.bin"...
Track 1...
Found ISRC code.
Track 2...
Found pre-gap: 00:00:16
Found ISRC code.
Found 254 Q sub-channels with CRC errors.
Found disk catalogue number.
CDDB: Connecting to cddbp://freedb.freedb.org:888 ...
CDDB: Ok.
Reading CDDB record for: 0e01ff02-misc-Lara Fabian / Je t'aime
CD-TEXT data was added to toc-file.
Reading of toc and track data finished successfully.
Créer Le Fichier CUE ? (y/n)y
 Création Du Fichier CUE ...
Lancer La Gravure ? (y/n)y
Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

 Chargement Du CD [Ré]inscriptible ...
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)e
 Effacement En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Blanking disk...
ERROR: Cannot erase CD-RW.
ERROR: Blanking failed.
Ce CD Contient Des Données
Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)c
 Éjection Du CD
Charger Un Nouveau Support et Appuyer Sur [Entrée]

 Fermeture ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)e
 Effacement En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Blanking disk...
Blanking time: 22 seconds
CD-R empty           : yes
Le CD Est Vide : OK
Graver le CD Maintenant ? (y/n)y
 Création Du CD-Audio ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC (raw writing) - Version 2.0 (options 0x0000)

Starting write at speed 10...
Pausing 10 seconds - hit CTRL-C to abort.
Process can be aborted with QUIT signal (usually CTRL-\).
Turning BURN-Proof on
Enabling JustSpeed.
Using 96 byte raw P-W sub-channel data mode for CD-TEXT.
Executing power calibration...
Power calibration successful.
WARNING: No super user permission to setup real time scheduling.
Writing lead-in and gap...
Writing track 01 (mode AUDIO/AUDIO )...
Writing track 02 (mode AUDIO/AUDIO )...
Wrote 86 of 86 MB (Buffers 100% 100%).
Wrote 38360 blocks. Buffer fill min 100%/max 100%.
Writing lead-out...
Wrote 15 of 15 MB.
Flushing cache...
Writing finished successfully.
patrick@debian:~/Bureau$
 




C'est juste la partie de ce message qui ne me plait pas. Il faudrait que la seconde proposition


Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)e
 



[E]ffacer Ce CD, ne soit plus proposé. tongue
Un truc du genre : changer et réessayer



Blanking disk...
ERROR: Cannot erase CD-RW.
ERROR: Blanking failed.
Ce CD Contient Des Données
Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)c
 Éjection Du CD
Charger Un Nouveau Support et Appuyer Sur [Entrée]

 Fermeture ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)e
 

Dernière modification par Anonyme (12-06-2016 20:42:36)

#18 12-06-2016 23:39:37

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

J'en suis pas loin, même si j'ai pas tout compris :  tongue

CD-R Non-Vierge, CD-Audio puis CD-RW


Lancer La Gravure ? (y/n)y
Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

 Chargement Du CD [Ré]inscriptible ...
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
Ce CD N'est Plus Writable
Faut-il [C]hanger De Support Ou [A] Abandonner La Gravure ? (c/a)c
 Éjection Du CD
Charger Un Nouveau Support et Appuyer Sur [Entrée]

 Fermeture ...
Ce CD N'est Plus Writable
Faut-il [C]hanger De Support Ou [A] Abandonner La Gravure ? (c/a)c
 Éjection Du CD
Charger Un Nouveau Support et Appuyer Sur [Entrée]

 Fermeture ...
CD-R empty           : yes
OK
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
CD-R empty           : yes
Le CD Est Vide : OK
Graver le CD Maintenant ? (y/n)
 




CD-RW Direct en premier chargement


Lancer La Gravure ? (y/n)y
Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

 Chargement Du CD [Ré]inscriptible ...
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
CD-RW                : yes
OK
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
CD-R empty           : yes
Le CD Est Vide : OK
Graver le CD Maintenant ? (y/n)
 

Dernière modification par Anonyme (12-06-2016 23:45:26)

#19 13-06-2016 00:23:10

Anonyme
Invité

Re : Script pour copier un Compact Disc Audio.

Et voilà, ça fonctionne !!!

Le script :


#!/bin/sh

#!/bin/sh

## @Anonyme
## Programmes cdrdao cuetools

## Recherche sur freedb  des informations sur le disque compact audio.
## Création du dossier ayant le nom de l'artiste et le titre de l'album. [ les fichier *.bin + *.toc seront déplacé à l'intérieur ]
## RIP du CDA vers une image *.bin et un fichier *.toc sera crée.
## Correction des mauvais caractères dans le fichier T*.toc  ... [à compléter le cas échéant]
## Possibilité de créer un fichier *.cue.
## Éjection et attente chargement du média.
## Fermeture Auto
## N'écrase pas l'image existante si présente. [à améliorer]
## Vérification si le CD contient des données ou est vierge. ( Choix pour effacer ou pour changer de support )
## N'efface pas  un CD-RW vide.
## Pas de CD-R ou CD-RW lors du lancement de la gravure. [ possibilité de quitter]
## Refuse un CD-R  non vierge !!!


VERT="\\033[1;32m"
VERTCLAIR="\033[32m"
NORMAL="\\033[0;39m"
ROUGE="\\033[1;31m"
ROSE="\\033[1;35m"
BLEU="\\033[1;34m"
BLANC="\\033[0;02m"
BLANCLAIR="\\033[1;08m"
JAUNE="\\033[1;33m"
CYAN="\\033[1;36m"

DEVICE=/dev/sr0

echo "$VERTCLAIR Ouverture Du Lecteur $NORMAL"
 eject $DEVICE
echo "Charger Le Compact Disc Audio, Puis Touche $BLEU[Entrée]$NORMAL "
read touche
case $touche in
*)  echo "$VERTCLAIR Fermeture, Recherche Infos ...$NORMAL"
  ;;
esac
eject -t $DEVICE

## CDDB INFO
 ALBUMNAME=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | sed 's/\// - /g'|awk '{$1=""; $2=""; $3=""; sub("  ", " "); print}'| sed s'/.$//' | awk '{gsub(/^[ \t]+|[ \t]+$/,"")};1') \
 CDID=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+query+$(cd-discid $DEVICE | sed 's/ /+/g')&hello=user+hostname+cdparanoia+3&proto=3" | head -n1 | awk '{print $3}';) \
 TRACKLIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep TTITLE | awk -F  "=" '{print $2}';) \
 ARTIST=$(curl -s "http://freedb.freedb.org/~cddb/cddb.cgi?cmd=cddb+read+misc+$CDID&hello=name+hostname+cdparanoia+3&proto=1" | grep DTITLE | awk -F "=" '{print $2}' | awk -F "/" '{print $1}')


## CRÉATION DU DOSSIER "ARTISTE + TITRE" /  PERMET À L'UTILISATEUR DE MODIFIER LE NOM

echo "Album Identifié : $JAUNE $ALBUMNAME $NORMAL"
read -p "Ces Informations Sont-elles Correctes ? (y/n) "  yn
case $yn in
        [Yy]* )
    mkdir "$ALBUMNAME" ;;
        [Nn]* )
    read -p "Entrez Les Informations Correctes: " ALBUMNAME
    mkdir "$ALBUMNAME";;
        * ) echo "Répondre Par Oui Ou Par Non.";;
esac

## RIP DU CD-AUDIO VERS UNE IMAGE BIN &  SON FICHIER TOC
read -p "Ripper Le Compact Disc Audio ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "$VERTCLAIR Création De L'image En Cours ...$NORMAL";

cdrdao read-cd --source-device $DEVICE --driver generic-mmc --with-cddb --datafile  "$ALBUMNAME.bin" "$ALBUMNAME.toc"  

## CORRECTION DES MAUVAIS CARACTÈRES DANS LE FICHIER TOC
sed -i  -e 's/\\351/é/g' -e 's/\\350/è/g' -e 's/\\353/ë/g'  -e 's/\\352/ê/g' -e 's/\\340/à/g'  -e 's/\\342/â/g' -e 's/\\347/ç/g'  -e 's/\\356/î/g'  -e 's/\\364/ô/g' -e 's/\\373/û/g'  -e 's/\\371/ù/g'   "$ALBUMNAME.toc"  
elif [ "$choice" = 'n'  ]
then
echo "Éjection Du CD";
rm -R  "$ALBUMNAME"
eject $DEVICE
echo "$VERTCLAIR Opération Abandonnée $VERTCLAIR"
exit
fi

## CRÉATION DU FICHIER CUE
read -p "Créer Le Fichier CUE ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
  echo "$VERTCLAIR Création Du Fichier CUE ...$NORMAL";

cueconvert -i toc -o cue "$ALBUMNAME.toc" "$ALBUMNAME.cue"
mv "$ALBUMNAME.cue" "$ALBUMNAME"
elif [ "$choice" = 'n'  ]
then
echo "$VERTCLAIR Étape Suivante ...$NORMAL";
fi

## DÉPLACEMENT DES 2 FICHIERS DANS LE DOSSIER
mv "$ALBUMNAME.bin" "$ALBUMNAME"
mv "$ALBUMNAME.toc" "$ALBUMNAME"


## GRAVAGE
read -p "Lancer La Gravure ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
eject $DEVICE
echo "Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]"
read touche
case $touche in
*)  echo "$VERTCLAIR Chargement Du CD [Ré]inscriptible ...$NORMAL"
  ;;
esac
eject -t $DEVICE
elif [ "$choice" = 'n'  ]
then
echo "$VERTCLAIR Opération Terminée $NORMAL";
eject $DEVICE
exit

fi

echo "$VERTCLAIR Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...$NORMAL"
cdrdao disk-info /dev/sr0 2>&1| grep 'CD-RW ' | grep yes  ;
STATUS=$?
while [ $STATUS != "0" ] ; do
echo "Ce CD N'est Plus Writable "
read -p "Faut-il [C]hanger De Support Ou [A] Abandonner La Gravure ? (c/a)" reply
choice=$(echo $reply)
if [ "$choice" = 'c' ]
then
  echo "$VERTCLAIR Éjection Du CD $VERTCLAIR";
eject  $DEVICE
echo "Charger Un Nouveau Support et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "$VERTCLAIR Fermeture ...$NORMAL"
  ;;
esac
eject -t $DEVICE

sleep 10

elif [ "$choice" = 'a'  ]
then
echo "Pas De CD-R[W] Vide Sous La Main - Opération Terminée.  ";
eject $DEVICE
exit

fi

cdrdao disk-info $DEVICE 2>&1 | grep 'empty' | grep yes ;
STATUS=$?
done
echo "OK"

echo "$VERTCLAIR Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...$NORMAL"
cdrdao disk-info $DEVICE 2>&1 | grep 'empty ' | grep yes ;
 STATUS=$?
while [ $STATUS != "0" ] ; do

echo "Ce CD Contient Des Données "
read -p "Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)" reply
choice=$(echo $reply)
if [ "$choice" = 'c' ]
then
  echo "$VERTCLAIR Éjection Du CD $VERTCLAIR";
eject $DEVICE
echo "Charger Un Nouveau Support et Appuyer Sur [Entrée]"
read touche
case $touche in
*)  echo "$VERTCLAIR Fermeture ...$NORMAL"
  ;;
esac
eject -t $DEVICE

sleep 10

elif [ "$choice" = 'e'  ]
then
echo "$VERTCLAIR Effacement En Cours ...$NORMAL";
cdrdao blank –device $DEVICE –blank-mode minimal
elif [ "$choice" = 'a'  ]
then
echo "Pas De CD-R[W] Vide Sous La Main - Opération Terminée.  ";
eject $DEVICE
exit

fi

cdrdao disk-info $DEVICE 2>&1 | grep 'empty' | grep yes ;
STATUS=$?
done
echo "Le CD Est Vide : OK"
read -p "Graver le CD Maintenant ? (y/n)" reply
choice=$(echo $reply)
if [ "$choice" = 'y' ]
then
echo "$VERTCLAIR Création Du CD-Audio ...$NORMAL";
cdrdao write --device  $DEVICE  --driver generic-mmc-raw  "$ALBUMNAME/$ALBUMNAME.toc"  ;
elif [ "$choice" = 'n'  ]
then
echo "$VERTCLAIR Éjection Du CD $NORMAL";
eject $DEVICE
exit
fi
eject $DEVICE
exit
done
 



Le travail :


 Ouverture Du Lecteur
Charger Le Compact Disc Audio, Puis Touche [Entrée]

 Fermeture, Recherche Infos ...
Album Identifié :  Lara Fabian - Je t'aime
Ces Informations Sont-elles Correctes ? (y/n) y
Ripper Le Compact Disc Audio ? (y/n)y
 Création De L'image En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc and track data...

Track   Mode    Flags  Start                Length
------------------------------------------------------------
 1      AUDIO   0      00:00:00(     0)     04:22:47( 19697)
 2      AUDIO   0      04:22:47( 19697)     04:08:63( 18663)
Leadout AUDIO   0      08:31:35( 38360)

PQ sub-channel reading (audio track) is supported, data format is BCD.
Raw P-W sub-channel reading (audio track) is supported.
Cooked R-W sub-channel reading (audio track) is supported.
Copying audio tracks 1-2: start 00:00:00, length 08:31:35 to "Lara Fabian - Je t'aime.bin"...
Track 1...
Found ISRC code.
Track 2...
Found pre-gap: 00:00:16
Found ISRC code.
Found 265 Q sub-channels with CRC errors.
Found disk catalogue number.
CDDB: Connecting to cddbp://freedb.freedb.org:888 ...
CDDB: Ok.
Reading CDDB record for: 0e01ff02-misc-Lara Fabian / Je t'aime
CD-TEXT data was added to toc-file.
Reading of toc and track data finished successfully.
Créer Le Fichier CUE ? (y/n)y
 Création Du Fichier CUE ...
Lancer La Gravure ? (y/n)y
Insérez Un CD [Ré]inscriptible Dans Le Lecteur Et Appuyer Sur La Touche [Entrée]

 Chargement Du CD [Ré]inscriptible ...
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
CD-RW                : yes
OK
 Vérification Que Le Support Présent Dans Le Lecteur Est Bien Vide ...
Ce CD Contient Des Données
Faut-il [C]hanger De Support, [E]ffacer Ce CD Ou [A] Abandonner La Gravure ? (c/e/a)e
 Effacement En Cours ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Blanking disk...
Blanking time: 22 seconds
CD-R empty           : yes
Le CD Est Vide : OK
Graver le CD Maintenant ? (y/n)y
 Création Du CD-Audio ...
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
/dev/sr0: PLEXTOR DVDR   PX-880SA Rev: 1.12
Using driver: Generic SCSI-3/MMC (raw writing) - Version 2.0 (options 0x0000)

Starting write at speed 10...
Pausing 10 seconds - hit CTRL-C to abort.
Process can be aborted with QUIT signal (usually CTRL-\).
Turning BURN-Proof on
Enabling JustSpeed.
Using 96 byte raw P-W sub-channel data mode for CD-TEXT.
Executing power calibration...
Power calibration successful.
WARNING: No super user permission to setup real time scheduling.
Writing lead-in and gap...
Writing track 01 (mode AUDIO/AUDIO )...
Writing track 02 (mode AUDIO/AUDIO )...
Wrote 86 of 86 MB (Buffers 100% 100%).
Wrote 38360 blocks. Buffer fill min 100%/max 100%.
Writing lead-out...
Wrote 15 of 15 MB.
Flushing cache...
Writing finished successfully.
patrick@debian:~/Bureau$
 




EDIT:

N'ayant pas de CD-R Vierge sous la main et en regardant de près le script, je doute que ça marche pour ceux ci, ils vont sûrement bloqués ici :


cdrdao disk-info /dev/sr0 2>&1| grep 'CD-RW ' | grep yes  ;
 



à moins de trouver le moyen de mettre  CD-RW (vide et plein) et CD-R  (vide)

Dernière modification par Anonyme (13-06-2016 05:33:46)

Pied de page des forums