Giter VIP home page Giter VIP logo

horepg's Introduction

horepg

โš ๏ธ The API this project uses had been taken offline. Fortunately a good replacement can be found here: https://github.com/jbogers/ziggogo-epg

This simple script parses EPG data from the service at horizon.tv (which is used by a product sold by a digital cable provider in the Netherlands). The original data is formatted JSON. This script translated that to the XMLTV format and passes that to TVHeadend using the 'external grabber' interface. This interface is a Unix socket which is read by TVHeadend.

The script fetches a channel list from TVHeadend, and tries to match channels found in the Horizon data to channels found in TVHeadend. As long as you keep the channel names as provided on the DVB-C network a match is very likely, and no configuration is required.

EPG data for radio channels is added using oorboekje.nl as source. This is disabled by default, and enabled by passing the '-R' option on the commandline. j

Configuration

The script attempts to fetch a list of channels from TVHeadend using the JSON API, credentials can be passed on the commandline.

The script attempts to switch to the 'hts' user, with its group set to 'video'. This is what is default on my system, so you might want to changes this to reflect your own setup.

The script daemonizes by default, and waits 24 hours before fetching a new batch of data.

Dependencies

The only dependency is the Requests package, required for Basic Authentication for authentication in TVHeadend.

Installation

Use setuptools to install HorEPG:

python setup.py install

Usage

usage: horepgd.py [-h] [-s [PATH]] [-p [PATH]] [-u [USER]] [-g [GROUP]] [-d]
                  [-tvh HOST] [-tvh_username USERNAME]
                  [-tvh_password PASSWORD] [-R]
                  [-o [PATH]]

Fetches EPG data from the Horizon service and passes it to TVHeadend.

optional arguments:
  -h, --help            show this help message and exit
  -s [PATH]             path to TVHeadend XMLTV socket
  -p [PATH]             path to PID file
  -u [USER]             run as USER
  -g [GROUP]            run as GROUP
  -d                    daemonize
  -1                    Run once, then exit
  -nr [DAYS]            Number of days to fetch
  -tvh HOST             the hostname of TVHeadend to fetch channels from
  -tvh_username USERNAME
                        the username used to login into TVHeadend
  -tvh_password PASSWORD
                        the password used to login into TVHeadend
  -R                    fetch EPG data for radio channels
  -o                    path to output XML data instead of pushing to TVHeadend

This would require some privileges to switch to the user and group if daemonizing. The script daemonizes by default, and logging is using syslog().

Improvements

  • It would be nice to stop the whole reconnecting for each channel thingy.
  • Maybe this should be a proper xmltv parser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.