Outils pour utilisateurs

Outils du site


issue74:tutoriel_gpodder

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
issue74:tutoriel_gpodder [2013/08/12 19:03] – créée auntieeissue74:tutoriel_gpodder [2013/12/04 21:19] (Version actuelle) – [6] fcm_-_ekel
Ligne 1: Ligne 1:
-Podcasting has revolutionized the way we create, share, and distribute content over the Internet. Nearly everyone is aware of programs such as Apple's iTunes, and most people are aware of some of the various open source podcatching alternatives. Several of these applications provide ways to download episodes on a schedule, however, for the most part, these programs usually download every episode of every subscribed podcast. Many people subscribe to far more shows than they could ever actually have time to listen to. 
  
-We will introduce a system to download only the specific podcasts we listen to regularly. Our solution will convert video podcasts to audio MPEG-3, so all of our episodes are ready to be copied to a CD, MP3 player, or similar device. 
  
-Setup Gpodder+===== 1 ===== 
 +**Podcasting has revolutionized the way we create, share, and distribute content over the Internet. Nearly everyone is aware of programs such as Apple's iTunes, and most people are aware of some of the various open source podcatching alternatives. Several of these applications provide ways to download episodes on a schedule, however, for the most part, these programs usually download every episode of every subscribed podcast. Many people subscribe to far more shows than they could ever actually have time to listen to. 
 + 
 +We will introduce a system to download only the specific podcasts we listen to regularly. Our solution will convert video podcasts to audio MPEG-3, so all of our episodes are ready to be copied to a CD, MP3 player, or similar device.** 
 + 
 +Le podcasting, ou la baladodiffusion, a révolutionné notre façon de créer, partager et diffuser du contenu sur l'Internet. Presque tout le monde a connaissance des programmes tels que iTunes d'Apple et la plupart des gens ont connaissance de quelques-unes des diverses alternatives Open Source à cet agrégateur propriétaire. Plusieurs de ces applications offrent le téléchargement planifié des émissions, cependant, dans la plupart des cas, ces programmes téléchargent chaque épisode de chaque « balado » auquel vous êtes abonné. Beaucoup de gens sont abonnés à trop d'émissions et n'auront jamais assez de temps pour tout écouter. 
 + 
 +Je vais vous présenter un système pour télécharger uniquement les podcasts particuliers que nous écoutons régulièrement. Notre solution convertira des podcasts vidéo en audio MPEG-3, afin que tous les épisodes soient prêts à être copiés vers un CD, un lecteur de MP3 ou un dispositif similaire. 
 + 
 +===== 2 ===== 
 +**Setup Gpodder
  
 Gpodder is the podcatching software we will use to manage our subscriptions. The first step is to install gpodder (which should install the package we really want, gpodder-cli), so we can convert video podcasts to MP3 audio. Gpodder is the podcatching software we will use to manage our subscriptions. The first step is to install gpodder (which should install the package we really want, gpodder-cli), so we can convert video podcasts to MP3 audio.
Ligne 11: Ligne 19:
 When you run gpodder for the first time you will be prompted to subscribe to podcasts, import an opml file, or sync with your gpodder.net account. When you run gpodder for the first time you will be prompted to subscribe to podcasts, import an opml file, or sync with your gpodder.net account.
  
-I recommend creating a http://gpodder.net account because it allows you to subscribe to podcasts from a friendly website interface and, more importantly, it allows you to sync all your subscriptions to multiple computers.+I recommend creating a http://gpodder.net account because it allows you to subscribe to podcasts from a friendly website interface and, more importantly, it allows you to sync all your subscriptions to multiple computers.**
  
-Set up FFMPEG+Obtenir Gpodder 
 + 
 +Gpodder est l'agrégateur que nous utiliserons pour gérer nos abonnements. La première étape est l'installation de gpodder (qui devrait installer également le paquet que nous voulons vraiment, gpodder-cli), pour pouvoir convertir les podcasts vidéo en mP3 audio. 
 + 
 +sudo apt-get install gpodder lame 
 + 
 +La première fois que vous lancerez gpodder, on vous invitera à vous abonner à des podcasts, à importer un fichier opml ou à synchroniser avec votre compte sur gpodder.net. 
 + 
 +Je recommande la création d'un compte sur http://gpodder.net, parce qu'il vous permet de vous abonner aux podcasts à partir d'une interface Web conviviale et, surtout, il vous permet de synchroniser tous vos abonnements vers de multiples ordinateurs. 
 + 
 +===== 3 ===== 
 + 
 +**Set up FFMPEG
  
 One of the core features of our setup includes the ability to extract the audio from video podcasts so, when each download completes, we are left with a set of MPEG-3 audio files which can then be synchronized with our portable devices (or burned onto CDs for the car). You may want to get the most recent version of ffmpeg. Typically this will require compiling ffmpeg from source. One of the core features of our setup includes the ability to extract the audio from video podcasts so, when each download completes, we are left with a set of MPEG-3 audio files which can then be synchronized with our portable devices (or burned onto CDs for the car). You may want to get the most recent version of ffmpeg. Typically this will require compiling ffmpeg from source.
Ligne 19: Ligne 39:
 Please refer to this howto for compiling ffmpeg: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide Please refer to this howto for compiling ffmpeg: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
  
-Or, you could install ffmpeg from the Software Center or using Synaptic.+Or, you could install ffmpeg from the Software Center or using Synaptic.** 
 + 
 +Installer FFMPEG 
 + 
 +Une des fonctionnalités clé de notre configuration comprend la capacité d'extraire l'audio des podcasts vidéo afin que, quand chaque téléchargement se termine, nous ayons un ensemble de fichiers audio MPEG-3 qui pourront alors être synchronisés avec nos dispositifs portables (ou gravés sur des CD pour la voiture). Vous voudrez sans doute vous procurer la dernière version de ffmpeg. D'habitude, ceci nécessitera la compilation de ffmpeg à partir du code source. 
 + 
 +Veuillez vous référer à ce tutoriel pour la compilation de ffmpeg : https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide 
 + 
 +Ou, vous pourriez installer ffmpeg à partir de la Logithèque ou au moyen de Synaptic. 
 + 
 + 
 + 
 +===== 4 =====
  
-Manually Testing the Setup+**Manually Testing the Setup
  
 Before we go about creating the bash script and cron job to download and convert our podcasts, we want to run some manual tests to ensure the machine is properly prepared. We have subscribed to EpicBattleCry, a video games podcast from the guys at http://www.gametrailers.com. Enter the following commands into the bash shell (skip lines that begin with # as these are comments) Before we go about creating the bash script and cron job to download and convert our podcasts, we want to run some manual tests to ensure the machine is properly prepared. We have subscribed to EpicBattleCry, a video games podcast from the guys at http://www.gametrailers.com. Enter the following commands into the bash shell (skip lines that begin with # as these are comments)
Ligne 41: Ligne 73:
 # change the file name to match a file that was downloaded in the previous step # change the file name to match a file that was downloaded in the previous step
  
-DLFILE=$HOME/gpodder-downloads/"EpicBattleCry - +DLFILE=$HOME/gpodder-downloads/"EpicBattleCry - GameTrailers.com"/skirmish--186---i-want-to-bite-it.mp4
  
-GameTrailers.com"/skirmish--186---i-want-to-bite-it.mp4+# run ffmpeg 
 + 
 +ffmpeg -i $DLFILE -vn -ac 2 -ab 192k "$DLFILE.mp3" ** 
 + 
 +Tester notre configuration manuellement 
 + 
 +Avant de créer le script bash et la tâche cron pour télécharger et convertir nos podcasts, nous voulons effectuer quelques tests pour être certains que la machine soit préparée correctement. Nous nous sommes abonnés à EpicBattleCry, un podcast sur les jeux vidéos créé par les gars à http://www.gametrailers.com. Saisissez les commandes suivantes dans le shell bash (sautez les lignes commençant par un # - ce sont des commentaires). 
 + 
 +# mettre à jour et télécharger le podcast 
 + 
 +# entrer ces 2 lignes dans le shell bash : 
 + 
 +URL=http://www.gametrailers.com/gteba_podcast.xml 
 + 
 +gpo update $URL && gpo download $URL 
 + 
 +Vous devriez voir les derniers épisodes en train d'être mis à jour et téléchargés. 
 + 
 +Ce podcast précis est un podcast vidéo, qui, évidemment, ne fonctionnera pas sur un lecteur de CD ou de MP3 standard ; nous avons donc besoin d'extraire et d'encoder le flux audio du fichier vidéo MP4. 
 + 
 +# extraire audio du fichier vidéo et le convertir en MPEG-3 
 + 
 +# donner au fichier le nom d'un fichier qui a été téléchargé à l'étape précédente : 
 + 
 +DLFILE=$HOME/gpodder-downloads/"EpicBattleCry - GameTrailers.com"/skirmish--186---i-want-to-bite-it.mp4
  
 # run ffmpeg # run ffmpeg
  
-ffmpeg -i $DLFILE -vn -ac 2 -ab 192k "$DLFILE.mp3" +ffmpeg -i $DLFILE -vn -ac 2 -ab 192k "$DLFILE.mp3" 
 + 
 + 
  
 +===== 5 =====
  
-Automating The System+**Automating The System
  
 At this stage we have installed gpodder (gpodder-cli) and ffmpeg, and we used the gpodder user interface to subscribe to a podcast. We then updated and downloaded the newest episodes from the command line. Finally we used ffmpeg to extract the MPEG-3 audio stream from the MPEG-4 video podcast. At this stage we have installed gpodder (gpodder-cli) and ffmpeg, and we used the gpodder user interface to subscribe to a podcast. We then updated and downloaded the newest episodes from the command line. Finally we used ffmpeg to extract the MPEG-3 audio stream from the MPEG-4 video podcast.
Ligne 58: Ligne 118:
 gpodder-sync gpodder-sync
  
-When we are all done with our script, it will look like the image below. Before we can get here though, we'll need to set up the configuration and modify the gpodder settings.+When we are all done with our script, it will look like the image below. Before we can get here though, we'll need to set up the configuration and modify the gpodder settings.**
  
-Configuration+L'automatisation du système 
 + 
 +À ce stade, nous avons installé gpodder (gpodder-cli) et ffmeg et nous avons utilisé l'interface utilisateur de gpodder pour nous abonner à un podcast. Puis nous avons mis à jour et téléchargé les derniers épisodes avec la ligne de commande. Enfin, nous avons utlisé ffmpeg pour extraire le flux audio MPEG-3 de podcast vidéo MPEG-4. 
 + 
 +Accomplir ces tâches au terminal est évidemment difficile et prend beaucoup de temps. Nous allons maintenant automatiser la solution pour que ces tâches s'accomplissent toutes seules, selon un planificateur : 
 + 
 +gpodder-sync 
 + 
 +Quand nous aurons terminé notre script, il ressemblera à l'image ci-dessous. Cependant, avant de pouvoir y arriver, il faut configurer et modifier les paramètres de gpodder. 
 + 
 +===== 6 ===== 
 + 
 +**Configuration
  
 Create a new file called auto-downloads.conf and place it where you like. In my setup, it is located in $HOME/Downloads/Podcasts/ Create a new file called auto-downloads.conf and place it where you like. In my setup, it is located in $HOME/Downloads/Podcasts/
Ligne 68: Ligne 140:
 These podcasts can be video or audio podcasts. If they are video podcasts then our script will convert them to audio podcasts for you. These podcasts can be video or audio podcasts. If they are video podcasts then our script will convert them to audio podcasts for you.
  
-At present, the script handles only MP3 and MP4 files. For the podcasts I download, these appear to be the standard file-types in use. The script can be easily modified to handle more file-types if necessary.+At present, the script handles only MP3 and MP4 files. For the podcasts I download, these appear to be the standard file-types in use. The script can be easily modified to handle more file-types if necessary.**
  
-Script+Configuration 
 + 
 +Créez un nouveau fichier appelé auto-downloads dans l'emplacement de votre choix. Chez moi, il se trouve dans $HOME/Downloads/Podcasts/ 
 + 
 +Collez dans ce fichier l'adresse Internet (URL) de chacun des podcasts que vous voulez mettre à jour automatiquement (une adresse par ligne). 
 + 
 +Il peut s'agir de podcasts vidéo ou audio. Si ce sont des podcasts vidéo, notre script les convertira en podcasts audio. 
 + 
 +Actuellement, le script ne gère que des fichiers MP3 et MP4. Ceux-ci semblent être les types de fichiers standards utilisés pour les podcasts que je télécharge. Au besoin, le script peut être modifié facilement pour prendre en charge d'autres types de fichier. 
 + 
 +===== 7 ===== 
 + 
 +**Script
  
 Download the bash script here: http://pastebin.com/xyxBMhZ8, and copy into your home or ~/bin directory. Open the script in your editor of choice and replace the following values to match your system. Download the bash script here: http://pastebin.com/xyxBMhZ8, and copy into your home or ~/bin directory. Open the script in your editor of choice and replace the following values to match your system.
Ligne 101: Ligne 185:
  
 This is the path to the file used to record which shows have already been downloaded or converted. It is created if it doesn't already exist. This is the path to the file used to record which shows have already been downloaded or converted. It is created if it doesn't already exist.
 +
 +histFile="$HOME/Downloads/Podcasts/_converted/_history.txt"**
 +
 +Script
 +
 +Téléchargez le script bash ici : http://pastebin.com/xyxBMhZ8 et copiez-le dans votre dossier personnel ou répertoire ~/bin. Ouvrez le script dans votre éditeur et remplacez les valeurs suivantes par d'autres qui s'accorderont avec votre système :
 +
 +log
 +
 +Ceci est le chemin et le nom du fichier où les messages de log seront écrits. Vous pouvez le changer si vous ne voulez pas que les messages s'écrivent dans /tmp :
 +
 +log="/tmp/$(date +%Y-%m-%dT%H:%M)-podcast-download.log"
 +
 +defs
 +
 +Il s'agit du fichier qui contient les URL des podcasts à télécharger automatiquement. Il faut créer ce fichier avant d'exécuter le script :
 +
 +defs="$HOME/Downloads/Podcasts/auto-download.conf"
 +
 +podDownload
 +
 +C'est ici que gpodder va télécharger les podcasts. Habituellement, il s'agit de ~/gpodder-downloads, à moins que vous ne changiez cette valeur manuellement au moyen du bouton Preferences > Edit Config dans gpodder.
 +
 +Sur ma machine, j'ai remplacé le chemin des téléchargements gpodder par défaut par (ce que vous voyez ci-dessous) :
 +
 +podDownload="$HOME/Downloads/Podcasts/gpodder-downloads"
 +
 +pubDir
 +
 +C'est le chemin où les podcasts téléchargés ou convertis sont copiés. S'il n'existe pas, il sera créé :
 +
 +pubDir="$HOME/Downloads/Podcasts/_converted"
 +
 +histFile
 +
 +Il s'agit du chemin du fichier où paraissent les noms des podcasts déjà téléchargés ou convertis. S'il n'existe pas déjà, il sera créé :
  
 histFile="$HOME/Downloads/Podcasts/_converted/_history.txt" histFile="$HOME/Downloads/Podcasts/_converted/_history.txt"
  
  
-Test the Script+ 
 + 
 +===== 8 ===== 
 + 
 + 
 +**Test the Script
  
 Now that we have updated the script, we need to test that it’s working correctly. Now that we have updated the script, we need to test that it’s working correctly.
Ligne 128: Ligne 253:
  
 # enter this line into the crontab (replace neal with your username) # enter this line into the crontab (replace neal with your username)
 +
 +30 10 * * * /home/neal/bin/gpodder-sync.sh**
 +
 +
 +Tester le script
 +
 +Ayant mis à jour le script, nous devons nous assurer qu'il fonctionne correctement.
 +
 +# le rendre exécutable :
 +
 +chmod +x ~/bin/gpodder-sync.sh
 +
 +# exécuter le script :
 +
 +cd ~/bin && ./gpodder-sync.sh
 +
 +On peut espérer que le script a mis à jour les podcasts spécifiés, puis les a téléchargés (et convertis si nécessaire) vers le dossier pubDir.
 +
 +Planification des téléchargements
 +
 +Maintenant que le script fonctionne et que tout est configuré, nous devons planifier une tâche afin que le script s'exécute automatiquement une fois par jour.
 +
 +Dans l'exemple ci-dessous, nous lançons le script chaque matin à 10 h 30.
 +
 +# ouvrez crontab :
 +
 +crontab -e
 +
 +# tapez cette ligne dans le crontab (en remplaçant neal par votre nom d'utilisateur) :
  
 30 10 * * * /home/neal/bin/gpodder-sync.sh 30 10 * * * /home/neal/bin/gpodder-sync.sh
  
-Next Steps+===== 9 ===== 
 + 
 +**Next Steps
  
 This process is ideal on a headless server. I've been running this script for a few years now on a Ubuntu server. In this configuration you can set the pubDir to a SAMBA share. Now everyone in the house can sync their devices to the shared folder. This process is ideal on a headless server. I've been running this script for a few years now on a Ubuntu server. In this configuration you can set the pubDir to a SAMBA share. Now everyone in the house can sync their devices to the shared folder.
  
-Feel free to send me feedback or questions. I hope you enjoyed this tutorial.+Feel free to send me feedback or questions. I hope you enjoyed this tutorial.** 
 + 
 +Prochaines étapes 
 + 
 +Ce processus est idéal sur un serveur sans affichage. J'exécute ce script depuis quelques années maintenant sur un serveur Ubuntu. Dans cette configuration, vous avez la possibilité de paramétrer le pubDir vers un partage SAMBA. Maintenant, toute la maisonnée peut synchroniser ses appareils au moyen du dossier partagé. 
 + 
 +N'hésitez pas à m'envoyer vos commentaires ou questions. J'espère que ce tutoriel vous a plu.
issue74/tutoriel_gpodder.txt · Dernière modification : 2013/12/04 21:19 de fcm_-_ekel