-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I ran git clone of the script on the machine running lidarr (and confirmed that curl localhost:8686 works and gets my lidarr page).
From the directory I ran: python3 add_albums_from_list.py 1001_albums_to_listen_to_before_you_die.csv (based on looking at the code it seems like you need to offer the csv file after the python call?
I get the below error.
Traceback (most recent call last): File "/mnt/appconfig/lidarr/scripts/lidarrtools/add_albums_from_list.py", line 156, in <module> artists = lookup_artist(album['artist']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/appconfig/lidarr/scripts/lidarrtools/add_albums_from_list.py", line 20, in lookup_artist with urllib.request.urlopen(req) as response: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 519, in open response = self._open(req, data) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(*args) ^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open return self.do_open(http.client.HTTPConnection, req) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/usr/lib/python3.11/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.11/http/client.py", line 1323, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.11/http/client.py", line 1259, in putheader if _is_illegal_header_value(values[i]): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType'
I determined the API key isn't being retrieved, so I implemented the suggestion at the top of the code of #2 (comment) .
That changes the error to:
root@docker:/mnt/appconfig/lidarr/scripts/lidarrtools# python3 add_albums_from_list.py 1001_albums_to_listen_to_before_you_die.csv
Retrieved API Key: <the correct one printed
Traceback (most recent call last):
File "/mnt/appconfig/lidarr/scripts/lidarrtools/add_albums_from_list.py", line 163, in
artists = lookup_artist(album['artist'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/appconfig/lidarr/scripts/lidarrtools/add_albums_from_list.py", line 30, in lookup_artist
return json.loads(text)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Thanks for any help :)