Updating Kodi HTTP 401 error

Any questions? Need some help?
Post Reply
iampaulh
Power User
Posts: 22
Joined: 24 Jan 2013, 12:12

Updating Kodi HTTP 401 error

Post by iampaulh »

I added a password to Kodi's remote control via HTTP

I'm calling --def xbmc=localhost:80 and now get a 401 error, naturally

How do I pass the username and password to Kodi? I see that Plex has a token system, but can't seem to find anything on the forum about Kodi
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Updating Kodi HTTP 401 error

Post by rednoah »

401 means access denied. You can pass username and password same as with URLs.

e.g.

Code: Select all

--def kodi=username:password@server:port
:idea: Please read the FAQ and How to Request Help.
iampaulh
Power User
Posts: 22
Joined: 24 Jan 2013, 12:12

Re: Updating Kodi HTTP 401 error

Post by iampaulh »

Thanks, but I'm still getting the 401 error, even with the correct username, password, port, and host

AMC log says

Code: Select all

Notify Kodi: [host:kodi:Kodipassword@localhost, port:80]
GET: http://kodi:Kodipassword@localhost:80/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22FileBot+finished+processing+1+files%22%2C%22message%22%3A%22Newshow.mkv%22%2C%22image%22%3A%22http%3A%2F%2Fapp.filebot.net%2Ficon.png%22%7D%2C%22id%22%3A1%7D
Server returned HTTP response code: 401 for URL: http://kodi:Kodipassword@localhost:80/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22FileBot+finished+processing+1+files%22%2C%22message%22%3A%22NEWShow.mkv%22%2C%22image%22%3A%22http%3A%2F%2Fapp.filebot.net%2Ficon.png%22%7D%2C%22id%22%3A1%7D
However, if I copy and paste the URL from the AMC log into Chrome's simple REST Client, it works.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Updating Kodi HTTP 401 error

Post by rednoah »

What happens if you load the URL with curl?
:idea: Please read the FAQ and How to Request Help.
iampaulh
Power User
Posts: 22
Joined: 24 Jan 2013, 12:12

Re: Updating Kodi HTTP 401 error

Post by iampaulh »

If I run CURL from another machine, I get an OK message, but running CURL locally on my kodi box (win10) I get the 401 error!

I tried with localhost, IP address and 127.0.0.1, all give 401 error.

On my other Win10 laptop, using the IP address, it works with: {"id":1,"jsonrpc":"2.0","result":"OK"}
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Updating Kodi HTTP 401 error

Post by rednoah »

Sounds more like a local network, firewall or Kodi issue.

If curl doesn't work, then it's unsurprising that the amc script doesn't either.
:idea: Please read the FAQ and How to Request Help.
vgabor99
Posts: 2
Joined: 04 Mar 2017, 15:11

Re: Updating Kodi HTTP 401 error

Post by vgabor99 »

Hello,

On my Synology NAS, I get the HTTP 401 too.
Using curl (from the NAS, same user transmission), it's all ok.

The end of amc log:

Notify Kodi: [host:xxx:[email protected], port:8080]
GET: http://xxx:[email protected]:8080/jsonrp ... %22%3A1%7D
IOException: Server returned HTTP response code: 401 for URL: http://xxx:[email protected]:8080/jsonrp ... %22%3A1%7D
Done ヾ(@⌒ー⌒@)ノ

This is the curl call:
transmission@NAS:~$ curl http://xxx:[email protected]:8080/jsonrp ... %22%3A1%7D
{"id":1,"jsonrpc":"2.0","result":"OK"}

This is so weird.
I am pretty sure it's not amc-related but still could use some tips.
vgabor99
Posts: 2
Joined: 04 Mar 2017, 15:11

Re: Updating Kodi HTTP 401 error

Post by vgabor99 »

PS. now I added the VideoLibrary.Sync and the GUI.Notification calls to the end of my transmission-postprocess script (with curl), and it is working. So I ended up having the same effect. But still it puzzles me why the amc script fails.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Updating Kodi HTTP 401 error

Post by rednoah »

No idea. Should be exactly the same. The only thing that comes to mind is that FileBot will probably be using your system proxy by default, while curl will not by default.
:idea: Please read the FAQ and How to Request Help.
Post Reply