I was quite annoyed that I have (OK, an old) Internet TV (B650)
but cannot watch all these streaming platforms out there.
The DriveCast plugin is very useful for this on my old Samsung TV
http://drivecast.eu
At least German ZDF provide a valid video podcast url like
http://www.zdf.de/ZDFmediathek/podcast/1193018
witch you can add to your DriveCast account and watch the newest stuff.
But ARD didn't provide podcasts AFAIK, so I wrote a little PHP code
and if you have some webspace you can use it like me.
Code: Select all
<?php
// list: http://m-service.daserste.de/appservice/1.3.0/series/list?func=getSeriesList
$appurl = "http://m-service.daserste.de/appservice/1.3.0";
$list = preg_split("/,/",$_GET['id'],-1,PREG_SPLIT_NO_EMPTY);
$id = (int)$_GET['s'];
$types = array (
"1.69 Web L VOD adative streaming", // width 960 HD, 'adative' 8-D
"1.71 ADS 4 VOD adaptive streaming", // 640
"1.67 ADS 2 VOD adaptive streaming", // 480
"1.63 Web M VOD adaptive streaming", // 512
"1.65 Web S VOD adaptive streaming" // 256
);
if(count($list)) foreach ( $list as $i => $l ) {
if($i>2) break;
$data = json_decode(file_get_contents("$appurl/series/$l?func=getSeriesDetail"));
if(count($data[0]->Videos)) foreach ( $data[0]->Videos as $j => $v ) {
if($j>2) break;
$vids[] = $v->VId;
}
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0">
<channel>
<title>ARD Mediathek</title>
<link>http://www.ardmediathek.de/</link>
<description>Die ARD Mediathek bietet online Radio- und Fernsehsendungen der ARD als Livestreams, Audios und Videos sowie Podcasts zum Download an.</description>
<pubDate><?= date("r") ?></pubDate>
<?php
if(count($vids)) foreach ( $vids as $v ) {
$uid = "$appurl/video/$v";
$k = simplexml_load_file($uid);
$title = utf8_decode($k->video->title);
$his = explode(":", $k->video->duration);
$duration = ($his[0]*60 + $his[1])*60 + $his[2];
$video = query_attribute($k->video->assets->asset, "type", $types[$id]);
$duration *= $video->totalBitrate * 126; # *(1024/8);
$url = htmlspecialchars ($video->fileName);
$date = date ("r", strtotime($k->video->broadcastDate));
?>
<item>
<title><?= $title ?></title>
<link><?= $uid ?></link>
<enclosure url="<?= $url ?>" length="<?= $duration ?>" type="video/mpeg"/>
<guid><?= $uid ?></guid>
<pubDate><?= $date ?></pubDate>
</item>
<?php
}
function query_attribute($xmlNode, $attr_name, $attr_value) {
foreach($xmlNode as $node) {
switch($node[$attr_name]) {
case $attr_value:
return $node;
}
}
}
?>
</channel>
</rss>
but the hoster only allows 200 socket connection / hour so if it fails try again later..
To find out which broadcast you want to watch go to http://m.daserste.de/#sendungen
and click your choice. Now it should be a new url in the addressbar e.g. http://m.daserste.de/#sendungen-detail?id=dittsche
the parameter id "dittsche" is your show. Copy that in the podcast url on your server.
The parameter s defines the quality of the file. Default is 960 pixel width, almost HD they think.
width for parameter s
- 0 = 960px
1 = 640px
2 = 480px
3 = 512px
4 = 256px
you can add to DriveCast and finally watch the show.
I hope it helps someone.