Dictionarry-Hub / profilarr

Import, Export & Sync Profiles & Custom Formats via Radarr / Sonarr API.
MIT License
211 stars 13 forks source link

TypeError: 'NoneType' object is not iterable #39

Closed eherranzr closed 6 months ago

eherranzr commented 7 months ago

Hi,

When running the script and after selecting the instance, I get the following error output:

PS C:\Users\emili\Downloads\Profilarr-0.3.2.1> python importarr.py
Select your app of choice
1. radarr
2. sonarr
Enter your choice:
1
Select your Radarr instance
1. Radarr (Master)
2. Radarr (4k-radarr)
Choose an instance by number, multiple numbers separated by commas or type 'all' for all instances:
1

Failed to decode JSON response.
Traceback (most recent call last):
  File "C:\Users\emili\Downloads\Profilarr-0.3.2.1\importarr.py", line 211, in <module>
    main()
  File "C:\Users\emili\Downloads\Profilarr-0.3.2.1\importarr.py", line 207, in main
    import_custom_formats(app, instances)
  File "C:\Users\emili\Downloads\Profilarr-0.3.2.1\importarr.py", line 47, in import_custom_formats
    existing_names_to_id = {format['name']: format['id'] for format in existing_formats}
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

The same happens with other scripts:

PS C:\Users\emili\Downloads\Profilarr-0.3.2.1> python .\exportarr.py
Select your app of choice
1. radarr
2. sonarr
Enter your choice:
1
Select your Radarr instance
1. Radarr (Master)
2. Radarr (4k-radarr)
Choose an instance by number, multiple numbers separated by commas or type 'all' for all instances:
1

Exporting Custom Formats for Radarr : Master
Failed to decode JSON response.
Traceback (most recent call last):
  File "C:\Users\emili\Downloads\Profilarr-0.3.2.1\exportarr.py", line 134, in <module>
    main()
  File "C:\Users\emili\Downloads\Profilarr-0.3.2.1\exportarr.py", line 130, in main
    export_custom_formats(app, instances, config)
  File "C:\Users\emili\Downloads\Profilarr-0.3.2.1\exportarr.py", line 53, in export_custom_formats
    for custom_format in response:
TypeError: 'NoneType' object is not iterable

I'm running Package Version 4.5.2.7388-ls173 by linuxserver.io from docker-compose Trying to run the script from a Windows 10 installation (not the same device where Radarr and Sonarr are installed)

santiagosayshey commented 7 months ago

Hi, would you mind sharing your config file (with api keys omitted ofc).

I suspect that this might have to do with the base_url being used.

eherranzr commented 7 months ago

Hi, this is my config file with api key redacted

instances:
  radarr:
    - name: "Master"
      base_url: "http://192.168.1.222:7878"
      api_key: "API_KEY" #REDACTED
    - name: "4k-radarr"
      base_url: "http://localhost:7887"
      api_key: "API_KEY"
  sonarr:
    - name: "Master"
      base_url: "http://localhost:8989"
      api_key: "API_KEY"
    - name: "4k-sonarr"
      base_url: "http://localhost:8998"
      api_key: "API_KEY"
settings:
  export_path: "./exports"
  import_path: "./imports"
  ansi_colors: true

Just using the first radarr instance

RobinWest commented 7 months ago

Hey, just a heads up I had the same issue. I found this was because I was using Sonarr v3, which I don't think has a /customformat endpoint (or Custom Formats in general). I upgraded to v4, and everything worked fine for me.

Might be worth updating the docs with a minimum version number for Sonarr/Radarr?

santiagosayshey commented 7 months ago

@eherranzr Sorry for taking so long to reply to this, been quite busy the past few weeks.

Could you try @RobinWest's suggestion above?

eherranzr commented 6 months ago

Apologies for not replying before. I'm running version 4.5.2.7388 for Radarr and it's working now. Nonetheless, for Sonarr I'm unable as it's version 3.0.9 due to arm32 deprecation in docker.