tvgrabbers / tvgrabpyAPI

An xmltv-API for extracting and merging tv programme information from several sources
https://github.com/tvgrabbers/tvgrabpyAPI/releases/latest
GNU General Public License v3.0
27 stars 8 forks source link

Cannot disable source 8 #51

Open Laibalion opened 4 years ago

Laibalion commented 4 years ago

When trying to disable source 8 via --disable-source 8, and error happens when writing the config file:

2020-04-19 23:29:21.950 spawn: Executing "/usr/bin/tv_grab_nl3.py"
2020-04-19 23:29:22.374 spawn: Loaded the English texts file
2020-04-19 23:29:22.385 spawn: Using config file: /var/packages/tvheadend/target/.xmltv/tv_grab_nl3_py.conf
2020-04-19 23:29:22.621 spawn:   Downloading tv_grab_API.json...
2020-04-19 23:29:22.735 spawn:   Downloading tv_grab_nl.json...
2020-04-19 23:29:23.014 spawn: An unexpected error has occured:
2020-04-19 23:29:23.015 spawn: Traceback (most recent call last):
2020-04-19 23:29:23.015 spawn:   File "/usr/lib/python2.7/site-packages/tvgrabpyAPI/tv_grab_config.py", line 142, in grabber_main
2020-04-19 23:29:23.015 spawn:     x = config.validate_commandline()
2020-04-19 23:29:23.015 spawn:   File "/usr/lib/python2.7/site-packages/tvgrabpyAPI/tv_grab_config.py", line 765, in validate_commandline
2020-04-19 23:29:23.015 spawn:     self.write_opts_to_log()
2020-04-19 23:29:23.015 spawn:   File "/usr/lib/python2.7/site-packages/tvgrabpyAPI/tv_grab_config.py", line 2741, in write_opts_to_log
2020-04-19 23:29:23.015 spawn:     log_array.append(u'  prime_source = %s (%s)\n' % (src_id, self.channelsource[src_id].source))
2020-04-19 23:29:23.015 spawn: KeyError: -1
hikavdh commented 4 years ago

For some reason the Prime_source value for one of your channels is not properly set. Can you include your configuration and log, so I can check why?

Laibalion commented 4 years ago

sure. tv_grab_nl3_py.conf.txt tv_grab_nl3_py.log

hikavdh commented 4 years ago

You have two channels enabled in your config file that only get data from nieuwsblad.be: ROB_TV (Chanid=8-rob-tv) and Ketnet (Chanid=8-ketnet). They where also available on primo but that source is dead. So if you want to disable nieuwsblad first disable those channels. It is a bug that it crashes instead of simply removing the channel and I will fix that in a next update of the program.

Laibalion commented 4 years ago

That's weird. Humo.be, tvgids.nl and tvgids.tv also have info for Ketnet. ROB_TV is a local station and indeed I can disable that one and just use the internal EPG for that. Is there a way i can configure it that Ketnet uses Humo as prime data source?

hikavdh commented 4 years ago

Nieuwsblad is the only one with just the Ketnet programming. On al the other sources Ketnet is combined with Één+ and Canvas+ so you must to get that data select the Ketnet/Eén+/Canvas+;2;1-ketnet-canvas-2 channel. At the top of your log you see all active setting.

hikavdh commented 4 years ago

Another alternative is to not disable nieuwsblad global, but per channel. For instance:

# Eén
[Channel 0-5]
prime_source = 10
disable_source = 8
Laibalion commented 4 years ago

Not sure I understand. For example https://www.humo.be/tv-gids/ketnet has only ketnet programming (which be handy as it also has a lot of season and episode information in it's details, Which is actually the reason I wanted to disable source 8, as it often doesn't have a lot of details or season/episode information). Or do you mean the sources are configure in such way that it doesn't know about Ketnet standalone?

hikavdh commented 4 years ago

Maybe this has changed, but I do not handle the channel configuration. The data from Humo is since their recent big update a bit in flux and I am sure my colleague will update on any chance in the future.

Laibalion commented 4 years ago

Not sure where to post this, but if this project is interested in a comprehensive, provider offered TV guide, Telenet has one @ https://www.telenettv.be/nl/tv/tv-guide.html. It has all the icons too for Belgian stations. Maybe useful to pick up as source in a new version?

hikavdh commented 4 years ago

The thing with the season/episode data is another thing. I'm still researching. My present guess is that this data is not initially added but on a later date. Base pages are reread for the current day, but detail pages are not. So that's work in progress. Oh and disabling the nieuwsblad source won't give you what you are looking for. I have also been looking into replacement sources for Primo, but no decision has yet been made.

Laibalion commented 4 years ago

alright, thanks for the information. Will be eagerly await updated versions.

Just fyi, once I got this script/tool up and running on my NAS, which was a bit annoying due to security settings, it's super nice for the most part. In parallel I'm also running Plex with it's LiveTV and DVR facilities, and to be honest, their EPG is currently horrible, which some channels having completely wrong timeframes etc... So this solution actually is giving me better results than their payed solution ;).

hikavdh commented 4 years ago

Yes getting it to run on a NAS is troublesome. Any channel/source updates are transparent. If a fresh configuration run is needed it will show in your log file.

Laibalion commented 4 years ago

Is there a mechanism with which we can suggest improvements to for example channel icons? Or do we just create seperate 'issues' for those? I don't fully understand yet where the current ones are comming from, or how their url is formed. For a lot of the Belgian ones, they can be sourced from Telenet's cdn. for example https://www2.telenet.be/content/dam/www-telenet-be/img/channels/VIJF.png for the station VIJF, https://www2.telenet.be/content/dam/www-telenet-be/img/channels/vtm.png for VTM, etc...

kyl416 commented 4 years ago

The Humo.be page for Ketnet DOES have Een+/Canvas+ programming, it's the shows that air between 20:00-06:00, although right now its just VGT and open audiodescriptie programming since sports are currently shutdown so there's no live Sporza programming to air: https://www.humo.be/tv-gids/ketnet

The Nieuwsblad source for Ketnet only includes the 06:00-20:00 programming and doesn't display the overnight een+/canvas+ programming: https://www.nieuwsblad.be/tv-gids/ketnet

Instead they have een+/canvas+ listed as a seperate channel: https://www.nieuwsblad.be/tv-gids/eenplus

So we have a process that when you select Ketnet/Een+/Canvas+ (1-ketnet-canvas-2) it automatically merges in the two nieuwsblad pages 8-ketnet and 8-eenplus.

I'll look into the logos soon, I can get most of them via Nieuwsblad.

Laibalion commented 4 years ago

@kyl416 now I feel like an idiot :D. By using channel Ketnet/Eén+/Canvas+, it gets the programming from vrt.be's tv guide instead, which seems to have season/episode info in their basic fetch. Hoeray! And indeed, I can disable source 8 now (as I disabled ROB_Tv and standalone Ketnet). There is still some issues with detail fetches for example Nickelodeon/Spike (for example Blaze en de monsterwielen isn't getting season/episode info). But there is another issue open here.

Specifically for this 'issue', maybe it's enough to write to log which channels loose their only source, which causes the source disabling to fail?