summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-05-07 18:33:49 +0200
committerJochen Dolze <vdr@dolze.de>2012-05-07 18:33:49 +0200
commit0ef63a4652cc361a0067acb02b778c456b7190be (patch)
tree20dd2308757449bc28c786e2e5d108d3be3cdcd6
parenta401b5286f128d99ef627dc3522545f60899b1b9 (diff)
downloadvdr-plugin-xmltv2vdr-0ef63a4652cc361a0067acb02b778c456b7190be.tar.gz
vdr-plugin-xmltv2vdr-0ef63a4652cc361a0067acb02b778c456b7190be.tar.bz2
Improved epgdata2xmltv, added audio/video/starrating/icon-tags
-rw-r--r--dist/epgdata2xmltv/Makefile4
-rw-r--r--dist/epgdata2xmltv/epgdata2xmltv.cpp56
-rw-r--r--dist/epgdata2xmltv/epgdata2xmltv.dist179
-rw-r--r--dist/epgdata2xmltv/epgdata2xmltv.h1
-rw-r--r--dist/epgdata2xmltv/epgdata2xmltv.xsl56
5 files changed, 194 insertions, 102 deletions
diff --git a/dist/epgdata2xmltv/Makefile b/dist/epgdata2xmltv/Makefile
index e13b84d..bf8a089 100644
--- a/dist/epgdata2xmltv/Makefile
+++ b/dist/epgdata2xmltv/Makefile
@@ -67,7 +67,9 @@ install: epgdata2xmltv
@cp epgdata2xmltv $(INSTALL)
$(STRIP) $(INSTALL)/epgdata2xmltv
@mkdir -p /var/lib/epgsources
+ @mkdir -p /var/lib/epgsources/epgdata2xmltv-img
@cp epgdata2xmltv.dist /var/lib/epgsources/epgdata2xmltv
+ @chown -R vdr.vdr /var/lib/epgsources
dist: clean
@-rm -rf $(TMPDIR)/epgdata2xmltv
@@ -77,7 +79,7 @@ dist: clean
@-rm -rf $(TMPDIR)/epgdata2xmltv
clean:
- @-rm -f $(OBJS) $(DEPFILE) epgdata2xmltv epgdata2xmltv_xsl.h
+ @-rm -f $(OBJS) $(DEPFILE) *.*~ epgdata2xmltv epgdata2xmltv_xsl.h
distclean: clean
@-rm -f *~ *.tgz
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.cpp b/dist/epgdata2xmltv/epgdata2xmltv.cpp
index b463274..bde5557 100644
--- a/dist/epgdata2xmltv/epgdata2xmltv.cpp
+++ b/dist/epgdata2xmltv/epgdata2xmltv.cpp
@@ -212,8 +212,8 @@ int cepgdata2xmltv::Fetch(const char *dest, const char *pin, int day)
}
if (ret==-63)
{
- esyslog("filesize exceeded, please report this!");
- return 1;
+ esyslog("filesize exceeded, please report this!");
+ return 1;
}
return 0;
}
@@ -247,7 +247,7 @@ int cepgdata2xmltv::Process(int argc, char *argv[])
}
char *line=NULL,*lptr=NULL;
size_t size;
- if (getline(&line,&size,f)==(ssize_t) -1)
+ if (getline(&line,&size,f)==(ssize_t) -1)
{
fclose(f);
esyslog("failed to read epgdata2xmltv config");
@@ -281,6 +281,8 @@ int cepgdata2xmltv::Process(int argc, char *argv[])
time_t t=time(NULL);
+ int carg=3;
+
for (int day=0; day<=daysinadvance; day++)
{
time_t td=t+(day*86400);
@@ -466,6 +468,50 @@ int cepgdata2xmltv::Process(int argc, char *argv[])
}
}
}
+
+ if (!strcmp(argv[3],"1")) {
+ carg++;
+ int entries=zip_get_num_files(zip);
+ for (int i=0; i<entries; i++)
+ {
+ const char *name=zip_get_name(zip,i,0);
+ if (strstr(name,"jpg")) {
+
+ char *destjpg;
+ if (asprintf(&destjpg,"/var/lib/epgsources/epgdata2xmltv-img/%s",name)!=-1) {
+ //FILE *f=fopen("/var/lib/epgsources/epgdata2xmltv","r");
+ struct stat statbuf;
+ if (stat(destjpg,&statbuf)==-1) {
+ struct zip_file *zfile=zip_fopen_index(zip,i,0);
+ if (zfile)
+ {
+ struct zip_stat sb;
+ memset(&sb,0,sizeof(sb));
+ if (zip_stat_index(zip,i,ZIP_FL_UNCHANGED,&sb)!=-1) {
+ if (sizeof(sb.size>4)) sb.size &= 0x00FFFFFF; // just to be sure
+ char *jpg=(char *) malloc(sb.size+1);
+ if (jpg) {
+ int size=zip_fread(zfile,jpg,sb.size);
+ if (size==sb.size) {
+ FILE *j=fopen(destjpg,"w+");
+ if (j) {
+ fwrite(jpg,size,1,j);
+ fclose(j);
+ }
+ }
+ }
+ }
+ zip_fclose(zfile);
+ }
+ }
+ free(destjpg);
+ }
+ }
+ }
+ } else {
+ if (!strcmp(argv[3],"0")) carg++;
+ }
+
zip_close(zip);
if (!ok)
{
@@ -545,7 +591,7 @@ int cepgdata2xmltv::Process(int argc, char *argv[])
if (sc) *sc=0;
bool use=false;
- for (int i=3; i<argc; i++)
+ for (int i=carg; i<argc; i++)
{
if (!strcasecmp(lptr,argv[i]))
{
@@ -561,7 +607,7 @@ int cepgdata2xmltv::Process(int argc, char *argv[])
printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
printf("<tv generator-info-name=\"epgdata2xmltv\">\n");
- for (int i=3; i<argc; i++)
+ for (int i=carg; i<argc; i++)
{
printf("<channel id=\"%s\">\n",argv[i]);
printf("<display-name lang=\"de\">%s</display-name>\n",argv[i]);
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.dist b/dist/epgdata2xmltv/epgdata2xmltv.dist
index 110eeb0..4c61f34 100644
--- a/dist/epgdata2xmltv/epgdata2xmltv.dist
+++ b/dist/epgdata2xmltv/epgdata2xmltv.dist
@@ -1,109 +1,100 @@
-pipe;00:00;1
+pipe;00:00;1;1
17
+13th-street.de;471
+3sat.de;56
+animax.de;539
ard.de;71
-zdf.de;37
arte.de;58
-3sat.de;56
+atvplus.at;115
+axntv.de;468
+bayern3.de;51
+beate-uhse-tv.de;123
+bibeltv.de;280
+bloombergtv.de;127
+boomerang-tv.de;493
br-alpha.de;104
-einsmuxx.de;475
-einsfestival.de;146
+cartoon-network.de;132
+classica.de;133
+cnn.de;69
+das-vierte.de;486
+discovery-channel.de;138
+disney-channel.de;139
+dmax.de;507
+dsf.de;64
einsextra.de;100
-zdfinfo.de;276
-zdf-theaterkanal.de;275
-zdfneo.de;659
-phoenix.de;194
-bayern3.de;51
+einsfestival.de;146
+einsmuxx.de;475
+espn-classic-sport.com;591
+euronews.de;68
+eurosport-2.de;504
+eurosport.de;65
+fashiontv.fr;455
+focus-gesundheit.de;476
+fox-channel.de;565
+goldstar-tv.de;152
+gotv.at;391
+heimatkanal.de;154
hessen3.de;49
-rbb.de;52
-swr.de;50
-wdr.de;46
-ndr.de;47
+history-channel.de;452
+hse24.de;159
+junior.de;160
+kabel1.de;44
+kabel-eins-classics.de;492
kika.de;57
+kinowelt-tv.de;450
mdr.de;48
+mgm.de;630
+motorvision-tv.de;627
+mtv.de;70
+mtv-entertainment.de;553
+n24.de;175
+national-geographic.de;453
+national-geographic-wild.de;626
+ndr.de;47
+nickcomedy.de;589
+ntv.de;66
+orf1.at;54
+orf2.at;55
+phoenix.de;194
+playhouse-disney.de;460
+prosieben.de;40
+qvc.de;208
+rbb.de;52
+romance-tv.de;552
+rtl2.de;41
+rtl-crime.de;527
rtl.de;38
+rtl-living.de;528
+rtl-passion.de;529
+sat1-comedy.de;491
sat1.de;39
-rtl2.de;41
-prosieben.de;40
-superrtl.de;43
-kabel1.de;44
-vox.de;42
+sci-fi.de;472
sixx.de;694
-das-vierte.de;486
+sky-action.de;613
+sky-cinema-1.de;611
+sky-cinema-24.de;612
+sky-cinema.de;610
+sky-cinema-hits.de;618
+sky-comedy.de;617
+sky-emotion.de;616
+sky-krimi.de;615
+sky-nostalgie.de;614
+sky-select.de;628
+sky-sport-austria.at;622
+spiegel-geschichte.de;625
+superrtl.de;43
+swr.de;50
tele5.de;277
-9live.de;1179
-ntv.de;66
-euronews.de;68
-n24.de;175
-bloombergtv.de;127
-cnn.de;69
-eurosport.de;65
-dsf.de;64
-nickcomedy.de;589
-dmax.de;507
-hse24.de;159
-qvc.de;208
-bibeltv.de;280
+the-biography-channel.de;536
timm.de;588
-orf1.at;54
-orf2.at;55
-atvplus.at;115
+tnt-film.de;633
+tnt-serie.de;590
tw1.at;265
+vh1-classic.eu;496
viva.de;266
-mtv.de;70
-gotv.at;391
-fashiontv.fr;455
-
- Sky Deutschland
-610 = S19.2E-133-2-10 Sky Cinema,Cinema;SKY
-611 = S19.2E-133-2-11 Sky Cinema +1,Cinema1;SKY
-612 = S19.2E-133-2-43 Sky Cinema +24,Cinema24;SKY
-613 = S19.2E-133-2-9 Sky Action,Action;SKY
-617 = S19.2E-133-2-8 Sky Comedy,Comedy;SKY
-616 = S19.2E-133-2-20 Sky Emotion,Emotion;SKY
-614 = S19.2E-133-3-516 Sky Nostalgie,Nostalgie;SKY
-618 = S19.2E-133-3-41 Sky Cinema Hits,CineHits;SKY
-630 = S19.2E-133-3-25 Disney Cinemagic,Cinemagic;SKY
-1196 = S19.2E-133-3-515 MGM;SKY
-138 = S19.2E-133-4-14 Discovery Channel,Discovery;SKY
-453 = S19.2E-133-4-13 National Geographic,NatGeo;SKY
-626 = S19.2E-133-4-12 NatGeo Wild,NG Wild;SKY
-625 = S19.2E-133-4-52 Spiegel Geschichte,SpiegelG;SKY
-627 = S19.2E-133-1-168 Motorvision TV,Motorvis;SKY
-476 = S19.2E-133-4-15 Focus Gesundheit,Focus;SKY
-615 = S19.2E-133-1-23 Sky Krimi,SkyKrimi;SKY
-527 = S19.2E-133-1-27 RTL Crime,RTLCrime;SKY
-471 = S19.2E-133-1-42 13th Street,13Street;SKY
-472 = S19.2E-133-17-36 SciFi;SKY
-565 = S19.2E-133-1-16 Fox Serie,Fox;SKY
-590 = S19.2E-133-1-50 TNT Serie,TNTSerie;SKY
-529 = S19.2E-133-1-29 RTL Passion,Passion;SKY
-154 = S19.2E-133-17-22 Heimatkanal,Heimat;SKY
-139 = S19.2E-133-17-34 Disney Channel,Disney;SKY
-460 = S19.2E-133-17-26 Playhouse Disney,Playhouse;SKY ???
-160 = S19.2E-133-17-19 Junior;SKY
- = S19.2E-133-17-28 Disney XD,DisneyXD;SKY ???
-152 = S19.2E-133-17-518 Goldstar TV,Goldstar;SKY
-133 = S19.2E-133-17-24 Classica;SKY
-123 = S19.2E-133-17-21 Beate-Uhse.TV,BeateU;SKY
-491 = S19.2E-1-1107-17505 Sat.1 Comedy;ProSiebenSat.1
-468 = S19.2E-133-9-62 AXN Action,AXN;arena/SKY
-633 = S19.2E-133-9-61 TNT Film (TCM),TNT Film;arena/SKY
-492 = S19.2E-1-1107-17506 kabel eins classics;ProSiebenSat.1
-450 = S19.2E-133-9-60 Kinowelt TV,Kinowelt;SKY ???
-552 = S19.2E-133-9-63 Romance TV,Romance;SKY ???
-551 = S19.2E-1-1078-28682 NICK PREMIUM (S);MTV Networks Europe ???
-493 = S19.2E-133-9-66 Boomerang;arena/SKY ???
-132 = S19.2E-1-1102-13204 Cartoon Network (a/S);arena/SKY
-452 = S19.2E-133-9-68 History;SKY
-536 = S19.2E-1-1102-13208 Biography Channel;arena/SKY ???
-528 = S19.2E-1-1102-13207 RTL Living;arena/SKY
- = S19.2E-133-9-67 e.clips;SKY ???
-539 = S19.2E-1-1102-13203 ANIMAX;arena/SKY
-553 = S19.2E-1-1078-28681 MTV ENTERTAINMENT (S);MTV Networks Europe ???
-496 = S19.2E-1-1066-28657 VH1 Classic;MTV Networks Europe ???
-504 = S19.2E-1-1102-13205 EuroSport 2 (a/S);arena/SKY
-591 = S19.2E-1-1115-13105 ESPN America (S);SKY
-622 = S19.2E-133-7-53 Sky Sport Austria,SportAut;SKY
-628 = S19.2E-133-4-18 Sky Select,SkySel;SKY
-
- Musik
+vox.de;42
+wdr.de;46
+zdf.de;37
+zdfinfo.de;276
+zdfkultur.de;275
+zdfneo.de;659
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.h b/dist/epgdata2xmltv/epgdata2xmltv.h
index 818e883..8496837 100644
--- a/dist/epgdata2xmltv/epgdata2xmltv.h
+++ b/dist/epgdata2xmltv/epgdata2xmltv.h
@@ -7,7 +7,6 @@
#define __EPGDATA2XMLTV_H
#include <curl/curl.h>
-#include <curl/types.h>
#include <curl/easy.h>
#include <libxslt/transform.h>
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.xsl b/dist/epgdata2xmltv/epgdata2xmltv.xsl
index 7eac71b..6b0dfcd 100644
--- a/dist/epgdata2xmltv/epgdata2xmltv.xsl
+++ b/dist/epgdata2xmltv/epgdata2xmltv.xsl
@@ -32,8 +32,28 @@
G <xsl:value-of select="d25"/>
</xsl:variable>
-<xsl:variable name="CREW">
+<xsl:variable name="PICS">
+<xsl:if test="string-length(d38)">
+<xsl:element name="icon">
+<xsl:attribute name="src">file:///var/lib/epgsources/epgdata2xmltv-img/<xsl:value-of select="d38"/></xsl:attribute>
+</xsl:element>
+<xsl:text>&#x0A;</xsl:text>
+</xsl:if>
+<xsl:if test="string-length(d39)">
+<xsl:element name="icon">
+<xsl:attribute name="src">file:///var/lib/epgsources/epgdata2xmltv-img/<xsl:value-of select="d39"/></xsl:attribute>
+</xsl:element>
+<xsl:text>&#x0A;</xsl:text>
+</xsl:if>
+<xsl:if test="string-length(d40)">
+<xsl:element name="icon">
+<xsl:attribute name="src">file:///var/lib/epgsources/epgdata2xmltv-img/<xsl:value-of select="d40"/></xsl:attribute>
+</xsl:element>
+<xsl:text>&#x0A;</xsl:text>
+</xsl:if>
+</xsl:variable>
+<xsl:variable name="CREW">
<xsl:if test="string-length(d36)">
<xsl:call-template name="output-tokens">
<xsl:with-param name="list"><xsl:value-of select="d36"/></xsl:with-param>
@@ -69,11 +89,38 @@ G <xsl:value-of select="d25"/>
</xsl:variable>
<xsl:variable name="VIDEO">
+
+<xsl:if test="d29='1'">
+<aspect>16:9</aspect><xsl:text>&#x0A;</xsl:text>
+</xsl:if>
+
+<xsl:if test="d11='1'">
+<colour>no</colour><xsl:text>&#x0A;</xsl:text>
+</xsl:if>
+
</xsl:variable>
<xsl:variable name="AUDIO">
+<xsl:choose>
+<xsl:when test="d28='1'">
+ <xsl:text>dolby digital</xsl:text>
+</xsl:when>
+<!--
+<xsl:when test="d12='1'">
+ <xsl:text>bilingual</xsl:text>
+</xsl:when>
+-->
+<xsl:when test="d27='1'">
+ <xsl:text>stereo</xsl:text>
+</xsl:when>
+</xsl:choose>
</xsl:variable>
+<xsl:variable name="STARRATING">
+<xsl:if test="d30 &gt; 0">
+<star-rating><value><xsl:value-of select="d30"/><xsl:text>/5</xsl:text></value></star-rating><xsl:text>&#x0A;</xsl:text>
+</xsl:if>
+</xsl:variable>
<xsl:variable name="vps_iso8601">
<xsl:if test="string-length(d8)">
@@ -148,6 +195,9 @@ G <xsl:value-of select="d25"/>
<xsl:if test="string-length($EVENTID)">
<category lang="de"><xsl:value-of select="$EVENTID"/></category><xsl:text>&#x0A;</xsl:text>
</xsl:if>
+<xsl:if test="string-length($PICS)">
+<xsl:copy-of select="$PICS"/>
+</xsl:if>
<xsl:if test="string-length($LAND)">
<country><xsl:value-of select="$LAND"/></country><xsl:text>&#x0A;</xsl:text>
</xsl:if>
@@ -158,6 +208,10 @@ G <xsl:value-of select="d25"/>
<audio><xsl:text>&#x0A;</xsl:text><stereo><xsl:value-of select="$AUDIO"/></stereo><xsl:text>&#x0A;</xsl:text></audio><xsl:text>&#x0A;</xsl:text>
</xsl:if>
+<xsl:if test="string-length($STARRATING)">
+<xsl:copy-of select="$STARRATING"/>
+</xsl:if>
+
</xsl:element>
<xsl:text>&#x0A;</xsl:text>
</xsl:for-each>