ARTE Live Web videos
April 24, 2013 18 Comments
The Franco-German cultural Web site ARTE Live Web is an excellent resource for lovers of music (classical, jazz, alternative and World) and dance. The show videos at the site are enjoyable but unfortunately only viewable for a fixed period of time before the site removes them. Back in 2011 I wanted to download the video of a performance I’d attended and loved. I searched for a Linux tool but could not find one, then found a Windows freeware GUI tool called artepupper, and used version 0.2 to download the video. You can read about the tool on the author’s blog pages artepupper 0.1, artepupper 0.2 and artepupper 0.3. The reason for the change from 0.2 to 0.3 was that ARTE Live Web changed the format of an embedded URL inside the XML page for the video on their Web site.
Now, artepupper is based on livewebarte1.1.sh
, a 2010 Bash script by Carmelo Ingrao, and a Perl script livewebarte.pl
by Juan Domingo based on livewebarte1.1.sh
, both of which are still available on line at Carmelo’s download page and which I only discovered after using artepupper in Windows. I tried the Perl script in Linux back in 2011, and it worked for me.
Recently I wanted to download another video from the ARTE Live Web site and found that, although artepupper 0.3 in Windows worked, the Perl script livewebarte.pl
no longer worked. Presumably this was because of the aforementioned change to the embedded URL. However, I found that the Bash script livewebarte1.1.sh
still worked. Actually, I had to edit the script to replace “./rtmpdump
” with “rtmpdump
“, as I had installed the command-line tool rtmpdump
using the Linux distribution’s package manager and the executable is not stored in the same directory as the Bash script. But, apart from that, it worked.
Carmelo is a star for having deciphered how to access and download videos from the site. However, looking at his Bash script, the part where he parses a line in the XML code and extracts a string between the delimiters “MP4” and “mp4” is based on a hard-coded character position, which could change if the Web site’s owners change the format of the URL. So I decided to modify the Bash script to avoid using character positions to extract a string. The Bash script livewebarte1.2.sh
is an updated version of Carmelo’s livewebarte1.1.sh
script.
#!/bin/bash # Script pour récupérer les vidéos FLV du site liveweb.arte.tv # par Carmelo Ingrao <carmelo42@gmail.com> http://c.ingrao.free.fr/code/ # version 1.0 # release date 21 février 2010 ## modified by Fitzcarraldo 24 April 2013 ## version 1.2 ## release date 24 April 2013 # licence : GPLv2 # rtmpdump compilé doit être dans le même répertoire que le script ## rtmpdump must be installed and in user's $PATH (e.g. I have it in /usr/bin/) # utilisation du script : # # ./script.sh url fichier.flv # _______________ # url --> $1 # fichier --> $2 # fichier de sortie # on efface l'écran avant de commencer clear # on affiche les infos sur le script echo "livewebarte.sh version 1.0." echo "(c) 2010 Carmelo Ingrao; License : GPL" echo "livewebarte.sh version 1.2." echo "updated from version 1.1 by Fitzcarraldo on 24 April 2013; License : GPL" echo "usage : ./livewebarte.sh url_concert_sur_liveweb.arte.tv fichier.flv" echo "rtmpdump must be installed and in your path." # on télécharge le code source de la page streamant le concert dans le fichier sourceconcert.html wget $1 -O sourceconcert.html # on récupère le numéro d'event et on le copie dans eventok.txt #cat sourceconcert.html | grep "new LwEvent" > event.txt #cat event.txt | cut -b "15 16 17" > eventok.txt grep "new LwEvent" sourceconcert.html | grep -E -o -e "[0-9]+" > eventok.txt # on prend le fichier XML d'arte et on crée l'url avec le bon numéro d'event # xmloriginal="http://arte.vo.llnwd.net/o21/liveweb/events/event-610.xml" # url du xml sans le numéro d'event original (pour faciliter) xmloriginal2="http://arte.vo.llnwd.net/o21/liveweb/events/event-" # on assigne à la variable b le contenu de eventok.txt --> numéro correct d'event b=$(cat eventok.txt) # on créer l'url correct du fichier XML qu'on téléchargera xmlok=$(echo $xmloriginal2$b) finxml=".xml" xmlfinal=$(echo $xmlok$finxml) # on télécharge le bon XML wget $xmlfinal -O xmlok.xml echo "Fichier XML téléchargé" ## I have changed the code in this part: # on extrait le nom du fichier MP4 depuis le fichier xmlok.xml mp4hd=$(cat xmlok.xml | grep "urlHd") # on efface le début de l'url du MP4 # on efface le surplus à la fin du nom du MP4 et on sauve le nom dans la variable mp4hdcut2 mp4hdcut2=${mp4hd#*MP4} mp4hdcut2=${mp4hdcut2%%mp4*} mp4hdcut2="MP4"$mp4hdcut2"mp4" ## end of my changes to evaluate mp4hdcut2 # on lance la commande rtmpdump avec les paramètres # rappel : # $2 = nom du fichier de sortie # $mp4hdcut2 = nom du fichier MP4 ## Carmelo had ./rtmpdump here, but I removed the "./" rtmpdump -r rtmp://arte.fcod.llnwd.net:1935/a2306/o25 -a a2306/o25 -f LNX 10,0,45,2 -W http://liveweb.arte.tv/flash/player.swf -t rtmp://arte.fcod.llnwd.net:1935/a2306/o25 -p http://liveweb.arte.tv/ -o $2 -y $mp4hdcut2 # on efface les fichiers crées rm sourceconcert.html #rm event.txt rm eventok.txt rm xmlok.xml # Affichage des infos de fin echo "________" echo "Voilà, le téléchargement est terminé." echo "Le fichier se trouve ici :" echo " " echo $2 echo " " echo "Bon visionnage" echo " " echo " " exit 0
Save it in your home directory and make it executable:
$ chmod +x livewebarte1.2.sh
Also make sure you have the package rtmpdump
installed and that it is in your $PATH
.
Then you can browse the ARTE Live Web site and select the performance video you wish to download. Hover the mouse pointer over the video pane and click on “INTEGRER LA VIDEO” to find the URL for that video, which will be of the form http://liveweb.arte.tv/fr/video/foo/
, where “foo” is some string of characters (not literally “foo”, of course). The command to download it is then as shown below. I’ll use a file name foo.flv
here, but any prefix would do:
$ ./livewebarte1.2.sh http://liveweb.arte.tv/fr/video/foo/ foo.flv
Note that it is essential to include the forward slash at the end of the URL. The file will be downloaded to your home directory and you can watch it in VLC or any other Linux media player that plays Flash video.
So there you have it; currently you can use artepupper 0.3 in Windows or livewebarte1.2.sh
in Linux to download from ARTE Live Web a video of a performance you attended and loved.