Project

General

Profile

run tv_grab_nl.py as tvheadend user (on Synology)

Added by theo vh almost 9 years ago

The plan is to use tvgrabnlpy to generate xmltv file to use as grabber in tvheadend.
In order to let tvheadend see the xmltv files and use it as an internal grabber these files need to be placed in the home directory of tvheadend.
I have tvheadend running here: /volume1/@appstore/tvheadend-4.0/ with username tvheadend in the usergroup root. As you can see here:
drwxr-xr-x 7 tvheaden root 4096 Jan 4 00:40 tvheadend-4.0

Now, the problem is that when I run the command /volume1/homes/tvheadend/tv_grab_nl_py/tv_grab_nl.py --configure files are generated in /root/.xmltv/
Most xmltv programs will create a xml file at /home/hts/.xmltv/tv_grab_file.xmltv, assuming that “hts” is the TVHeadEnd username on the system.

The question is how do run this command as user tvheadend ?

Second question: how do I use these grab files as an internal grabber in tvheadend?
This article has some good pointers on how to do that.

Once you have created the xml file, it can be imported into the TVHeadEnd, MediaPortal, or MythTV database. To import it into TVHeadEnd, you need to use a file called* tv-grab-file*, which must be downloaded and moved into the /usr/bin directory on the system running TVHeadEnd (be sure to make it executable, since it is a bash script).......

When I downloaded tvgrabnlpy the zip file contained a subfolder named tvheadend. Inside this was a file tv_grab_nl. So can I use this? (Maybe with some changes to the right directories and filenames??)
This is the original script of the tv_grab_nl file:

#!/bin/bash
XML_OUT=${HOME}/tv_out.xml
[ -f $XML_OUT ] && rm -f $XML_OUT
/home/tv_grab_nl.py $@ --output $XML_OUT
[ $? == 0 -a -f $XML_OUT ] && cat $XML_OUT