Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run unless Trakt client_id and client_secret are available #18

Open
moe93 opened this issue Nov 29, 2024 · 2 comments
Open

Can't run unless Trakt client_id and client_secret are available #18

moe93 opened this issue Nov 29, 2024 · 2 comments

Comments

@moe93
Copy link

moe93 commented Nov 29, 2024

I keep getting the following Traceback whenever I try to launch the plex_debrid main.py file:

File "/home/dietpi/gits/plex_debrid_elfhosted/content/services/trakt.py", line 18, in <module>
    trakt = Settings()
            ^^^^^^^^^^
  File "/home/dietpi/.local/lib/python3.11/site-packages/pydantic_settings/main.py", line 167, in __init__
    super().__init__(
  File "/home/dietpi/.local/lib/python3.11/site-packages/pydantic/main.py", line 214, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 2 validation errors for Settings
client_id
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.10/v/missing
client_secret
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.10/v/missing

I don't care for Trakt and was hoping to be able to run the script without having to setup Trakt.

@esquioga
Copy link

It's missing defaults values on the class, you can change Settings on trakt.py to this

class Settings(BaseSettings):
    client_id: str = ""
    client_secret: str = ""

    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"

The original code seems to have an actual value there, probably not needed if you're not using the service, but you can find it here

@moe93
Copy link
Author

moe93 commented Nov 29, 2024

@esquioga Thank you. I do have some bogus values in a .env file to get the script up and running.

Just thought it was an oversight that those values needed to be there even when Trakt isn't being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants