Kodi 401 for URL

Support for Windows users
Post Reply
foodninja06
Posts: 6
Joined: 08 Nov 2017, 15:15

Kodi 401 for URL

Post by foodninja06 »

So I have been slowly working my way through all the options and working out bugs in my python script so filebot takes my files and moves them and now I want to update the kodi library and I keep getting the same 401 for URL code.

System info:
Aleinware M14x R2 running Windows 10
Filebot from windows store
Latest python and filebot installed (the rest of the script works eg, file rename and moving)

So this is my python script:

Code: Select all

# Run Program: 
# "C:\Users\me\Documents\utorrent-postprocess.pyw" "%L" "" "%N" "multi" "" "%F"
#
# Test with Console:
# py "C:\Users\me\Documents\utorrent-postprocess.pyw" "" "" "The.Big.Bang.Theory.S11E02.HDTV.x264-LOL[eztv].mkv" "multi" "" "D:\Downloads"


import sys
import subprocess


# configuration
output = 'D:/Transfer'


# custom formats (use / instead of \ as directory separator)
movieFormat  = '''D:/Transfer/Movies/{n} ({y})'''
seriesFormat = '''I:/TV Shows/{n}/Season {s}/{n} {s00e00} {t}'''
animeFormat  = '''{plex}'''
musicFormat  = '''{plex}'''


# required args
label, state, title, kind, file, directory = sys.argv[1:7]


command = [
	'filebot', '-script', 'fn:amc',
	'--output', output,
	'--action', 'duplicate',
	'--conflict', 'skip',
	'-non-strict',
	'--log-file', output + '/amc.log',
	'--def',
                'excludeList=amc.txt',
		'unsorted=y',
		'movieFormat='  + movieFormat,
		'seriesFormat=' + seriesFormat,
		'animeFormat='  + animeFormat,
		'musicFormat='  + musicFormat,
		'ut_label=' + label,
		'ut_state=' + state,
		'ut_title=' + title,
		'ut_kind='  + kind,
		'ut_file='  + file,
		'ut_dir='   + directory,
                'kodi=Kodi:[email protected]:8080'
]


# execute command only for certain conditions (disabled by default)
'''
if state not in ['5', '11']:
	print('Illegal state: %s' % state)
	sys.exit(0)
'''


# execute command (and hide cmd window)
subprocess.run(command, creationflags=0x08000000)
and this is the error from amc.log:

Code: Select all

Notify Kodi: [host:Kodi:[email protected], port:8080]
POST: http://Kodi:[email protected]:8080/jsonrpc {"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"FileBot finished processing 1 files","message":"The.Big.Bang.Theory.S11E02.HDTV.x264-LOL[eztv].mkv","image":"https://app.filebot.net/icon.png"},"id":1}
IOException: Server returned HTTP response code: 401 for URL: http://Kodi:[email protected]:8080/jsonrpc
Done ヾ(@⌒ー⌒@)ノ
At first I thought it might of been excluded from the library update, but I checked this. I've only just started learning today about python, handy, but I'm not sure what to do to fix this. Any help would be greatly appreciated. :)
foodninja06
Posts: 6
Joined: 08 Nov 2017, 15:15

Re: Kodi 401 for URL

Post by foodninja06 »

So a quick update,

I've found out that with no username and password it works fine.

Code: Select all

Notify Kodi: [host:192.168.0.000, port:8080]
POST: http://192.168.0.000:8080/jsonrpc {"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"FileBot finished processing 1 files","message":"The.Big.Bang.Theory.S11E02.HDTV.x264-LOL[eztv].mkv","image":"https://app.filebot.net/icon.png"},"id":1}
POST: http://192.168.0.000:8080/jsonrpc {"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}
Done ヾ(@⌒ー⌒@)ノ
My next check is to see if taking special character out of the password and see if that helps.
Post Reply