jonjonsson / Emby-MDBList-Collection-Creator

A Python script can take MDBList.com lists and create collections from them in Emby. MDBList stores Trakt and IMDB lists (and more) that can be accessed via API.
18 stars 1 forks source link

Error occurred while getting system info, check your configuration: Expecting value: line 1 column 1 (char 0) #3

Closed iamwoz closed 1 month ago

iamwoz commented 3 months ago

Well, this is weird.

Please let me know what info I can provide that might help with diagnosing this.

config.cfg

[admin]
# Emby server URL
emby_server_url = https://emby.xxxxx.nz

# User ID of an Emby admin user.  
# To find this ID, navigate to "Manage Emby Server" > "Users", 
# click on an admin user, and grab the userID from the URL
emby_user_id = 8a6afd9bebbc442786e860b979fa7d1d 

# Emby API key. 
# To find this key, go to "Manage Emby Server" > "Advanced" > "API Keys"
# and click on "New API Key"
emby_api_key = a2a55301ff6f94f59b8212943ca737c90

# MDBList API key. 
# Create an account on https://mdblist.com/, scroll to the bottom of 
# https://mdblist.com/preferences/ to "API Access", and generate an API key
mdblist_api_key = fos1zk7rzid9a6kaixnjxuaj2 

# Set to True to enable downloading of lists added manually
download_manually_added_lists = True

# Set to True to enable automatic downloading of your lists from https://mdblist.com/mylists/
download_my_mdblist_lists_automatically = True

# Change Sort Name of Collections so that those that get modified are at the top
update_collection_sort_name = True

# Set the frequency of script execution (in hours). Set to 0 to disable repetition
hours_between_refresh = 6

# Experimental! Set to True to update the sort names of TV Shows and Movies so that
# they are sorted by time added to Emby. This is useful if you want to see the latest
# added items first in the collection. You can change this value below for collections
# individually. This value will also affect "My Lists" on MDBList.com. See Readme.
update_items_sort_names_default_value = True 

# Set to True to refresh items that are in collections. Helps to keep the ratings of 
# new movies and shows up to date until the rating settles a bit on IMDB etc. 
# Also specify the maximum number of days since the item was added to Emby and since 
# it premiered. Both max_days_since_added and max_days_since_premiered must be satisfied 
# for an item to be refreshed. This is to prevent refreshing items that were added a 
# short time ago but premiered a long time ago since those items will have 
# accurate ratings already.
refresh_items_in_collections = True
refresh_items_in_collections_max_days_since_added = 10
refresh_items_in_collections_max_days_since_premiered = 30

#############################################################################
########################## ADD YOUR MDBLists BELOW ##########################
#############################################################################
# You can find public lists at https://mdblist.com/toplists/ 
# You can either specify the URL to the list or the ID of the list.
# Below are 2 examples of how to add lists using both methods. It's recommended
# to use the URL method as it works with all types of lists on Mdblist.

# Note: These are random users' lists that might disappear at any time. 
# To ensure longevity, clone lists you like to you own My Lists.

# Use the 2 examples below to add your own lists. The title of the Emby Collection
# will be the string within the brackets. Refer to README.md for more information.

# The Frequency parameter is optional. If Frequency is 100 it will be downloaded
# 100% of the time. If it's 50% it will be randomly updated 50% of the time etc.

# Recommended method using an Mdblist URL
[Trending TV Shows]
Source = https://mdblist.com/lists/teddysmoot/trending-new-shows
Frequency = 100
update_items_sort_names = False

# Example using list Mdblist ID
# To find the ID of a list, search for "?list=" in the HTML source. 
[Trending Movies]
Id = 4887
# Source will be ignored if Id is used
Source = https://mdblist.com/lists/xinefq/trending-movie
Frequency = 100
update_items_sort_names = False

Python versions

wsh@woz-bluefin ~> python -c "import sys; print('\n'.join(sys.path))"
/usr/lib64/python312.zip
/usr/lib64/python3.12
/usr/lib64/python3.12/lib-dynload
/var/home/wsh/.local/lib/python3.12/site-packages
/usr/lib64/python3.12/site-packages
/usr/lib/python3.12/site-packages

Pip modules

annotated-types==0.7.0
argcomplete==3.3.0
boto3==1.34.146
botocore==1.34.146
Brlapi==0.8.5
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
cockpit @ file:///builddir/build/BUILD/cockpit-321/tmp/wheel/cockpit-321-py3-none-any.whl#sha256=d7a8ce7698b5e353021d115351360922e98161c11b61d27bd1847eef4f572065
cryptography==41.0.7
cupshelpers==1.0
dasbus==1.7
dbus-python==1.3.2
distro==1.9.0
dnspython==2.6.1
email_validator==2.2.0
evdev==1.6.1
fedora-third-party==0.10
file-magic==0.4.0
fros==1.1
hid-parser==0.0.3
idna==3.7
input-remapper==2.0.1
Jinja2==3.1.4
jmespath==1.0.1
kcli==99.0
langtable==0.0.67
libvirt-python==10.1.0
louis==3.28.0
lxml==5.1.0
MarkupSafe==2.1.3
nautilus-open-any-terminal==0.0.0
nftables==0.1
olefile==0.47
packaging==23.2
pexpect==4.9.0
pillow==10.3.0
ply==3.11
podman-compose==1.2.0
prettytable==3.10.0
psutil==5.9.8
ptyprocess==0.7.0
pycairo==1.25.1
pycparser==2.20
pycups==2.0.4
pydantic==2.8.2
pydantic_core==2.20.1
pydbus==0.6.0
pyenchant==3.2.2
PyGObject==3.48.2
PySocks==1.7.1
python-dateutil==2.8.2
python-dotenv==1.0.1
python-pam==2.0.2
python-xlib==0.33
pyudev==0.24.1
pyxdg==0.27
PyYAML==6.0.1
regex==2024.4.16
requests==2.31.0
rpm==4.19.1.1
s3transfer==0.10.2
selinux @ file:///builddir/build/BUILD/libselinux-3.6/src
sepolicy @ file:///builddir/build/BUILD/selinux-3.6/python/sepolicy
setools==4.5.1
setroubleshoot @ file:///builddir/build/BUILD/setroubleshoot-3.3.33/src
setuptools==69.0.3
simpleaudio==1.0.4
six==1.16.0
solaar==1.1.13
sos==4.7.2
systemd-python==235
topgrade==14.0.1
typing_extensions==4.12.2
ublue_update==1.0.0
udica==0.2.8
urllib3==1.26.19
wcwidth==0.2.13

ERROR

wsh@woz-bluefin ~> cd apps/Emby-MDBList-Collection-Creator/
wsh@woz-bluefin ~/a/Emby-MDBList-Collection-Creator (main)> python app.py
Error occurred while getting system info, check your configuration: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/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)

> During handling of the above exception, another exception occurred:

> Traceback (most recent call last):
  File "/var/home/wsh/apps/Emby-MDBList-Collection-Creator/app.py", line 321, in <module>
    main()
  File "/var/home/wsh/apps/Emby-MDBList-Collection-Creator/app.py", line 277, in main
    process_hardcoded_lists()
  File "/var/home/wsh/apps/Emby-MDBList-Collection-Creator/app.py", line 253, in process_hardcoded_lists
    process_list(mdblist_list)
  File "/var/home/wsh/apps/Emby-MDBList-Collection-Creator/app.py", line 103, in process_list
    collection_id = emby.get_collection_id(collection_name)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/wsh/apps/Emby-MDBList-Collection-Creator/emby.py", line 268, in get_collection_id
    all_collections = self.get_all_collections(False)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/home/wsh/apps/Emby-MDBList-Collection-Creator/emby.py", line 167, in get_all_collections
    items = response.json()
            ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
wsh@woz-bluefin ~/a/Emby-MDBList-Collection-Creator (main) [1]>
jonjonsson commented 2 months ago

Sorry mate, I completely missed this. Still having issues? Looks like you are probably missing port from the emby url. Something like https://emby.xxxxx.nz:8096

If still not working, here is a minimal example to test your connection to Emby.

` import requests

emby_server_url = "http://example.com:8096"

emby_api_key = "your_api_key"

response = requests.get( emby_server_url + "/emby/System/Info", headers={"X-Emby-Token": emby_api_key} )

print(response.json()) `