Page 1 of 1

Username and password for AMC Kodi update script

Posted: 18 Nov 2019, 06:25
by ChromeQ
Hi,
I've been trying out the AMC script which has a kodi option. I entered the host but I am getting a 401 auth error since I have set a password on the settings of kodi (.kodi/userdata/guisettings.xml)

Code: Select all

...
    <setting id="services.webserver">true</setting>
    <setting id="services.webserverpassword">**PASSWORD**</setting>
    <setting id="services.webserverport">2620</setting>
    <setting id="services.webserverssl" default="true">false</setting>
    <setting id="services.webserverusername">dav</setting>
...
I have tried to enter the host in the following format: "user:password@host:port"

Code: Select all

Notify Kodi: [host:dav:**PASSWORD**@192.168.0.66, port:2620]
POST: http://dav:**PASSWORD**@192.168.0.66:2620/jsonrpc {"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"FileBot finished processing 1 files","message":"\u2022 Madam.Secretary.S06E07.720p.HDTV.x264-AVS","image":"https://app.filebot.net/icon.png"},"id":1}
IOException: Server returned HTTP response code: 401 for URL: http://dav:**PASSWORD**@192.168.0.66:2620/jsonrpc
Is there a way to get this working as expected as I'd rather not remove the password on Kodi's RPC. Thanks

Re: Username and password for AMC Kodi update script

Posted: 18 Nov 2019, 06:56
by rednoah
1.
The --def kodi option only works for simple LAN configurations. HTTPS and HTTP authentication are not supported


2.
You may use the --def exec to send out arbitrary requests via curl:
https://kodi.wiki/view/HOW-TO:Remotely_update_library

Re: Username and password for AMC Kodi update script

Posted: 18 Nov 2019, 07:02
by ChromeQ
Thanks, I was using curl before. Will the exec command run once per file or per run?
Just wondering if I can get access to the file count or file name as your script does for the notification.

Re: Username and password for AMC Kodi update script

Posted: 18 Nov 2019, 07:39
by rednoah
Both, depending on how many unique commands your --def exec expression generates.

e.g. 1 call:

Code: Select all

--def exec="/path/to/my/script.sh"
e.g. 1 call per 1 file processed:

Code: Select all

--def exec="/path/to/my/script.sh {quote f}"
:!: file count is tricky though, with the --def exec expression.