ghomasHudson / Jellyfin-Auto-Collections

Automatically make jellyfin collections from IMDB, Letterboxd lists and more.
MIT License
60 stars 9 forks source link

Windows config error #32

Closed HellBoyJr closed 1 month ago

HellBoyJr commented 1 month ago

Hi, I'm a Windows user. It's giving this error:

C:\Users\Administrador\Desktop>echo 09/06/2024 às 15:48:24,27 1>>"C:\Users\Administrador\Desktop\Agendados\JAC.txt" Traceback (most recent call last): File "C:\Users\Administrador\Desktop\Jellyfin-Auto-Collections-master\main.py", line 11, in config = parse_config('config.yaml', default_value=None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\pyaml_env\parse_config.py", line 110, in parse_config return yaml.load(conf_data, Loader=loader) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml__init__.py", line 81, in load return loader.get_single_data() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\constructor.py", line 49, in get_single_data node = self.get_single_node() ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\composer.py", line 36, in get_single_node document = self.compose_document() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\composer.py", line 55, in compose_document node = self.compose_node(None, None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\composer.py", line 133, in compose_mapping_node item_value = self.compose_node(node, item_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\composer.py", line 84, in compose_node node = self.compose_mapping_node(anchor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\composer.py", line 127, in compose_mapping_node while not self.check_event(MappingEndEvent): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\parser.py", line 98, in check_event self.current_event = self.state() ^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\parser.py", line 428, in parse_block_mapping_key if self.check_token(KeyToken): ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\scanner.py", line 116, in check_token self.fetch_more_tokens() File "C:\Python\Lib\site-packages\yaml\scanner.py", line 223, in fetch_more_tokens return self.fetch_value() ^^^^^^^^^^^^^^^^^^ File "C:\Python\Lib\site-packages\yaml\scanner.py", line 577, in fetch_value raise ScannerError(None, None, yaml.scanner.ScannerError: mapping values are not allowed here in "config.yaml", line 9, column 41

I'm using this script via .bat:

cd "C:\Users\Administrador\Desktop\Jellyfin-Auto-Collections-master" C:\Python\python.exe "C:\Users\Administrador\Desktop\Jellyfin-Auto-Collections-master\main.py" -r

Any suggestions on how it works? Thanks in advance.

mzrimsek commented 1 month ago

Seems like your config YAML might be malformed.

HellBoyJr commented 1 month ago

Config yaml:

jellyfin:

server_url: !ENV ${JELLYFIN_SERVER_URL: http://localhost:8096} api_key: !ENV ${JELLYFIN_API_KEY: c38ea04f0f914c488a*} # Create an API key by going to: Admin>Dashboard>Advanced>API Keys user_id: !ENV ${JELLYFIN_USER_ID: 3406f49c344c4***}

ghomasHudson commented 1 month ago

Config yaml:

jellyfin:

server_url: !ENV ${JELLYFIN_SERVER_URL: http://localhost:8096} api_key: !ENV ${JELLYFIN_API_KEY: c38ea04f0f914c488a*} # Create an API key by going to: Admin>Dashboard>Advanced>API Keys user_id: !ENV ${JELLYFIN_USER_ID: 3406f49c344c4***}

Hard to tell but looks like there's an extra closing } on some of those lines.

HellBoyJr commented 1 month ago

It seems normal https://paste.ofcode.org/9MmFxaWRJiZPPx7dMs8MjT

ghomasHudson commented 1 month ago

It seems normal https://paste.ofcode.org/9MmFxaWRJiZPPx7dMs8MjT

Figured it out: You need to remove the spaces after the colons: e.g.

server_url: !ENV ${JELLYFIN_SERVER_URL:http://localhost:8096}
api_key: !ENV ${JELLYFIN_API_KEY:c38ea04f0f914c488a*****************} # Create an API key by going to: Admin>Dashboard>Advanced>API Keys
user_id: !ENV ${JELLYFIN_USER_ID:3406f49c344c4***********************}

My bad - I've updated the config example to reflect this.

HellBoyJr commented 1 month ago

Worked perfectly. Thanks again.

ghomasHudson commented 1 month ago

No problem - Thanks for raising the issue.