beralt / horepg Goto Github PK
View Code? Open in Web Editor NEWA simple translator between the Horizion JSON format and the XMLTV format
License: MIT License
A simple translator between the Horizion JSON format and the XMLTV format
License: MIT License
Since the layout change i'm not getting any data from oorboekje, i double checked code (and argument -R) and reinstalled it multiple times on my Synology NAS without luck.
Syslog doesn't provide me any info that could be useful.
/edit:
Problem seems to be bigger now. After i stopped HorEPG in DSM it won't start anymore.
I'm getting following error:
root@tvheadend:/usr/local/bin# python3 /usr/local/bin/horepgd.py -s /home/hts/.hts/tvheadend/epggrab/xmltv.sock -p /run/horepgd.pid -u hts -g video -tvh tvheadend -tvh_username xxxxxxx -tvh_password xxxxxxxxxx
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): tvheadend
DEBUG:requests.packages.urllib3.connectionpool:http://tvheadend:9981 "GET /api/channel/list HTTP/1.1" 200 960
DEBUG:root:Fetching listings for 30 channels
DEBUG:root:Switching hosts
DEBUG:root:Switching hosts
DEBUG:root:Adding 364 programmes for channel Nicktoons
Traceback (most recent call last):
File "/usr/local/bin/horepgd.py", line 4, in
import('pkg_resources').run_script('HorEPG==0.1', 'horepgd.py')
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 739, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1501, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.5/dist-packages/HorEPG-0.1-py3.5.egg/EGG-INFO/scripts/horepgd.py", line 146, in
File "/usr/local/lib/python3.5/dist-packages/HorEPG-0.1-py3.5.egg/EGG-INFO/scripts/horepgd.py", line 142, in main
File "/usr/local/lib/python3.5/dist-packages/HorEPG-0.1-py3.5.egg/EGG-INFO/scripts/horepgd.py", line 89, in run_import
File "/usr/local/lib/python3.5/dist-packages/HorEPG-0.1-py3.5.egg/horepg/tvheadend.py", line 33, in send
FileNotFoundError: [Errno 2] No such file or directory
Hello,
seems like the api were changed. Now channel id is not numeric, but something like:
lgi-nl-prod-master:65535-NL_000001_019401
I've started to debug it, but without luck now. The code at this point is not working. I've attached current channels listing
Create Syno package and launched it but it failed on importing module request
root@DS715:/var/packages/HorEPG/scripts# ./start-stop-status start
Starting HorEPG ...
Traceback (most recent call last):
File "/var/packages/HorEPG/target/horepgd.py", line 17, in
from tvheadend import *
File "/volume1/@appstore/HorEPG/tvheadend.py", line 7, in
import requests
ImportError: No module named 'requests'
I also needed to modify start-stop-status script since it couldn't find horepgd.py
Added variable SYNOPKG_PKGNAME="HorEPG"
Since today, 17-10-2022, horepgd can't connect any longer to Salt & Pepper :( Does anyone know if there are new URLs available ?
DEBUG:root:Fetching listings for 300 channels
DEBUG:root:Switching hosts due to status code 404 from host web-api-salt.horizon.tv
DEBUG:root:Switching hosts due to status code 404 from host web-api-pepper.horizon.tv
Traceback (most recent call last):
File "/home/hts/horepg/horepgd.py", line 154, in
main()
File "/home/hts/horepg/horepgd.py", line 147, in main
run_import(channels, args.tvhsocket, args.do_radio_epg, args.nr_days, args.output_path)
Let my try to explain my current problem:
I only want to stream SD channels, but some channels are not found/matched
i.e. RTL 7
After some investigation it turns out that the horizon.tv API, only outputs for example the RTL 7 HD channel.
See https://web-api-pepper.horizon.tv/oesp/api/NL/nld/web/channels.com
":{"id":"24443943014","countryCode":"NL","locationId":"24443942973","title":"RTL 7 HD",".........
Would it be possible to find/match the channels, based on channel name PLUS a wildcard * ?
i.e RTL 7 -> RTL 7* (tvheadend channel RTL 7 would then be matched against horizon.tv RTL 7 HD epg data)
For some reason the horizon site seems to time out or be unavailable for short periods of time. The script will output a 500 Internal Server Error when retrieving listings, yet the listings appear to be available immediately after when running the script again, so a simple retry of the script would still make sure that the program listings are retrieved.
Added 67 programmes for channel AMC
Traceback (most recent call last):
File "/home/hts/horepg.py", line 209, in
nr = nr + listings.obtain(xmltv, channel_id, start, end)
File "/home/hts/horepg.py", line 171, in obtain
raise Exception('Failed to GET listings url:', response.status, response.reason)
Exception: ('Failed to GET listings url:', 500, 'Internal Server Error')
hts@raspberrypi:~$
Another thing, the deamon will run every 24h after it's completed the initial run, it'd be better if you could specify an exact time at which it should run and then repeat after 24 hours, because now there's no consistency and script requires resources as well which you can't allocate to a specific time slot.
Other than that it works great, cheers.
when running app, it fetch tvh channels, but fails to proceed as class is wrongly invoked.
File "/home/ldymek/horepg-master/horepg/xmltvdoc.py", line 169, in addProgramme
element.setAttribute('start', XMLTVDocument.convert_time(int(start)))
TypeError: unbound method convert_time() must be called with XMLTVDocument instance as first argument (got int instance instead)
Using your (modified) script for a really long time on Windows Media Center without any problem. Thank for that!
But last week I'm getting "No data available" sections in my channel EPG always with the same duration (about 12 hours) from about 12AM to 12PM, but not on all channels.
Is this related to the "fetch in blocks of 6 hours (8 hours is the maximum block size allowed)" modification in your script? Or is this only for using it with TVHeadend (which I'm not)?
The server web-api-salt.horizon.tv
does not work anymore and/or does not support the API used by horepg. The other server, web-api-pepper.horizon.tv
, still functions but because the return code the 'salt' server sends (404) is unexpected, horepg crashes.
To fix this, return code 404 should also be used to switch from server, just like code 403 is.
Recently I setup my system again and downloaded the latest version of Horepg. It works well, I run it in cron every morning so I can control at what time it will update the EPG, but I noticed there are no episode numbers for any channel listings.
Is this feature removed? Is it not provided anymore on the Horizon site? Or is the script not functioning properly?
Hi,
I love your script, but either make it a full service (such as http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
or make it an console util which does not exit.
Both are fine for systemd, in this state there is no supported way for systemd to know that the state is.
Hi, I've managed to fetch PL guide using your script. It will be nice to have possibility to grab other countries at once, in case when we have some foreign ones (PL,DE,NL etc).. for example by adding argument on commandline (-l DE,PL,NL..)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.