NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 83 84 85 86 87 … 159 Next »
EPG problems with TVGids_to_xml

 
  • 0 Vote(s) - 0 Average
EPG problems with TVGids_to_xml
Hebus
Offline

Junior Member

Posts: 40
Threads: 5
Joined: Jan 2004
#11
2007-08-17, 09:00 AM
HtV Wrote:I think TVXB limits the number of channels from which you can retrieve the program description. That's why I stuck to TVgids2xml.

cya Hans

The problem is i can't get anny discription out of the website...
Searching for it now for a week still nothing that works... Sad
HtV
Offline

Posting Freak

Posts: 3,470
Threads: 46
Joined: Dec 2005
#12
2007-08-17, 09:16 AM
From the tvxb.ini

Code:
!------------------------------------------------------------------------------
!
!       *** Be kind to TVGiDS and the other XMLTV users ***
!
! *Remove channels you don't watch to reduce the download time*
!
! If you want full program descriptions for some channels that you watch often,
! then add the following at the end of each of these channels:
!
!    special=fulldescriptions
!    descriptionhtmlstart=<table id="progDetail"
!    descriptionhtmlend=<p class="meerLinks">
!    descriptionhours=1800-0030
!
! *However not for all channels as it will take a very long time to download*
!
!       *** Be kind to TVGiDS and the other XMLTV users ***
!
! Insert channel schedule information below this line
!----------------------------------------------------
[nederland1.gids.nl]
name=Nederland 1
url=http://www.tvgids.nl/zoeken/?trefwoord=&station=1&genre=&interval=[relseq=0,1,2,3,4,5,6]&timeslot=0
htmlstart=[day=w dd Mmm]
start=1
stop=1,-
title=3

Did you add this to the channels you want the descriptions from:

Code:
!    special=fulldescriptions
!    descriptionhtmlstart=<table id="progDetail"
!    descriptionhtmlend=<p class="meerLinks">

Don't forget to delete the exclamation marks at the beginning of each line.

cya Hans
AMD Athlon 64 3000, HDD: 80, 120, 200 GB, Hauppauge 350 + 150, MVP, Asus 6000L Laptop client, Asus X50sl client,
Fritz!box 7140 modem/router, GBPVR 1.3.7.
Hebus
Offline

Junior Member

Posts: 40
Threads: 5
Joined: Jan 2004
#13
2007-08-17, 09:58 AM
is this the same for tvgids.be ?
HtV
Offline

Posting Freak

Posts: 3,470
Threads: 46
Joined: Dec 2005
#14
2007-08-17, 10:01 AM
I think so, it's all in the belgian ini file.
AMD Athlon 64 3000, HDD: 80, 120, 200 GB, Hauppauge 350 + 150, MVP, Asus 6000L Laptop client, Asus X50sl client,
Fritz!box 7140 modem/router, GBPVR 1.3.7.
Hebus
Offline

Junior Member

Posts: 40
Threads: 5
Joined: Jan 2004
#15
2007-09-19, 01:47 PM
dang xtvb does not work annymore they have changed sommething on there site sombody has a working ini file for belgium ? Its seems i'm the only one from belgium here that has trouble to get a decent TVguide Sad.
Nobody has a decent working system ?
Wim Fabri
Offline

Junior Member

Posts: 10
Threads: 0
Joined: Oct 2006
#16
2007-09-19, 04:51 PM
Hebus Wrote:dang xtvb does not work annymore they have changed sommething on there site sombody has a working ini file for belgium ? Its seems i'm the only one from belgium here that has trouble to get a decent TVguide Sad.
Nobody has a decent working system ?

I have written a perl script to download the tv guide from skynet.be.
Thanks to your post I noticed it stopped working : skynet requires some cookies to be set now.

here is my code : (notice that the channel section is currently hardcoded - you will have to update the path to the firefox cookies file)

Code:
#!/usr/bin/perl -w
#use diagnostics;
use strict;
use IO::File;
use XML::Simple;
use Data::Dumper;
use LWP::UserAgent;
use Encode qw(encode);
use HTTP::Cookies::Netscape;

my $encoding = Encode::resolve_alias("utf-8");

my $channels={};
$channels->{een}{url}="http://tv-nl.skynet.be/index.html?l1=entertainment&l2=tvguide&l3=programs&l4=channels&channelid=7&date=";
$channels->{'Ketnet-Canvas'}{url}="http://tv-nl.skynet.be/index.html?l1=entertainment&l2=tvguide&l3=programs&l4=channels&channelid=9&date=";
$channels->{'la-une'}{url}="http://tv-nl.skynet.be/index.html?l1=entertainment&l2=tvguide&l3=programs&l4=channels&channelid=52&date=";
$channels->{'la-deux'}{url}="http://tv-nl.skynet.be/index.html?l1=entertainment&l2=tvguide&l3=programs&l4=channels&channelid=53&date=";

my $icons={};

my $fh=new IO::File("c:/temp/xmltv.xml","w");
my $log=new IO::File("c:/temp/xmltv.log","w");

print $fh "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print $fh "<tv>\n";
print $fh "  <channel id=\"een\">\n";
print $fh "    <display-name>een</display-name>\n";
print $fh "    <icon src=\"http://images.mds.prd.skynet.be/TVGuideEPG/Channel/Small/42_29_een.jpg\"></icon>\n";
print $fh "  </channel>\n";
print $fh "  <channel id=\"Ketnet-Canvas\">\n";
print $fh "    <display-name>Ketnet-Canvas</display-name>\n";
print $fh "    <icon src=\"http://images.mds.prd.skynet.be/TVGuideEPG/Channel/Small/42_29_canvas.jpg\"></icon>\n";
print $fh "  </channel>\n";
print $fh "  <channel id=\"la-une\">\n";
print $fh "    <display-name>La Une</display-name>\n";
print $fh "    <icon src=\"http://images.mds.prd.skynet.be/TVGuideEPG/Channel/Small/42_29_laune.jpg\"></icon>\n";
print $fh "  </channel>\n";
print $fh "  <channel id=\"la-deux\">\n";
print $fh "    <display-name>La Deux</display-name>\n";
print $fh "    <icon src=\"http://images.mds.prd.skynet.be/TVGuideEPG/Channel/Small/42_29_ladeux.jpg\"></icon>\n";
print $fh "  </channel>\n";

my $timestamp=time();
for (my $d=0;$d<8;$d++) {
    my ($day,$month,$year)=(localtime($timestamp+$d*24*60*60))[3..5];
    my $date=sprintf("%04d%02d%02d",$year+1900,$month+1,$day);
    my ($nday,$nmonth,$nyear)=(localtime($timestamp+($d+1)*24*60*60))[3..5];
    my $nextDate=sprintf("%04d%02d%02d",$nyear+1900,$nmonth+1,$nday);
    foreach my $channel (keys %$channels) {
        my $url=sprintf("$channels->{$channel}{url}%04d-%02d-%02d",$year+1900,$month+1,$day);
        print $log $url,"\n";
    
        my $ua=new LWP::UserAgent;
        my $cookie_jar = HTTP::Cookies::Netscape->new(
            file => "C:/Documents and Settings/userid/Application Data/Mozilla/Firefox/Profiles/profiledir/cookies.txt",
        );
        $ua->cookie_jar( $cookie_jar );

        my $response=$ua->get($url);
        my $html=$response->content;

        my @rows=($html=~m/<li class="(dark|light)"(.+?)<\/li>/g);
        my $prevTime='0000';
        my $startDate=$date;
        my $endDate=$date;
        for (my $i=1;$i<@rows;$i+=6) {
            print $log $rows[$i],"\n";
            my ($startTime)=($rows[$i]=~m/{TIMESTYLE}>(.+?)u<\/span>/);
            print $log $startTime,,"\n";
            $startTime='0'.$startTime if length($startTime)<5;
            substr($startTime,2,1)='';
            next if ($prevTime eq '0000') and ($startTime ge '2200');   # skip entries before midnight
            if ($startTime lt $prevTime) {
                $startDate=$nextDate;
                $endDate=$nextDate;
            }
            $prevTime=$startTime;
            
            my ($descLink,$title,$category)=($rows[$i+2]=~m/<a href="(.+?)" class="listlink">(.+?)<\/a> <span class="subtext">\((.+?)\)<\/span>/);
            print $log $title,"\n";
            $response=$ua->get("http://tv-nl.skynet.be$descLink");
            $html=$response->content;
            my ($desc)=($html=~/<p class="white">(.+?)<\/p>/);        
            $desc=~s/\&/\&amp;/g if defined $desc;
            $desc=~s/<.+?>//g if defined $desc;        # remove html tags
            
            my ($icon)=($html=~/<img src="(.+?)" class="content_border" \/>/);
            $icons->{$title}=$icon if defined $icon;
            
            my ($endTime)=($html=~/tot (.+?)<\/strong>/);
            if (not defined $endTime) {
                ($endTime)=($rows[$i+6]=~m/{TIMESTYLE}>(.+?)u<\/span>/);
            }
            $endTime='0'.$endTime if length($endTime)<5;
            substr($endTime,2,1)='';
            $endDate=$nextDate if $endTime lt $startTime;
            
            my ($subtitle)=($html=~/<h4 class="title">(.+?)<\/h4>/);
            my ($cast)=($html=~/<p><strong>Cast: <\/strong> <span class="white" style="display:inline;">(.+?)<\/span>/);
            my ($regisseur)=($html=~/<p><strong>Regisseur: <\/strong> <span class="white" style="display:inline;">(.+?)<\/span>/);
            my ($jaar)=($html=~/<p><strong>Jaar: <\/strong> <span class="white" style="display:inline;">(.+?)<\/span>/);
             my ($genre)=($html=~/<p><strong>Genre:<\/strong> <span class="white" style="display:inline;">(.+?)<\/span>/);
             my ($land)=($html=~/<p><strong>Land: <\/strong> <span class="white" style="display:inline;">(.+?)<\/span>/);
            
            print $fh "<programme start=\"$startDate$startTime CET\" stop=\"$endDate$endTime CET\" channel=\"$channel\" clumpidx=\"0/1\">\n";
            $title=~s/\&/\&amp;/g;
            print $fh "<title>",encode($encoding,$title),"</title>";
            if (defined $genre) {
                my @genres=split / - /,$genre;
                foreach my $g (@genres) {
                    print $fh "\n<category>",encode($encoding,$g),"</category>" ;
                }
            } else {
                print $fh "\n<category>",encode($encoding,$category),"</category>" ;
            }
            print $fh "\n<sub-title>",encode($encoding,$subtitle),"</sub-title>" if defined $subtitle;
            print $fh "\n<desc>",encode($encoding,$desc) if defined $desc;
            print $fh "\nRegie : ",encode($encoding,$regisseur) if defined $regisseur;
            print $fh "\nMet : ",encode($encoding,$cast) if defined $cast;
            print $fh "\nLand : $land" if defined $land;
            print $fh " - Jaar : $jaar" if defined $jaar;
            print $fh "\n</desc>" if defined $desc;
            print $fh "\n<icon src=\"$icon\"></icon>" if defined $icon;
            print $fh "\n</programme>\n";
        }
    }
}

print $fh "</tv>\n";
$fh->close();
$log->close();

# download icons
$encoding = Encode::resolve_alias("cp1252");
my $targetDir="c:\\Program Files\\devnz\\gbpvr\\media\\art";
system("del \"$targetDir\\*\" /Q");

foreach my $title (keys %$icons) {
    $title=~s/://g;
    
    if (not -e "$targetDir\\$title.jpg") {
        print encode($encoding,"wget -O \"$targetDir\\$title.jpg\" \"$icons->{$title}\" "),"\n";
        system(encode($encoding,"wget -O \"$targetDir\\$title.jpg\" \"$icons->{$title}\" 2>&1"));
    } else {
        print "$targetDir\\$title.jpg\n";
    }
    
}
Hebus
Offline

Junior Member

Posts: 40
Threads: 5
Joined: Jan 2004
#17
2007-09-20, 07:05 AM
Thats sounds good Smile can you give me some more info how to use it (im not a programmer :o ).

I suppose i need to ad extra channels under my channels?
Wim Fabri
Offline

Junior Member

Posts: 10
Threads: 0
Joined: Oct 2006
#18
2007-09-20, 05:31 PM (This post was last modified: 2007-09-21, 06:02 AM by Wim Fabri.)
Hebus Wrote:Thats sounds good Smile can you give me some more info how to use it (im not a programmer :o ).

I suppose i need to add extra channels under my channels?

yes, and also add print statements that write the channel section of the xml. This section could be written from data on the skynet website, but since I only use 4 channels it wasn't worth the effort.

You have to update following line with the path to your firefox cookies file (if you use internet explorer the code will have to be modified).
file => "C:/Documents and Settings/userid/Application Data/Mozilla/Firefox/Profiles/profiledir/cookies.txt"
In firefox, go to the tv guide on the skynet site to store the required cookies.

You also will have to install perl if you didn't do that allready for something else.
Hebus
Offline

Junior Member

Posts: 40
Threads: 5
Joined: Jan 2004
#19
2007-09-20, 07:18 PM
Ok and how does i start it Noob here :p
Wim Fabri
Offline

Junior Member

Posts: 10
Threads: 0
Joined: Oct 2006
#20
2007-09-21, 06:06 AM
Hebus Wrote:Ok and how does i start it Noob here :p

Save the script in a file with extension pl and you should be able to run it as any other program or script if perl is installed.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): « Previous 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems on smartphone sdf 4 3,310 2019-08-08, 08:45 PM
Last Post: sub
  Reception problems p37307 3 2,143 2019-05-10, 01:19 AM
Last Post: p37307
  Newbie problems BenMic 10 5,697 2016-02-28, 01:53 AM
Last Post: sub
  Anyone else have zero problems? ga_mueller 0 1,475 2014-09-10, 07:12 PM
Last Post: ga_mueller
  Network adapter problems pcostanza 9 3,476 2013-10-31, 01:46 PM
Last Post: pcostanza
  Forum problems? pcostanza 60 15,144 2011-02-14, 03:38 PM
Last Post: sub
  FYI: S3 problems under Windows 7 x64 (not fully working as it should) ShiningDragon 0 1,788 2011-01-02, 03:27 AM
Last Post: ShiningDragon
  Nvidia HDMI Audio Problems. rookie 3 2,912 2009-02-11, 12:54 AM
Last Post: rookie
  HD input on server to MVP, any problems? mkenyon2 15 5,533 2008-07-16, 04:28 PM
Last Post: sub
  Vista problems pcostanza 8 3,336 2008-01-30, 01:37 PM
Last Post: pcostanza

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode