diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-02-07 18:32:42 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-02-07 18:32:42 +0000 |
commit | bb86b45fed42dc7a400c153ff87723af11e0f8be (patch) | |
tree | c3ddc8e682497d61ce132f29244742e3c4e5e354 | |
parent | bd320bcf66dfdca763627430d5213374e32727b0 (diff) |
Use downloaded broadcast version if it is available.
-rwxr-xr-x | frikanalen/bin/scheduler | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/frikanalen/bin/scheduler b/frikanalen/bin/scheduler index a0dd3fe..e9aaf8c 100755 --- a/frikanalen/bin/scheduler +++ b/frikanalen/bin/scheduler @@ -145,7 +145,7 @@ if ($opts{'g'}) { my $filename = "broadcast-$id.avi"; if ( ! -f $filename) { print "info: Downloading '$url'.\n"; - system("wget", "-nv", "-O", $filename, $url); + system("wget", "-O", $filename, $url); } else { print "info: Not downloading '$url', file $filename exist.\n"; } @@ -233,6 +233,7 @@ sub schedule_video { my $seq = $data->{seq}; my $title = $eventref->{'title'}; my $ogvurl = $eventref->{'ogvurl'}; + my $id = $eventref->{'contentId'}; my $vlc = $event->w->data()->{vlc}; my $startstring = short_time($eventref->{'start'}, 1); @@ -240,7 +241,12 @@ sub schedule_video { my $nowstring = strftime("%H:%M:%S", localtime(time())); print "Playing '$title' $startstring-$stopstring (now $nowstring)\n"; - vlc_play($vlc, $ogvurl, 0); + my $file = $ogvurl; + if ( -f "broadcast-$id.avi") { + print "info: Playing local $broadcast-$id.avi\n"; + $file = "broadcast-$id.avi"; + } + vlc_play($vlc, $file, 0); }); |