realriot / tvheadend-ng.bundle

TV-Headend Next Generation Plex Plugin
BSD 3-Clause "New" or "Revised" License
85 stars 47 forks source link

Can't retrieve channel list #40

Open CSchulz opened 9 years ago

CSchulz commented 9 years ago

I am using tvheadend 4.1

{"sw_version": "4.1","api_version": 15,"name": "Tvheadend","capabilities": ["caclient","tvadapters","satip_client","satip_server","imagecache","timeshift","trace"]}

If I click on all channels or select a bouquet I get the error message "Request failed! Please check channel settings and tvheadend status."

The log contains following:

2015-11-28 15:29:01,409 (7ff4757fa700) :  INFO (__init__:104) - JSON-Request: getServiceGrid
2015-11-28 15:29:01,410 (7ff4757fa700) :  DEBUG (networking:166) - Requesting 'http://192.168.178.3:9981/api/mpegts/service/grid?start=0&limit=999999'
2015-11-28 15:29:01,411 (7ff4757fa700) :  DEBUG (networking:166) - Requesting 'http://192.168.178.3:9981/api/mpegts/service/grid?start=0&limit=999999'
2015-11-28 15:29:01,412 (7ff4757fa700) :  INFO (__init__:132) - JSON-Request failed: exceptions must be old-style classes or derived from BaseException, not str
2015-11-28 15:29:01,412 (7ff4757fa700) :  INFO (__init__:151) - Failed to fetch DVB services!
2015-11-28 15:29:01,412 (7ff4757fa700) :  INFO (__init__:242) - Could not create channellist! Showing error.
2015-11-28 15:29:01,417 (7ff4757fa700) :  DEBUG (runtime:924) - Response: [200] MediaContainer, 437 bytes
jacotec commented 9 years ago

Exactly the same issue here, using TVH 4.0.7 (stable release). Did also not work with the latest 4.1 build.

Recordings are working fine in Plex, but live TV is impossible due to that bug.

2015-11-29 17:49:57,505 (7f736c9cc700) : DEBUG (networking:166) - Requesting 'http://10.0.6.1:9981/api/mpegts/service/grid?start=0&limit=999999' 2015-11-29 17:49:57,507 (7f736c9cc700) : ERROR (networking:217) - Error opening URL 'http://10.0.6.1:9981/api/mpegts/service/grid?start=0&limit=999999' 2015-11-29 17:49:57,508 (7f736c9cc700) : DEBUG (networking:166) - Requesting 'http://10.0.6.1:9981/api/mpegts/service/grid?start=0&limit=999999' 2015-11-29 17:49:57,509 (7f736c9cc700) : ERROR (networking:217) - Error opening URL 'http://10.0.6.1:9981/api/mpegts/service/grid?start=0&limit=999999' 2015-11-29 17:49:57,509 (7f736c9cc700) : INFO (init:132) - JSON-Request failed: exceptions must be old-style classes or derived from BaseException, not str 2015-11-29 17:49:57,509 (7f736c9cc700) : INFO (init:151) - Failed to fetch DVB services! 2015-11-29 17:49:57,509 (7f736c9cc700) : INFO (init:242) - Could not create channellist! Showing error. 2015-11-29 17:49:57,512 (7f736c9cc700) : DEBUG (runtime:88) - Sending packed state data (113 bytes) 2015-11-29 17:49:57,512 (7f736c9cc700) : DEBUG (runtime:924) - Response: [200] MediaContainer, 437 bytes

Entering the "failing" URL in a web browser works.

jacotec commented 9 years ago

UPDATE @CSchulz

I've found the problem! You need to tag the user in TVH which you use in the plugin as an "admin"!

@realriot :

Not sure if this is mandatory, if not you may consider changing this in the next update to not need admin level. I'm a bit careful not passing admin level logins to other services ;-)

fritz-fritz commented 8 years ago

I vaguely remember needing to do this a long time ago and haven't taken a look at it closely. I think it is unfortunately necessary as I have seen similar requirements in the iOS client as well. It may be needed to interact with the API. If I get a chance I'll take a look but it might be simpler to list it as a necessary requirement in the README.

nmatthews commented 8 years ago

I'm having this problem despite having an admin user in TVH. Any guesses as to what else could be causing the issue? TVheadend 4.1-1171~gaa13922 and Plex 0.9.12.19.

The plex channel manages to populate the list of bouquets with my list of channel tags from TVheadend (I don't otherwise have bouquets specified), so it's clearly talking to the tvh server somehow, but that's all it can get.

oriolj commented 8 years ago

I have a similar issue caused by encoding problems. Maybe your list of channels have special characters?

DaveInTO commented 8 years ago

getting similar issues.. tvheadend 4.1-1258~gb480c92 amd64 Tvheadend 2015-12-30 14:15:23,157 (7ff31bfff700) : INFO (init:104) - JSON-Request: getChannelGrid 2015-12-30 14:15:23,160 (7ff31bfff700) : DEBUG (networking:166) - Requesting 'http://192.168.0.10:9981/api/channel/grid?start=0&limit=999999' 2015-12-30 14:15:23,166 (7ff31bfff700) : INFO (init:134) - JSON-Request successfull! 2015-12-30 14:15:23,166 (7ff31bfff700) : INFO (init:104) - JSON-Request: getEpgGrid 2015-12-30 14:15:23,169 (7ff31bfff700) : DEBUG (networking:166) - Requesting 'http://192.168.0.10:9981/api/epg/events/grid?start=0&limit=2000' 2015-12-30 14:15:23,304 (7ff31bfff700) : DEBUG (networking:161) - Fetching 'http://192.168.0.10:9981/api/epg/events/grid?start=0&limit=2000' from the HTTP cache 2015-12-30 14:15:23,307 (7ff31bfff700) : INFO (init:132) - JSON-Request failed: exceptions must be old-style classes or derived from BaseException, not str 2015-12-30 14:15:23,308 (7ff31bfff700) : INFO (init:104) - JSON-Request: getServiceGrid 2015-12-30 14:15:23,310 (7ff31bfff700) : DEBUG (networking:166) - Requesting 'http://192.168.0.10:9981/api/mpegts/service/grid?start=0&limit=999999' 2015-12-30 14:15:23,319 (7ff31bfff700) : INFO (init:134) - JSON-Request successfull! 2015-12-30 14:15:23,319 (7ff31bfff700) : INFO (init:242) - Could not create channellist! Showing error. 2015-12-30 14:15:23,321 (7ff31bfff700) : DEBUG (runtime:88) - Sending packed state data (113 bytes) 2015-12-30 14:15:23,321 (7ff31bfff700) : DEBUG (runtime:924) - Response: [200] MediaContainer, 437 bytes

damhau commented 8 years ago

Hi,

I had exactly the same problem and it was because of a channel name that the plugin didn't like. Try disabling a few channel in tvheadend until it works, then re-enable them one by one (or ten by ten) and you should find the channel that the plugin doesn't like.

Damien

CSchulz commented 8 years ago

Do you remember how the name looked like? It would be easier for debugging and finding the root cause.

damhau commented 8 years ago

Yeah I know but saddly the name was pretty standard, something like Poland TV. I even checked in notepad++ to see if there was any special character but didn't find anything.

What else can I do to help ?

CSchulz commented 8 years ago

Perhaps you can try to reproduce it and store the webservice result.

DaveInTO commented 8 years ago

results.txt

DaveInTO commented 8 years ago

There are the results from the web service that i think is causing the issue

oscar-b commented 8 years ago

I added some additional debugging and got this:

2016-01-10 23:39:04,363 (7f5de3fff700) :  INFO (__init__:104) - JSON-Request: getServiceGrid
2016-01-10 23:39:04,364 (7f5de3fff700) :  DEBUG (networking:166) - Requesting 'http://127.0.0.1:9981/tv/api/mpegts/service/grid?start=0&limit=999999'
2016-01-10 23:39:05,068 (7f5de3fff700) :  INFO (__init__:126) - (2103, 'Data of size 6777367 is greater than the maximum size 5242880')

@realriot ?

oscar-b commented 8 years ago

I was able to get it running by adding a max_size=10000000 parameter to the JSON.ObjectFromURL call in def getTVHeadendJson(), based on this reply: http://forums.plex.tv/discussion/comment/364315/#Comment_364315

Not sure if there are other issues though, since I can't test properly at the moment.

realriot commented 8 years ago

I'll add this workaround.

I really really want everyone to trigger the plex guys to update/offer the latest dev documentation. They really don't support the community anymore.

CSchulz commented 8 years ago

It sounds more like an issue in the paging of the result

oscar-b commented 8 years ago

It's neither a paging issue or a workaround. The reply is simply too large for the Plex libraries upper size limit. The real question is why you're requesting all services instead of just the configured channels.

Anyway, I'm not using this anymore.

espiman commented 8 years ago

Hi.

How I fix this?

Regards.

damhau commented 8 years ago

For me the solution was to delete the channel that was causing the error.

Sent from my iPhone

On 21 Apr 2016, at 23:49, espiman notifications@github.com wrote:

Hi.

How I fix this?

Regards.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

espiman commented 8 years ago

Thanks damhau.

I have only enabled one channel and problem persist.

I have also tried to modify the line 124 in init.py file, but problem persist.

json_data = JSON.ObjectFromURL(encoding='utf-8', url=url, headers=headers, values=None, max_size= 10000000)

Thanks.