themacks / ply

An HLS server for the HDHomeRun Plus
20 stars 6 forks source link

KeyError: 'Tags' when scanning for channels #5

Closed theschles closed 9 years ago

theschles commented 9 years ago

Hi there,

So I'm now trying to get ply working on Ubuntu. I built ffmpeg from snapshot via this guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

I installed ply using easy_install.

I installed hdhomerun_config vai these instructions: http://www.silicondust.com/support/downloads/linux/

I updated my HDTC-2US using the latest firmware (20141114)

Now, when I go into the setup screen, click the Add button next to my HDTC-US, then click the Scan button, I get the following terminal output:

0.0 (1): SELECT * FROM devices
127.0.0.1:41703 - - [10/Jan/2015 14:50:33] "HTTP/1.1 GET /setup" - 200 OK
0.0 (1): SELECT * FROM devices WHERE dev='10505B21'
0.0 (2): UPDATE devices SET ip = '192.168.10.12' WHERE dev='10505B21'
127.0.0.1:41703 - - [10/Jan/2015 14:50:37] "HTTP/1.1 PUT /device/10505B21" - 200 OK
0.0 (1): SELECT * FROM devices
127.0.0.1:41706 - - [10/Jan/2015 14:50:37] "HTTP/1.1 GET /setup" - 200 OK
127.0.0.1:41706 - - [10/Jan/2015 14:50:37] "HTTP/1.1 GET /static/css/base.css" - 200 
127.0.0.1:41706 - - [10/Jan/2015 14:50:37] "HTTP/1.1 GET /static/scripts/base.js" - 200 
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/application.py", line 239, in process
    return self.handle()
  File "/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/application.py", line 420, in _delegate
    return handle_class(cls)
  File "/usr/local/lib/python2.7/dist-packages/web.py-0.37-py2.7.egg/web/application.py", line 396, in handle_class
    return tocall(*args)
  File "/mnt/raid/download/ply/ply.py", line 102, in GET
    db.updateChannels(dbase,devId)
  File "/mnt/raid/download/ply/db.py", line 90, in updateChannels
    channels = hdhr.chan.getChannels(device['ip'])
  File "/mnt/raid/download/ply/hdhomerun/chan.py", line 13, in getChannels
    if channel["Tags"] == "favorite":
KeyError: 'Tags'

127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /device/10505B21" - 500 Internal Server Error
0.0 (1): SELECT * FROM channels
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /" - 200 OK
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/hdln.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/we.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/cw.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/fx.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/wxia.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/fnc.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/discovery.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/wgcl.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/wsb.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/nbc.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/gpb.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/cnbc.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/tlc.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/gpb-kids.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/tbs.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/qubo.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/tnt.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/usa.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/travel.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/nbcsports.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/wpba.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/animal.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/espn2.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/hallmark.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/waga.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/ion_life.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/metv.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/gpb_knowledge.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/fox.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/rfdtv.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/mtv.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/cartoonnetwork.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/cnn.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/abc.png" - 304 Not Modified127.0.0.1:41710 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/cbs.png" - 304 Not Modified

 127.0.0.1:41711 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/e.png" - 304 Not Modified127.0.0.1:41710 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/history.png" - 304 Not Modified

127.0.0.1:41712 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/abcfamily.png" - 304 Not Modified
127.0.0.1:41714 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/default.png" - 304 Not Modified127.0.0.1:41713 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/comedycentral.png" - 304 Not Modified

127.0.0.1:41713 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/movies.png" - 304 Not Modified
 127.0.0.1:41710 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/ion.png" - 304 Not Modified
127.0.0.1:41706 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/weathernation.png" - 304 Not Modified127.0.0.1:41712 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/espn.png" - 304 Not Modified
127.0.0.1:41711 - - [10/Jan/2015 14:50:41] "HTTP/1.1 GET /static/logos/peachtree.png" - 304 Not Modified
weaseltraps commented 9 years ago

I have the same error on:

Windows 8.1 Python27 (64) HDHomerun Plus (Firmware 20141124)

Ply server is running and can find my hdhomerun but the channel scan won't work. I confirmed the data is available in json from the hdhomerun that getChannels is trying to access:

[{"GuideNumber":"3.1","GuideName":"OPB","URL":"http://192.168.1.78:5004/auto/v3.1"},{"GuideNumber":"3.2","GuideName":"OPBPlus","URL":"http://192.168.1.78:5004/auto/v3.2"},{"GuideNumber":"3.3","GuideName":"OPB-FM","URL":"http://192.168.1.78:5004/auto/v3.3"},{"GuideNumber":"7.1","GuideName":"KBNZ-LD","URL":"http://192.168.1.78:5004/auto/v7.1"},{"GuideNumber":"21.1","GuideName":"KTVZ-TV","URL":"http://192.168.1.78:5004/auto/v21.1"},{"GuideNumber":"21.2","GuideName":"NTVZ-DT","URL":"http://192.168.1.78:5004/auto/v21.2"},{"GuideNumber":"21.3","GuideName":"KFXO-LP","URL":"http://192.168.1.78:5004/auto/v21.3"},{"GuideNumber":"51.1","GuideName":"KOHD-DT","URL":"http://192.168.1.78:5004/auto/v51.1"},{"GuideNumber":"5000","GuideName":"Unknown","URL":"http://192.168.1.78:5004/auto/v5000"},{"GuideNumber":"5001","GuideName":"Unknown","URL":"http://192.168.1.78:5004/auto/v5001"}]

themacks commented 9 years ago

Looks like the lineup.json file changed formats in a recent firmware version. Mine broke as well after upgrading to the latest.

Latest commit should fix it: 30e60b990f1bbfcfb195cbae188ca2f2928cfd7a

weaseltraps commented 9 years ago

Yup! Sorry, I figured it was the formatting returned in values but I am pretty green with python to fix it. I can see the channels no in the Roku app. I can 't stream them yet but that is another issue I will look into. Right now I just see continuous GET requests from the roku.

Thanks for your prompt attention in addressing getChannels!