adamgot / python-plexlibrary

Create and maintain dynamic Plex libraries based on recipes.
BSD 3-Clause "New" or "Revised" License
204 stars 40 forks source link

0 New items / IDs error #99

Open timmehtimtims opened 3 years ago

timmehtimtims commented 3 years ago

I've just updated to the latest Plex server build: 1.21.0.3616

user@Ubuntu-1804-bionic-64-minimal:/opt/appdata/python-plexlibrary$ sudo python3 plexlibrary tv_cartoons 2020-11-24 12:35:00,719 INFO:Running the recipe 'tv_cartoons' 2020-11-24 12:35:00,719 INFO:Retrieving the trakt list: https://api.trakt.tv/users/kylesheila/lists/kids-cartoons/items/tv 2020-11-24 12:35:00,879 INFO:Trying to match with items from the 'TV Shows' library 2020-11-24 12:35:00,887 INFO:Creating symlinks for 0 matching items in the library... 2020-11-24 12:35:00,887 INFO:Created symlinks for 0 new items: 2020-11-24 12:35:00,888 INFO:Creating the 'TV - Kids Cartoons' library in Plex... 2020-11-24 12:35:00,893 WARNING:Library already exists in Plex. Scanning the library... 2020-11-24 12:35:00,896 INFO:Waiting for metadata to finish downloading... 2020-11-24 12:35:00,902 INFO:Retrieving a list of items from the 'TV - Kids Cartoons' library in Plex... 2020-11-24 12:35:00,905 INFO:Setting the sort titles for the 'TV - Kids Cartoons' library... 2020-11-24 12:35:00,905 INFO:Scanning the 'TV - Kids Cartoons' library... ^[[A^[[A2020-11-24 12:35:10,940 INFO:Number of items in the new library: 0 2020-11-24 12:35:10,940 INFO:Number of missing items: 0

If I run an existing recipe/library, then it is able to match with my 'TV Shows' library and remove/add new symlinks. If I run a new recipe it won't match and it creates 0 symlinks.

To try and work out what variables are causing the issue I copied a working recipe .yml file. I then changed:

  1. the trakt list (have tried with multiple lists)
  2. the list directory name (have also chmod -R 777 the directory)
  3. the library name.

I left everything else the same but it does not work.

timmehtimtims commented 3 years ago

Here is my YAML file. If anyone else can run this recipe then I know it's an issue with my install.

library_type: 'tv'

source_list_urls:
  - 'https://api.trakt.tv/users/kylesheila/lists/kids-cartoons/items/tv'
  - 'https://api.trakt.tv/users/rendom/lists/memory-lane-cartoons-80-s/items/tv/'
  - 'https://api.trakt.tv/users/leia18/lists/kids-cartoons/items/tv'
  - 'https://api.trakt.tv/users/ondrisel/lists/classic-cartoons/items/tv'
  - 'https://api.trakt.tv/users/fiala06/lists/saturday-morning-cartoons/items/tv/'

source_libraries:
  - name: 'TV Shows'
    folders:
      - '/mnt/unionfs/tv/'

new_library:
  name: 'TV - Kids Cartoons'
  folder: '/mnt/lists/cartoons/'
  sort: false
  sort_title:
    format: '{number}. {title}'
    visible: false
    absolute: false
  max_age: 0
  max_count: 2000
  remove_from_library: false

weighted_sorting:
  enabled: false
  better_release_date: false
  weights:
    index: 0.75
    vote: 0.10
    age: 0.15
    random: 0.0
    genre_bias:
      'Kids': 0.9
timmehtimtims commented 3 years ago

Now generating error:

2020-12-20 14:23:46,230 INFO:Running the recipe 'tv_kids_cartoons'
2020-12-20 14:23:46,231 INFO:Retrieving the trakt list: https://api.trakt.tv/users/leia18/lists/kids-cartoons/items/tv/
2020-12-20 14:23:46,387 INFO:Retrieving the trakt list: https://api.trakt.tv/users/kylesheila/lists/kids-cartoons/items/tv/
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "plexlibrary/__main__.py", line 8, in <module>
    main()
  File "plexlibrary/plexlibrary.py", line 67, in main
    r.run(sort_only=args.sort_only, share_playlist_to_all=args.everyone)
  File "plexlibrary/recipe.py", line 654, in run
    missing_items, list_count = self._run(share_playlist_to_all=share_playlist_to_all)
  File "plexlibrary/recipe.py", line 588, in _run
    item_list, item_ids = self._get_trakt_lists()
  File "plexlibrary/recipe.py", line 91, in _get_trakt_lists
    max_age or 0)
  File "plexlibrary/traktutils.py", line 155, in add_items
    show_ids=item_ids, max_age=max_age)
  File "plexlibrary/traktutils.py", line 125, in add_shows
    if m['show']['ids']['imdb'] in show_ids:
KeyError: 'ids'
chiggerz commented 3 years ago

did you ever get this working? im getting the same thing. created new legacy library so I know its not using the new agent, but saying that, is this now no longer working at all? or is it still working when using legacy agent?

timmehtimtims commented 3 years ago

Not working for me still unfortunately. I ended up going into sonarr, tagging those shows and then moving that list into a new directory and then created a new library from that dir...

chiggerz commented 3 years ago

Not working for me still unfortunately. I ended up going into sonarr, tagging those shows and then moving that list into a new directory and then created a new library from that dir...

Ive gone down the auto collections route now. same as this but collections rather than libraries. not ideal, and not what I really wanted, but its a work around and something to use until this is working again

morganzero commented 3 years ago

Not working for me still unfortunately. I ended up going into sonarr, tagging those shows and then moving that list into a new directory and then created a new library from that dir...

Ive gone down the auto collections route now. same as this but collections rather than libraries. not ideal, and not what I really wanted, but its a work around and something to use until this is working again

I can confirm that it is still working with Legacy as I never switched agents and the script is still working for me.