ARTE Live Web videos

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.

About these ads

About Fitzcarraldo
A Linux user with an interest in all things technical.

13 Responses to ARTE Live Web videos

  1. Carmelo says:

    Thanks very much for updating the script :)

  2. Lukas says:

    Thanks guys!
    I just changed:

    ####
    – wget $1 -O sourceconcert.html
    + curl $1 > sourceconcert.html

    – wget $xmlfinal -O xmlok.xml
    + curl $xmlfinal > xmlok.xml
    ####

    to make this work on OS X.

  3. Atle says:

    Thanks a lot, I love you!!
    Carmelo, thanks a lot for dechipering it.

    I added “-nv” to wget to silence it a bit.
    I have tried with “mplayer -dumpstream rtmp://.. ” but it dumps in realtime, so this script is faster.

  4. Some One says:

    For http://liveweb.arte.tv/de/video/Jazzopen_Stuttgart_2013_Dee_Dee_Bridgewater/
    grep “new LwEvent” sourceconcert.html | grep -E -o -e “[0-9]+” > eventok.txt
    returns two numbers, so I had to change the line
    b=$(cat eventok.txt)
    into
    b=$(head -1 eventok.txt)

  5. Uli says:

    Your new code still has some problems, as it assumes that the *first* “.mp4″ in the path name is the file suffix. However, this is not necessarily the case. For instance, the correct file path for “http://liveweb.arte.tv/de/video/_Traum_im_Herbst____regie_Patrice_Chereau” (will only be available until October 30, 2013) is “rtmp://arte.fcod.llnwd.net/a2306/o25/MP4:liveweb/stream/5845_2013_10_15_arte-d_reve_d_automne.mp4_hd.mp4″ – note the *two* “.mp4″ in the path; your code would cut off the path after the first “.mp4″.

    A quick fix is to replace the code between your lines

    ## I have changed the code in this part:
    […]
    ## end of my changes to evaluate mp4hdcut2

    by

    ## I have changed the code in this part:
    mp4hd=$(cat xmlok.xml | grep “urlHd”)
    mp4hdcut2=`echo $mp4hd | perl -pe ‘s/^.*(MP4.*\.mp4).*$/$1/’`
    ## end of my changes to evaluate mp4hdcut2

    However, I also found that, contrary to your experience, the perl version livewebarte.pl works just fine for me, and since it’s more robust overall, I modified it instead of livewebarte.sh. I also updated it to be capable of working equally well with wget and curl, so that Linux and OS X users both can use it out of the box. I’ll send the updated version to Carmelo; of course, I don’t know if and when he will put it online.

  6. Carmelo says:

    Hello Uli, hello Fitzcarraldo,

    Thanks for your work Uli, here is your version (I named it 1.3) :

    http://c.ingrao.free.fr/code/downloads/livewebarte1.3.pl.zip

    I will update the french page at carmelo.fr

  7. antonio says:

    Thank you for the script. It’s what i was looking for. Works fine.

  8. Zoran says:

    Sorry for not having right background to phrase this question correctly, but for Windows users, is it anyhow possible to update artepupper0.3 according to the fixes described by Fitzcarraldo and Uli?

    • Fitzcarraldo says:

      The author of artepupper has not published its source code, only the binary (.exe) executable file. Therefore even someone with Windows programming skills can’t update it. That’s one of the reasons why many people feel that open-source software is better than closed-source software.

      If artepupper 0.3 is no longer working, your best bet would be to leave a post on the author’s blog page for artepupper 0.3, asking him to please consider updating it.

  9. Keuja says:

    Hello
    Thanks very much for the scrip, but with the new “http://concert.arte.tv” , it seems KO.

    • Satanas147 says:

      they changed their feed format to json…. it will need to be decyphered…

      • Satanas147 says:

        Well. It seems pretty easier to find the MP4 and save it directly, without any script.

        First, go on your video. Click on Share (partager if in french) then Integrate.
        The embed text gives you the JSON file url.
        Copy and paste the content of this file in a JSON parser online ( http://json.parser.online.fr/ for instance) and just find the url of the video in it, you have the url for each quality available.
        Copy-paste this url in your browser, right click on the video and… that’s it!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 51 other followers

%d bloggers like this: