nzblnk / nzb-monkey

Reference implementation of how to handle a NZBLNK-URI.
https://nzblnk.github.io/nzb-monkey/
MIT License
77 stars 30 forks source link

categorize = manual gives KeyError with SABnzbd v3.7.0 #40

Closed jelehmann closed 1 year ago

jelehmann commented 1 year ago

NZB_monkey crashes (about here) with KeyError: 'categories' unable to retrieve the categories-list from SABnzbd v3.7.0:

Debug output with categorize = manual in nzbmonkey.cfg:

 ==========================================
 Debug output enabled for NZB-Monkey v0.2.7
 ==========================================

 Started: 2022-11-06 13:26:01 (1667737561)
 Command line arguments passed to NZB-Monkey
 -------------------------------------------
 Arg[0]: C:\Users\hidden\AppData\Local\Programs\nzbmonkey-v0.2.2-win\nzbmonkey.exe
 Arg[1]: nzblnk:?t=hidden&h=hidden&p=hidden
 -------------------------------------------

 Called by NZBLNK scheme:

     - Tag     : hidden
     - Header  : hidden
     - Password: hidden

 - Searching NZB - Search for best NZB enabled
   with NZBIndex ... DONE
   - Check NZB (Max. 5 missing files - Max. 5.0% missing Segments)
     Update counter ... 
     Check file count ... OK - 37 from 37 files
     Check segments ...
       Total Segments:        10880
       Expected Segments:     10880
       Missing Segments:          0
       Additional Segments:       0
       OK - 10880 from 10880 segments

     Overall result: OK - All 37 files are complete

   use NZB from NZBIndex
     Upload age:      4 days
     Upload started:  2022-11-02
     Upload duration: 00:01:18
Traceback (most recent call last):
  File "C:\dev\python\nzb-monkey-github\src\nzbmonkey.py", line 1751, in <module>
  File "C:\dev\python\nzb-monkey-github\src\nzbmonkey.py", line 1559, in main
KeyError: 'categories'

Debug output with categorize = off or categorize = auto in nzbmonkey.cfg:

 ==========================================
 Debug output enabled for NZB-Monkey v0.2.7
 ==========================================

 Started: 2022-11-06 13:20:29 (1667737229)
 Command line arguments passed to NZB-Monkey
 -------------------------------------------
 Arg[0]: C:\Users\hidden\AppData\Local\Programs\nzbmonkey-v0.2.2-win\nzbmonkey.exe
 Arg[1]: nzblnk:?t=hidden&h=hidden&p=hidden
 -------------------------------------------

 Called by NZBLNK scheme:

     - Tag     : hidden
     - Header  : hidden
     - Password: hidden

 - Searching NZB - Search for best NZB enabled
   with NZBIndex ... DONE
   - Check NZB (Max. 5 missing files - Max. 5.0% missing Segments)
     Update counter ... 
     Check file count ... OK - 37 from 37 files
     Check segments ...
       Total Segments:        10880
       Expected Segments:     10880
       Missing Segments:          0
       Additional Segments:       0
       OK - 10880 from 10880 segments

     Overall result: OK - All 37 files are complete

   use NZB from NZBIndex
     Upload age:      4 days
     Upload started:  2022-11-02
     Upload duration: 00:01:18
 - Pushing to SABNZBD ...OK
 - Saving NZB-file ... OK
 - Done
Close window in 1 second(s)

...or is this a SABnzbd issue?

mj-crawl commented 1 year ago

Works with Sabnzbd 3.6.1, stopped working with Sabnzbd 3.7.0

Tensai75 commented 1 year ago

Sabnzbd API was updated from v3.6.1 to v3.7.0 (see Release Notes - SABnzbd 3.7.0):

  • Removed fields scripts and categories from queue API call.

https://github.com/nzblnk/nzb-monkey/blob/5ab31559c4dc5f74d188924960c19965c80e7200/src/nzbmonkey.py#L1545

Instead, API call get_cats should be used, which only returns the categories key, see Sabnzbd API documentation