tvkaista-0.93/Makefile tvkaista-0.94/Makefile
1
2VERSION_CONTROLLED= tvkaista.sh tvkaista_gtkui.c tvkaista-helper.pl \
3 tvkaista.desktop logo.pov tvkaista.png Makefile
14
25
3all: tvkaista_gtk6all: tvkaista_gtkui
47
5tvkaista_gtk: tvkaista_gtk.c tvkaista-helper.pl8tvkaista_gtkui: tvkaista_gtkui.c tvkaista-helper.pl
9 perl -c tvkaista-helper.pl
6 sh tvkaista_gtk.c10 sh tvkaista_gtkui.c
711
8logo.png: logo.pov12logo.png: logo.pov
9 povray -D0 +Q9 +ua -H400 -W500 $<13 povray -D0 +Q9 +ua -H400 -W500 $<
10 @echo tvkaista.png is clipped and scaled from this with GIMP14 @echo tvkaista.png is clipped and scaled from this with GIMP
1115
12install: tvkaista_gtk16install: tvkaista_gtkui
13 test -d "$$HOME"/.tvkaista || mkdir "$$HOME/".tvkaista17 test -d "$$HOME"/.tvkaista || mkdir "$$HOME/".tvkaista
14# cp tvkaista.sh "$$HOME"/.tvkaista18# cp tvkaista.sh "$$HOME"/.tvkaista
15 cp tvkaista_gtk "$$HOME"/.tvkaista19 cp tvkaista_gtkui "$$HOME"/.tvkaista
16# cp tvkaista-helper.pl "$$HOME"/.tvkaista20# cp tvkaista-helper.pl "$$HOME"/.tvkaista
17 cp tvkaista.png "$$HOME"/.tvkaista21 cp tvkaista.png "$$HOME"/.tvkaista
18 sed 's|$$dest|'"$$HOME/.tvkaista|" tvkaista.desktop \22 sed 's|$$dest|'"$$HOME/.tvkaista|" tvkaista.desktop \
19 > "$$HOME"/.tvkaista/tvkaista.desktop23 > "$$HOME"/.tvkaista/tvkaista.desktop
24 rm -f "$$HOME"/bin/tvkaista_gtk "$$HOME"/.tvkaista/tvkaista_gtk
25 test ! -d "$$HOME"/bin \
20 test ! -d "$$HOME"/bin || ln -sf ../.tvkaista/tvkaista_gtk "$$HOME"/bin26 || ln -sf ../.tvkaista/tvkaista_gtkui "$$HOME"/bin
21 test ! -d "$$HOME"/Desktop \27 test ! -d "$$HOME"/Desktop \
22 || ln -sf ../.tvkaista/tvkaista.desktop "$$HOME"/Desktop28 || ln -sf ../.tvkaista/tvkaista.desktop "$$HOME"/Desktop
23 test ! -d "$$HOME"/Työpöytä \29 test ! -d "$$HOME"/Työpöytä \
24 || ln -sf ../.tvkaista/tvkaista.desktop "$$HOME"/Työpöytä30 || ln -sf ../.tvkaista/tvkaista.desktop "$$HOME"/Työpöytä
2531
26targz:32gitlog: $(VERSION_CONTROLLED)
33 git log --name-status > $@
34
35targz: gitlog
27# requires recent-enough GNU tar36# requires recent-enough GNU tar
28 ver=`sed -n 's/Version=//p' tvkaista.desktop`; \37 ver=`sed -n 's/Version=//p' tvkaista.desktop`; \
29 tar --transform "s|^|tvkaista-$$ver/|" -zcvf tvkaista-$$ver.tar.gz \38 tar --transform "s|^|tvkaista-$$ver/|" -zcf tvkaista-$$ver.tar.gz \
30 tvkaista_gtk.c tvkaista-helper.pl tvkaista.sh \39 tvkaista_gtkui.c tvkaista-helper.pl tvkaista.sh \
31 tvkaista.desktop tvkaista.png logo.pov Makefile40 tvkaista.desktop tvkaista.png logo.pov Makefile gitlog && \
41 echo Created tvkaista-$$ver
3242
33clean:43clean:
34 rm -f helper.c helper.gz logo.png *~44 rm -f helper.c helper.gz logo.png *~
3545
36distclean: clean46distclean: clean
37 rm tvkaista_gtk47 rm tvkaista_gtkui tvkaista_gtk
3848

Only in tvkaista-0.94: gitlog

tvkaista-0.93/tvkaista-helper.pl tvkaista-0.94/tvkaista-helper.pl
4# Author: Tomi Ollila -- too ät iki piste fi4# Author: Tomi Ollila -- too ät iki piste fi
5#5#
6# Created: Sat Feb 07 21:29:53 EET 2009 too6# Created: Sat Feb 07 21:29:53 EET 2009 too
7# Last modified: Tue 21 Apr 2009 22:59:52 EEST too7# Last modified: Sun 26 Apr 2009 12:46:56 EEST too
88
9#PERL_UNICODE=SD perl uus.pl 1 update9#PERL_UNICODE=SD perl tvkaista-helper.pl 1 update
1010
11#noupdate: not yes11#noupdate: not yes
1212
22die "Unicode settings not OK\n" unless (${^UNICODE} & 0x1f) == 0x1f;22die "Unicode settings not OK\n" unless (${^UNICODE} & 0x1f) == 0x1f;
2323
24my $home = $ENV{'HOME'};24my $home = $ENV{'HOME'};
25
26#if ($ARGV[0] eq 'x') { chdir $home . '/.tvkaista/2'; shift @ARGV; }
2725
28sub usage()26sub usage()
29{27{
177 $c = 100;175 $c = 100;
178176
179 my @urls;177 my @urls;
180 push @urls, "http://www.tvkaista.fi/feed/channels/$_/flv.mediarss"178 push @urls, "http://www.tvkaista.fi/feed/channels/$_/flv.rss"
181 foreach (@channels);179 foreach (@channels);
182180
183 feedwget "today/a-$time-now.rss", @urls;181 feedwget "today/a-$time-now.rss", @urls;
227 next if (defined $fst[9] &&$fst[9] > $daysecs); # recent enough.225 next if (defined $fst[9] &&$fst[9] > $daysecs); # recent enough.
228226
229 push @urls, "http://www.tvkaista.fi/feed/archives/$di[4]/$di[3]/$di[2]"227 push @urls, "http://www.tvkaista.fi/feed/archives/$di[4]/$di[3]/$di[2]"
230 . "/channels/$_/flv.mediarss" foreach (@channels);228 . "/channels/$_/flv.rss" foreach (@channels);
231229
232 getdatetime;230 getdatetime;
233 feedwget "today/a-$di[3]-$di[2]-$time.rss", @urls;231 feedwget "today/a-$di[3]-$di[2]-$time.rss", @urls;
290 }288 }
291}289}
292290
291sub getsrt($)
292{
293 #http://www.tvkaista.fi/netpvr/Download/774338.srt
294
295 my $tof = "../recordings/$ARGV[3].srt.wip";
296
297 recwget $tof, "http://www.tvkaista.fi/netpvr/Download/$ARGV[3].srt",
298 '--load-cookies', 'cookies.txt';
299
300 open I, '<', $tof or return ( $ARGV[3], 0 );
301
302 my ($namepfx, $haveit, $conlen) = ($ARGV[3], 0, -1);
303 while (<I>) {
304 $namepfx = $1, $haveit = 1 if /^Content-Disp.*filename=(.*).srt\s*$/;
305 $conlen = $1 if /^Content-Length:\s+(\d+)/;
306 last if /^\s*$/;
307 }
308 close I;
309 if ($conlen > 0) {
310 rename $tof, "../recordings/$namepfx.srt"; }
311 else {
312 unlink $tof; }
313
314 return ($namepfx, $conlen);
315}
316
293my %speeds = qw ( 300k mp4 1M flv 2M h264 8M ts );317my %speeds = qw ( 300k mp4 1M flv 2M h264 8M ts );
294318
295sub play ($)319sub play ($)
315 return 0 unless $_[0];339 return 0 unless $_[0];
316 die "No content found!\n";340 die "No content found!\n";
317 }341 }
342
343 my ($namepfx, $srtflen) = getsrt($ARGV[3]);
344 chdir $recdir;
345
318 my @list = ( $ARGV[2] );346 my @list = ( $ARGV[2] );
319 chdir $recdir, push(@list, '-O'), push(@list, "$ARGV[3].$format"),
320 if $ARGV[2] eq 'wget';347 if ($ARGV[2] eq 'wget') {
348 push @list, '-O' , "$namepfx.$format";
349 }
350 elsif ($ARGV[2] eq 'vlc') {
351 push @list, '--sub-file', "$namepfx.srt" if $srtflen > 0;
352 }
353 elsif ($ARGV[2] eq 'mplayer') {
354 push @list, '-ao', 'oss', '-utf8';
355 push @list, '-sub', "$namepfx.srt" if $srtflen > 0;
356 }
357 elsif ($ARGV[2] eq 'xine') {
358 # how to give subtitle file as separate command line parameter ?
359 }
360
321 push @list, $url;361 push @list, $url;
322 print "Executing @list\n";362 print "Executing @list\n";
323 exec @list or die "exec() $!\n";363 system @list or warn "system(): $!\n";
324 #return 1; # unlikely, yes!364 print "Executed @list\n";
365
366 unlink "$namepfx.srt" if $srtflen > 0 && ($ARGV[2] ne 'wget');
367
368 # add more checks & cleanups
369 exit 0;
325}370}
326371
327if ($ARGV[1] eq 'play')372if ($ARGV[1] eq 'play')
336 getpw;381 getpw;
337 mkpw 1, $minfile = update unless ($minfile = update);382 mkpw 1, $minfile = update unless ($minfile = update);
338383
384# XXX why this did not work ???
339 foreach (<program_*>) {385# foreach (<program_*>) {
386# print "$_ $minfile\n";
340 unlink $_, next if $_ lt $minfile;387# unlink $_, next if $_ lt $minfile;
341 unlink $_ if -z $_;388# unlink $_ if -z $_;
342 }389# }
390# sleep 10;
343 my @logdirs;391 my @logdirs;
344 push @logdirs, $_ foreach (<logs.*>);392 push @logdirs, $_ foreach (<logs.*>);
345 pop @logdirs foreach (1..2);393 pop @logdirs foreach (1..2);
352400
353# "list" (and "update" too)401# "list" (and "update" too)
354select STDOUT;402select STDOUT;
355foreach (<program_*[0-9]>)403
404my @prgfiles = <program_*[0-9]>;
405unlink shift @prgfiles while defined $prgfiles[15];
406foreach (@prgfiles)
356{407{
357 open I, '<', $_;408 open I, '<', $_;
358 print "F $_\n";409 print "F $_\n";

tvkaista-0.93/tvkaista.desktop tvkaista-0.94/tvkaista.desktop
1[Desktop Entry]1[Desktop Entry]
2Encoding=UTF-82Encoding=UTF-8
3Version=0.933Version=0.94
4Name=tvkaista4Name=tvkaista
5Comment=gui-kilentti tvkaistalle5Comment=gui-kilentti tvkaistalle
6GenericName=tvkaista-kilentti6GenericName=tvkaista-kilentti
7Exec=$dest/tvkaista_gtk7Exec=$dest/tvkaista_gtkui
8Icon=$dest/tvkaista.png8Icon=$dest/tvkaista.png
9Terminal=false9Terminal=false
10Type=Application10Type=Application

Only in tvkaista-0.93: tvkaista_gtk.c

Only in tvkaista-0.94: tvkaista_gtkui.c