MythTV and EPG Data

From Blue-IT.org Wiki

Revision as of 21:44, 13 May 2007 by Apos (talk | contribs) (Added how to secure mythweb)

MyhtTV

MythTV is the well known linux HPTC software.

One of the major advantages is the availability of an electronic program guide, that is fetched from grabbing tv-guide web pages with an external program: the 'grabber'.

On of the major problems setting up the mythtv program guide is, that the 'grabbers' are not part of myhttv and it is not trivial to install them.

None of these grabbers - for a list see xmltv - runs out of the box after installation.

Xmltv_prisma

After a having a lot of problems with the xmltv grabber, my favorite grabber is xmltv_prisma. It uses the webpage of the Prisma TV Guide.

Alter the mythtv channels table

The very first thing you have to do is to add an 'xmltvid' to each channel in the table 'channels' in the mythtv database. This database is named per default is 'mythconverg'.

What is the 'xmltvid' for a certain channel? Very easy. It is exact the string that you can read in your configuration file after you called

tv_grab_de_prisma --configure --gui

This file is located per default in '~/.xmltv/tv_grab_de_prisma.conf'. It looks like this

[...] 
channel 3.br-online.de #BR
channel 3sat.de #3SAT
channel ard.de #ARD
channel arte-tv.com #arte
channel dsf.com #DSF
channel einsplus.ard.de #Einsplus (ARD digital)
channel eurosport.de #Eurospor
[...]

The string after channel is the 'xmltvid'. The following command will give you these id's (uses mawk):

cat /home/whoever/.xmltv/tv_grab_de_prisma.conf  | mawk '{gsub(/^channel /,"");system("echo " $0 "")}'

You have to enter it manually into your database.

This could be done ether by editing the table with e.g. phpmyadmin or add them into the 'configuration' page of 'mythweb' (a plugin for myhttv).

Secure Mythweb

I got the next informations from a german wiki:[1] After you installed mythweb, the following points should be considered.

[...] Damit Digest überhaupt funktioniert, muss der Apache entsprechend konfiguriert sein.

Unter Debian Sarge mit Apache 1.3.x genügt hierzu ein

echo "LoadModule digest_auth_module /usr/lib/apache/1.3/mod_auth_digest.so" \

>> /etc/apache/modules.conf

Für apache2 geht es folgendermaßen:

a2enmod auth_digest
a2enmod authn_file
a2enmod authz_user
/etc/init.d/apache2 force-reload               

Die .htaccess mit dem Editor öffnen:

vi /usr/share/mythtv/mythweb/.htaccess

Folgender Auszug muss auskommentieren werden:

AuthType           Digest
AuthName           "MythTv"
AuthDigestFile     /var/www/htdigest <- UNBEDINGT IN /var/htdigest ÄNDERN! 
Require            valid-user

Dies bedeutet, dass wir mit dem Tool htdigest eine Datei mit dem Namen /var/htdigest anlegen müssen. Im Gegensatz zur alten Methode spielt hier allerdings auch die AuthName-Zeile eine Rolle, die bei htdigest unter der Bezeichnung Realm (zu deutsch: Bereich) angegeben werden muss.

htdigest akzeptiert laut man-page folgende Parameter:

htdigest [ -c ] passwdfile realm username

was uns also im konkreten Beispiel zu folgender Befehlszeile führt (mit verändertem Pfad):

htdigest -c /var/htdigest MythTV mythtv

Achtung! Die Option -c überschreibt die angegebene Datei, also Vorsicht! Danach ruft man die mythweb.php erneut auf und loggt sich mit seinem Usernamen(hier: mythtv) und dem angegebenen Passwort ein [...]