Outils pour utilisateurs

Outils du site


issue74:tutoriel_gpodder

Ceci est une ancienne révision du document !


Table des matières

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.

La podcasting, ou 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 toutes les épisodes soient prêtes à être copiées 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. sudo apt-get install gpodder lame 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.

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 enn 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 de site 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. 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.

4

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) # update and download podcast # enter these 2 lines into the bash shell URL=http://www.gametrailers.com/gteba_podcast.xml gpo update $URL && gpo download $URL You should see the latest episodes getting updated and downloaded. This specific podcast is a video podcast, which obviously won't work on a CD player or standard MP3 player, so we need to extract and encode the audio stream from the MP4 video file. # extract audio from video file and convert to MPEG-3 # change the file name to match a file that was downloaded in the previous step DLFILE=$HOME/gpodder-downloads/“EpicBattleCry - GameTrailers.com”/skirmish–186—i-want-to-bite-it.mp4 # run ffmpeg ffmpeg -i $DLFILE -vn -ac 2 -ab 192k “$DLFILE.mp3”

5

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. Obviously, performing these tasks at the terminal is cumbersome and time consuming. Next up we are going to automate the solution so these tasks occur on their own, based on a schedule. 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.

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/ In this file, paste the Internet URL addresses of each of the shows that you want to auto-update (one per line). 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.

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. log This is the path and filename to write log messages to. You can change it if you don't want to log to /tmp log=“/tmp/$(date +%Y-%m-%dT%H:%M)-podcast-download.log” defs This is the file containing the URLs of the podcasts to automatically download. This file must exist prior to running the script. defs=“$HOME/Downloads/Podcasts/auto-download.conf” podDownload This is the path where gpodder is configured to download. It is usually ~/gpodder-downloads unless you manually changed this value in the Preferences > Edit Config button in gpodder. On my machine, I have changed the default gpodder download path (to the path you see below) podDownload=“$HOME/Downloads/Podcasts/gpodder-downloads” pubDir This is the path to copy downloaded and/or converted podcasts to. It is created if it doesn't already exist. pubDir=“$HOME/Downloads/Podcasts/_converted” histFile 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”

8

Test the Script Now that we have updated the script, we need to test that it’s working correctly. # make it executable chmod +x ~/bin/gpodder-sync.sh # run the script cd ~/bin && ./gpodder-sync.sh Hopefully the script updated your specified podcasts and then downloaded (and converted if applicable) them to your pubDir folder. Download Scheduling Now that our script is running and everything is set up, we need to create a scheduled task so the script is run automatically once a day. In the example below, we are running the script every morning at 10:30 am. # open crontab crontab -e # enter this line into the crontab (replace neal with your username) 30 10 * * * /home/neal/bin/gpodder-sync.sh

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. Feel free to send me feedback or questions. I hope you enjoyed this tutorial.

issue74/tutoriel_gpodder.1386000907.txt.gz · Dernière modification : 2013/12/02 17:15 de auntiee