Skip to content

Instantly share code, notes, and snippets.

@pyropeter
Created March 25, 2011 16:00
Show Gist options
  • Save pyropeter/887080 to your computer and use it in GitHub Desktop.
Save pyropeter/887080 to your computer and use it in GitHub Desktop.
Downloads videos from Arte+7
#!/bin/bash
set -e
set -u
if [ $# -lt 1 ]; then
echo "Usage: $0 <videoWebpageUrl>"
exit 1
fi
vidWebsiteUrl="$1"
#vidLang="de"
vidLang="`echo \"$vidWebsiteUrl\" | cut -d/ -f4`"
vidQuality="hd"
outputFile="`echo \"$vidWebsiteUrl\" | sed 's!^.*/!arte_plus_7-!; s/\.html$/.flv/'`"
echo "Video language: $vidLang"
echo "Video quality: $vidQuality"
echo "Output file name: $outputFile"
echo
echo "Requesting video website..."
vidWebsite="`curl -s \"$vidWebsiteUrl\"`"
vidRefUrl="`echo \"$vidWebsite\" | grep 'vars_player.videorefFileUrl' | cut -d\\\" -f2`"
vidPlayerUrl="`echo \"$vidWebsite\" | grep 'var url_player' | cut -d\\\" -f2`"
#echo "$vidRefUrl"
echo "Requesting videoref..."
vidDataUrl="`curl -s \"$vidRefUrl\" | grep \"<video lang=\\\"$vidLang\\\" \" | cut -d\\\" -f4`"
echo "Requesting video metadata..."
vidStreamUrl="`curl -s \"$vidDataUrl\" | grep \"<url quality=\\\"$vidQuality\\\">\" | sed 's/<[^>]*>//g'`"
echo "Stream url: $vidStreamUrl"
echo
echo "Downloading stream..."
rtmpdump -r "$vidStreamUrl" --swfVfy "$vidPlayerUrl" -o "$outputFile"
# vim: set ts=2 sw=2 et:
@sebix
Copy link

sebix commented Mar 28, 2011

Wie lautet denn die URL zur Mediathek?

@pyropeter
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment