Release Kanzi: Amazon Alexa skill for Kodi - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +--- Thread: Release Kanzi: Amazon Alexa skill for Kodi (/showthread.php?tid=254502) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
RE: Amazon Echo skill for Kodi - digiltd - 2016-10-18 (2016-10-17, 15:34)freemans13 Wrote: I've forked the excellent work done by m0ngr31 to add some PVR functionality. It would be good if you could get this to a stage where you can collaborate and add this to m0ngr31's repo. That is what Git is all about The basic workflow would be (in case you don't know) to fork the repo you want to collaborate on (keep the name the same to not confuse things). Create a new branch from the master branch and give it a name relevant to the feature you are adding e.g. "pvr-control". Make your changes on the new branch and then when ready you push the branch to your GitHub and then submit a pull request back to the original repo. It will only get merged when m0ngr31 is happy with it. At the moment it seems that what you have so far is very specific to your local needs, with UK channels being hard coded into the wsgi.py file. So it not ready to be merged into the main repo just yet. But with a bit of polishing it could be. RE: Amazon Echo skill for Kodi - digiltd - 2016-10-18 (2016-10-18, 13:11)rlg6767 Wrote:(2016-10-14, 14:32)jonjon Wrote: You would need to make a small adjustment to kodi.py to enable https Have you setup your LetsEncrypt certificate? If so then close those ports for the moment. I have written a reply in more detail but I am waiting on some pull requests to be merged to save you making the minor tweaks yourself RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-18 (2016-10-18, 17:23)jonjon Wrote: Have you setup your LetsEncrypt certificate? If so then close those ports for the moment. Yep., LetsEncrypt certificate is up and running. I am able to browse to Plex using https://mydynamicdns/plex and login. Just can't seem to get it working for Kodi webserver. Thanks for your input!! Much appreciated. RE: Amazon Echo skill for Kodi - freemans13 - 2016-10-19 (2016-10-18, 13:17)jonjon Wrote:(2016-10-17, 15:34)freemans13 Wrote: I've forked the excellent work done by m0ngr31 to add some PVR functionality. I've renamed the repo back to kodi-alexa. I've kept it on the master branch for now. I've removed all logic that rendered the system 'UK only'. I've added the concept of 'channel aliases' which caters for me being lazy and asking for bbc 1 rather than bbc 1 london. At the moment the aliases are hard coded but for non-UK kodi pvr users things should still work fine - you just won't have any aliases. For the EPG program search I've added logic to grab as much as it can within 15 seconds and then to scan the grabbed data for upto a maximum of another 15 seconds. I've had to do this to allow for people like me who are deploying this as an AWS lambda and have to make sure the alexa skills handler doesn't timeout. In theory everything I've done should work for any PVR user. Hope this helps. https://github.com/freemans13/kodi-alexa RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-19 (2016-10-18, 17:23)jonjon Wrote: Have you setup your LetsEncrypt certificate? If so then close those ports for the moment. Can you share the nginx configuration for the Kodi location please? The following doesn't work as the kodi webserver root is "" I believe, and this is trying to access http://serveraddress/kodi. But If I remove "kodi" from the location it complains that I have set two roots.... I'm so close yet still quite far away..... location /kodi { proxy_pass http://192.168.1.68:8745; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } I have everything else working..... RE: Amazon Echo skill for Kodi - digiltd - 2016-10-19 (2016-10-19, 09:50)rlg6767 Wrote: Can you share the nginx configuration for the Kodi location please? The following doesn't work as the kodi webserver root is "" I believe, and this is trying to access http://serveraddress/kodi. But If I remove "kodi" from the location it complains that I have set two roots.... I'm so close yet still quite far away..... I feel your pain, I wanted to wait till the pull requests were done but as you appear to know what you are doing, the following might help Because you can control traffic based on the "subfolder" of the url used. Use this to add another security step. It can also be used to control multiple Kodi installs. The two locations below mean that traffic to: https://DYNDNS.DOMAINNAME.COM:33133/Khj4THRVesHB7UmuNntXWscUmXbcfjftFo3oGUr is sent to a PC in the living room and traffic sent to: https://DYNDNS.DOMAINNAME.COM:33133/avjUDGkns8c9UKFaYsAmFmbqiZ9bjhhXsfBubzh goes to a different install of Kodi on a laptop. In order for this to work in the skill you need to change some bits in kodi.py, I wont go through setting up all the different bits that will let users set these details in the .env file. That will be in the main repo soon enough. As a super hacky hack you can comment out the bit that concats the url and hardcode it in as a quick fix Code: # url = "%s://%s:%s/jsonrpc" % (SCHEME, KODI, PORT) If you used the port 33333 at shown in the example above then open the port and forward it to the box running the Nginx server. Code: # Kodi 1 on a PC in the living room Good luck, RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-19 (2016-10-19, 16:27)jonjon Wrote:(2016-10-19, 09:50)rlg6767 Wrote: Can you share the nginx configuration for the Kodi location please? The following doesn't work as the kodi webserver root is "" I believe, and this is trying to access http://serveraddress/kodi. But If I remove "kodi" from the location it complains that I have set two roots.... I'm so close yet still quite far away..... So I can browse to https://mydynamicdns:33113/kodi and it is proxying to the webserver. But when I try and test the skill I can see the service request go out but the service response is: "There was an error calling the remote endpoint, which returned HTTP 500 : Internal Server Error" The Heroku log shows the following: 2016-10-19T16:22:58.365301+00:00 app[web.1]: Trying to play a random movie 2016-10-19T16:22:58.365433+00:00 app[web.1]: mydynamicdns/kodi 2016-10-19T16:22:58.365271+00:00 app[web.1]: Requested intent: PlayRandomMovie 2016-10-19T16:23:28.364968+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/" host=myheroapp.herokuapp.com request_id=eda773dd-7440-4cb6-9a50-c01baa50fa97 fwd="72.21.217.173" dyno=web.1 connect=0ms service=30001ms status=503 bytes=0 2016-10-19T16:23:28.801968+00:00 app[web.1]: [2016-10-19 16:23:28 +0000] [3] [CRITICAL] WORKER TIMEOUT (pid:9) 2016-10-19T16:23:28.829737+00:00 app[web.1]: [2016-10-19 16:23:28 +0000] [15] [INFO] Booting worker with pid: 15 2016-10-19T16:23:28.803522+00:00 app[web.1]: [2016-10-19 16:23:28 +0000] [9] [INFO] Worker exiting (pid: 9) RE: Amazon Echo skill for Kodi - digiltd - 2016-10-20 (2016-10-19, 18:05)rlg6767 Wrote: So I can browse to https://mydynamicdns:33113/kodi and it is proxying to the webserver. When you said it was proxying to the webserver when using https://mydynamicdns:33113/kodi did you mean the Kodi one or Nginx? If the proxy and dyndns is setup correctly when you access https://mydynamicdns:33113/kodi from a browser you should get a the htaccess login pop up asking for your kodi username and password. Once you log in you should have access to the Kodi web interface. Ignoring the Skill, does yours work as described above? RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-20 (2016-10-20, 14:24)jonjon Wrote: When you said it was proxying to the webserver when using https://mydynamicdns:33113/kodi did you mean the Kodi one or Nginx? Yep. that's exactly how it's working from the browser. It's Proxy-ing me through to the Kodi web interface via "https://mydynamicdns:33113/kodi" and I can successfully browse movies etc. RE: Amazon Echo skill for Kodi - jingai - 2016-10-20 Make certain that these environment variables are set correctly: Code: KODI_ADDRESS Also, make sure you're not blocking connections from Heroku servers inadvertently. The skill is timing out trying to connect to Kodi, so one of the above things is likely the issue. RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21 (2016-10-20, 18:30)jingai Wrote: Make certain that these environment variables are set correctly: I'm sure the variables are set correctly. I'm now getting the following error in the Heroku log: http://pastebin.com/7zwZ7fF2 I can see in the NGINX log that the request is coming through: http://pastebin.com/Sb2KTzxT Any ideas please? RE: Amazon Echo skill for Kodi - jingai - 2016-10-21 (2016-10-21, 10:02)rlg6767 Wrote: I can see in the NGINX log that the request is coming through: It doesn't look like it's forwarding the actual command: Code: 54.227.97.6 - mykodiusername [21/Oct/2016:07:52:54 +0000] "POST /jsonrpc HTTP/1.1" 400 264 "-" "python-requests/2.11.1" Notice the 400 HTTP error code. That is a malformed request response (Bad Request). "POST /jsonrpc HTTP/1.1" in this instance should be "POST /jsonrpc?Player.GetActivePlayers HTTP/1.1" RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21 (2016-10-21, 13:30)jingai Wrote:(2016-10-21, 10:02)rlg6767 Wrote: I can see in the NGINX log that the request is coming through: Just ran it again and it is posting a different log: 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:26 +0000] "POST /kodi/jsonrpc?Player.GetActivePlayers HTTP/2.0" 200 302 "https://mydynamicdns:33113/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl$ 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:27 +0000] "POST /kodi/jsonrpc?Player.GetActivePlayers HTTP/2.0" 200 302 "https://mydynamicdns:33113/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl$ 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:28 +0000] "POST /kodi/jsonrpc?Player.GetActivePlayers HTTP/2.0" 200 302 "https://mydynamicdns:33113/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl$ 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:29 +0000] "POST /kodi/jsonrpc?Profiles.GetCurrentProfile HTTP/2.0" 200 336 "https://mydynamicdns:33113/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) A$ 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:29 +0000] "POST /kodi/jsonrpc?Profiles.GetProfiles HTTP/2.0" 200 393 "https://mydynamicdns:33113/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWe$ 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:29 +0000] "POST /kodi/jsonrpc?Player.GetActivePlayers HTTP/2.0" 200 302 "https://mydynamicdns:33113/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl$ 192.168.1.1 - kodilivingroom [21/Oct/2016:11:19:30 +0000] "POST /kodi/jsonrpc?Player.GetActivePlayers HTTP/2.0" 499 0 "https://mydynamicdns:33133/kodi/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW$ RE: Amazon Echo skill for Kodi - jingai - 2016-10-21 192.168.1.1 is what? Your router? RE: Amazon Echo skill for Kodi - rlg6767 - 2016-10-21 (2016-10-21, 14:02)jingai Wrote: 192.168.1.1 is what? Your router? Correct. Def gw. |