beralt / horepg

A simple translator between the Horizion JSON format and the XMLTV format
MIT License
10 stars 10 forks source link

Script stops after an internal server error #6

Closed SirJohnDoe closed 8 years ago

SirJohnDoe commented 8 years ago

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.

beralt commented 8 years ago

That was a very irritating issue that has been bugging me for a while too, so I did a quick fix. Thanks for the detailed report. I have some other improvements in testing with regards to the planning of data fetching (and distributing them more evenly). So I'm working on the second part.