Re: [vdr] ANNOUCEMENT: xmltv2epg

2007-02-12 Thread Pjotr Kourzanov

Rob Davis wrote:

Pjotr Kourzanov wrote:

Rob Davis wrote:

Pjotr Kourzanov wrote:

Oops, forgot the scripts;-)

Pjotr Kourzanov wrote:

Dear all,

  Having been dissatisfied with performance and features of xmltv2vdr
(too slow, no credits/category information in epg.data) I have created
a new script (based on AWK), that can be found in the attachment.

  If you want to try it, put your channels.conf.xmltv in one folder
with these two scripts, and then run cat *.xml | ./xmltv2epg > epg.

  My mileage: 54MB XML -> 18MB EPG in 44 minuties (xmltv2vdr used to
take 9 hours).



Looks good, but what does the command line look like?


Well, do a "cat *.xml | ./xmltv2epg > epg" if you have many separate 
xml files.

Otherwise, ./xmltv2epg file.xml > epg should suffice.





Sorry chaps to go back to an old thread..

How would you send epg back into vdr?  I know you could just use it 
directly from vdradmin, but I would like to append the xmltv listings to 
data already downloaded.


Should I just cat >>epg.data - or do I need to upload it using an svdr 
command?


Nowadays I use this script to upload it to the VDR:
#!/bin/sh
{ echo -ne "${clre:+clre\n}"
  echo "quit"
} | netcat localhost 2001

for x in $@; do
{
  echo $x >/dev/stderr
  echo "pute"
  cat $x | ./epgfix
  echo "."
  echo "quit"
} | netcat localhost 2001
done
.

epgfix is to truncate the lines to VDR's 10k limit (for some reason,
10240-1 failed for me once, hence -2:-):
#!/usr/bin/awk -f
{print substr($0,1,10*1024-2)}
.

run it with "clre=1 ./putepg file1 file2 ..." to clear VDR's EPG first.

Regards,
Pjotr.


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] ANNOUCEMENT: xmltv2epg

2007-02-11 Thread Rob Davis

Pjotr Kourzanov wrote:

Rob Davis wrote:

Pjotr Kourzanov wrote:

Oops, forgot the scripts;-)

Pjotr Kourzanov wrote:

Dear all,

  Having been dissatisfied with performance and features of xmltv2vdr
(too slow, no credits/category information in epg.data) I have created
a new script (based on AWK), that can be found in the attachment.

  If you want to try it, put your channels.conf.xmltv in one folder
with these two scripts, and then run cat *.xml | ./xmltv2epg > epg.

  My mileage: 54MB XML -> 18MB EPG in 44 minuties (xmltv2vdr used to
take 9 hours).



Looks good, but what does the command line look like?


Well, do a "cat *.xml | ./xmltv2epg > epg" if you have many separate xml 
files.

Otherwise, ./xmltv2epg file.xml > epg should suffice.





Sorry chaps to go back to an old thread..

How would you send epg back into vdr?  I know you could just use it 
directly from vdradmin, but I would like to append the xmltv listings to 
data already downloaded.


Should I just cat >>epg.data - or do I need to upload it using an svdr 
command?

--
Latest news on http://www.streetcredo.org.uk/rob

Rob Davis

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] ANNOUCEMENT: xmltv2epg

2007-01-22 Thread Pjotr Kourzanov

Rob Davis wrote:

Pjotr Kourzanov wrote:

Oops, forgot the scripts;-)

Pjotr Kourzanov wrote:

Dear all,

  Having been dissatisfied with performance and features of xmltv2vdr
(too slow, no credits/category information in epg.data) I have created
a new script (based on AWK), that can be found in the attachment.

  If you want to try it, put your channels.conf.xmltv in one folder
with these two scripts, and then run cat *.xml | ./xmltv2epg > epg.

  My mileage: 54MB XML -> 18MB EPG in 44 minuties (xmltv2vdr used to
take 9 hours).



Looks good, but what does the command line look like?


Well, do a "cat *.xml | ./xmltv2epg > epg" if you have many separate xml 
files.

Otherwise, ./xmltv2epg file.xml > epg should suffice.


Regards,
Pjotr Kourzanov

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] ANNOUCEMENT: xmltv2epg

2007-01-22 Thread Rob Davis

Pjotr Kourzanov wrote:

Oops, forgot the scripts;-)

Pjotr Kourzanov wrote:

Dear all,

  Having been dissatisfied with performance and features of xmltv2vdr
(too slow, no credits/category information in epg.data) I have created
a new script (based on AWK), that can be found in the attachment.

  If you want to try it, put your channels.conf.xmltv in one folder
with these two scripts, and then run cat *.xml | ./xmltv2epg > epg.

  My mileage: 54MB XML -> 18MB EPG in 44 minuties (xmltv2vdr used to
take 9 hours).



Looks good, but what does the command line look like?


--
Latest news on http://www.streetcredo.org.uk/rob

Rob Davis

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] ANNOUCEMENT: xmltv2epg

2007-01-10 Thread Pjotr Kourzanov

Oops, forgot the scripts;-)

Pjotr Kourzanov wrote:

Dear all,

  Having been dissatisfied with performance and features of xmltv2vdr
(too slow, no credits/category information in epg.data) I have created
a new script (based on AWK), that can be found in the attachment.

  If you want to try it, put your channels.conf.xmltv in one folder
with these two scripts, and then run cat *.xml | ./xmltv2epg > epg.

  My mileage: 54MB XML -> 18MB EPG in 44 minuties (xmltv2vdr used to
take 9 hours).

Pjotr


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



#!/bin/sh
# external dependencies
date="/bin/date"
sed="/bin/sed"
grep="/bin/grep"
recode='/usr/bin/recode -f "$in_charset..$charset"'

# input data
dir=`dirname $0`
channels="$dir/channels.conf.xmltv"

# miscellaneous
htmlnorm='s,<[^<>]*>,\n&\n,g'

in_tz="Europe/Amsterdam"
export in_charset=utf8

export charset=utf8
export LC_ALL=ru_RU.UTF-8
export TZ="Europe/Amsterdam"

xmltv2epg_awk="$dir/xmltv2epg.awk"

$sed -e $htmlnorm | $grep -v "^[ \t\r\n]*$" | $xmltv2epg_awk 
-vchannels="$channels" -vbindate="$date" | eval $recode
#!/usr/bin/awk -f
BEGIN {
stderr="/dev/stderr"
load_channels(channels)
#curid=""
separator["desc"]="|"
separator["display-name"]=separator["title"]=separator["category"]=" / "

separator["adapter"]=separator["presenter"]=separator["director"]=separator["actor"]=",
 "
}

#{ print >stderr }
#/^<[^ \t\r\n]+/
{ handled=0 }

/^/  { handled=1
names[id]=data["display-name"]
if (!channel_src[id]) {
print "NO SRC for",id > stderr
next
}
events[id]=1
}

/^/ {
tag=gensub(/^<([^ \t\r\n]+).*>/,"\\1","g")
#print "bool tag:",tag
curtag[tag]=1
next
}

!handled && /^<[^ \t\r\n]+.*>/ {
tag=gensub(/^<([^ \t\r\n]+).*>/,"\\1","g")
if (tag ~ /^\//) {
tag=substr(tag,2)
value=0
delete active[tag]
} else
active[tag]=1
#tags[tag]=1
#print "tag:",tag,value
next
}

!handled {
for (t in active) 
data[t]=append(data[t],txtconv($0),separator[t])
}

END {
print "c"
#for (t in tags) print t > stderr
}
function load_channels(channels, a,i,n,chsrc,b,c,j,m)
{ oFS=FS; FS=":"
while (getline < channels) if ($0 !~ /^:/)
{
name=$1; freq=$2; mode=$3; src=$4
sr=$5; vpid=$6; apid=$7; tpid=$8
ca=$9; spid=$10; npid=$11; tid=$12
rid=$13; esrc=$14
n=split(esrc,a,";")
for (i=1; i<=n; i++) {
chsrc=src "-" npid "-" tid "-" spid
if (a[i] ~ /^vsetv=/) {
split(a[i],b,"=")
m=split(b[2],c,",")
for (j=1; j<=m; j++) {
print "vsetv:",chsrc,c[j] > stderr

channel_src[c[j]]=append(channel_src[c[j]],chsrc)
channel_ch[chsrc]=append(channel_ch[chsrc],c[j])
}
} else {
m=split(a[i],c,",")
for (j=1; j<=m; j++) {
print "xmltv:",chsrc,c[j] > stderr

#channel_src[c[j]]=append(channel_src[c[j]],chsrc)
channel_src[c[j]]=chsrc
channel_ch[chsrc]=append(channel_ch[chsrc],c[j])
}
}
}
}
  FS=oFS
}
function append(a,b,c) { return a (a ? (c ? c : " ") : "") b }
function txtconv(a)
{
a=gensub("&","\\&","g",a)
a=gensub(""","\"","g",a)
a=gensub("'","'","g",a)
a=gensub("<","<","g",a)
a=gensub(">;",">","g",a)
a=gensub(":",":","g",a)
a=gensub("ö","ö","g",a)
a=gensub("’","'","g",a)
return a
}
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr