clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
672 stars 176 forks source link

We were unable to find a processor for category None that was enabled #313

Closed Tjiet closed 10 years ago

Tjiet commented 10 years ago

When postprocessing downloaded movie in the "movies" category it fails with error: We were unable to find a processor for category None that was enabled, please check your autoProcessMedia.cfg file.

The category is defined in the couchpotato section.

Any ideas as to why it fails ?

SABNZBD version is 0.7.17

SABNZBD Entry with correct category:

Name MOVIE Size 722 MB Status Completed Category movies Path /Users/USER/Downloads/_Temp/Movie/MOVIE Download Downloaded in 1 minute 14 seconds at an average of 9.7 MB/s Source MOVIE.nzb Unpack [MOVIE] Unpacked 6 files/folders in 3 seconds Repair [MOVIE] Quick Check OK Script 17:05:59|INFO MAIN: A problem was reported in the autoProcessMovie script. (More)

Postprocessing log:

       17:04:47|INFO    ====================

17:04:47|INFO nzbToCouchPotato V9.3 17:04:47|INFO MAIN: Loading config from /Users/USER/Documents/Sabnzbd/Scripts/autoProcessMedia.cfg 17:04:47|INFO MAIN: Script triggered from SABnzbd, starting autoProcessMovie... 17:04:47|ERROR MAIN: We were unable to find a processor for category None that was enabled, please check your autoProcessMedia.cfg file. 17:04:47|INFO MAIN: A problem was reported in the autoProcessMovie script.

autoProcessMedia.cfg:

[CouchPotato]

autoProcessing for Movies

#### movie - category that gets called for post-processing with CPS
[[movie]]
    enabled = 0
    apikey = ""
    host = localhost
    port = 5050
    ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
    ssl = 0
    web_root = ""
    delay = 65
    TimePerGiB = 60
    method = renamer
    delete_failed = 0
    wait_for = 2
    #### Set to 1 if CouchPotatoServer is running on a different server to your NZB client
    remoteCPS = 0
    watch_dir = ""
[[movies]]
    enabled = 1
    apikey = REMOVED
    host = mediserver
    port = 8083
    ssl = 0
    web_root = ""
    delay = 65
    TimePerGiB = 60
    method = renamer
    delete_failed = 0
    wait_for = 2
    remoteCPS = 1
    watch_dir = ""
echel0n commented 10 years ago

You need to set enabled to 1 for whatever subsections you want to allow processing for. Please update your release as I just put a new one out that fixes a few bugs

Tjiet commented 10 years ago

Updated to latest DEV, But still same problem.

Category is enabled [[movies]] enabled = 1

echel0n commented 10 years ago

is your sabnzbd passing in a category ?

echel0n commented 10 years ago

actually just noticed you have 2 categories under couchpotato ... one being movie and other being movies ... which one are you sending to nzbToCouchPotato from SAB ?

echel0n commented 10 years ago

Wait found the problem, correcting 1 sec

Tjiet commented 10 years ago

was just typing the debug log :-)

echel0n commented 10 years ago

Please post the debug log, I thought I found the issue but it looks to be working fine.

echel0n commented 10 years ago

There's the problem right there /Users/fspruijt/Downloads/_Temp/Movie

You enabled [[movies]] but you didn't enable [[movie]] and nzbtomedia is thinking you want category [[movie]] cause of the path

fix that and it should be good to go

Tjiet commented 10 years ago

but that is only a temp dir ? is that used as category ?

Tjiet commented 10 years ago

let me paste the movies section in the movie section in the cfg and test it....

echel0n commented 10 years ago

sounds good to me :)

Tjiet commented 10 years ago

Running external script /Users/USER/Documents/Sabnzbd/Scripts/nzbToCouchPotato.py(/Users/USER/Downloads/_Temp/Movie/Mannenharten (2013) MP4.4, Mannenharten (2013) MP4.nzb, Mannenharten (2013) MP4, , movies, alt.binaries.boneless, 0, )

The argument "movies" is the category isn't it ?

echel0n commented 10 years ago

yes it is but it also checks directory structure and matches that back to categories in the cfg

Tjiet commented 10 years ago

Nope still not working:

19:18:56|ERROR MAIN: We were unable to find a processor for category None that was enabled, please check your autoProcessMedia.cfg file. 19:18:56|INFO MAIN: A problem was reported in the autoProcessMovie script.

Where does it get the category from ? the download category in sabnzbd is set to movies

echel0n commented 10 years ago

ok let me check some more into this, give me a few

Tjiet commented 10 years ago

i'll do a new test with a other category in sabnzb, set to movie

echel0n commented 10 years ago

Found the problem! Its never been passing the category since day 1 from what I see for nzbToCouchPotato. I'm sure that was a oversight so I'll correct it and update the dev branch

echel0n commented 10 years ago

OK new dev releases is out, please update and try

Tjiet commented 10 years ago

running test now

echel0n commented 10 years ago

Found a few places where the category wasnt being passed in so good catch on this cause it would have been widespread issue had not been fixed soon.

Tjiet commented 10 years ago

no probs, just glad you found it

Tjiet commented 10 years ago

the postprosessing took a long time to finish:

19:46:29|ERROR Unable to open URL
Traceback (most recent call last):
File "/Users/USER/Documents/Sabnzbd/Scripts/nzbtomedia/autoProcess/autoProcessMovie.py", line 260, in process
r = requests.get(url)
File "/Users/USER/Documents/Sabnzbd/Scripts/lib/requests/api.py", line 55, in get
return request('get', url, kwargs)
File "/Users/USER/Documents/Sabnzbd/Scripts/lib/requests/api.py", line 44, in request
return session.request(method=method, url=url, kwargs)
File "/Users/USER/Documents/Sabnzbd/Scripts/lib/requests/sessions.py", line 393, in request
resp = self.send(prep, _send_kwargs)
File "/Users/USER/Documents/Sabnzbd/Scripts/lib/requests/sessions.py", line 496, in send
r = adapter.send(request, _kwargs)
File "/Users/USER/Documents/Sabnzbd/Scripts/lib/requests/adapters.py", line 376, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='mediserver', port=8083): Max retries exceeded with url: /api/APIKEY/renamer.scan/?downloader=sabnzbd&download_id= (Caused by : [Errno 8] nodename nor servname provided, or not known)
19:46:29|INFO MAIN: A problem was reported in the autoProcessMovie script.

echel0n commented 10 years ago

check your cfg settings, sounds like hostname issue

Tjiet commented 10 years ago

the source dir in couch potato was still _Temp/Movie, changed to _Temp/Movies and it seems to work now

echel0n commented 10 years ago

:) good to go

Tjiet commented 10 years ago

Seems to work now :-)

20:00:15|INFO CouchPotatoServer returned {u'success': True} 20:00:15|INFO renamer scan started on CouchPotatoServer for Cherry 2000 (1987).nzb 20:00:15|INFO MAIN: A problem was reported in the autoProcessMovie script.

Except the last lines tells something else

Tjiet commented 10 years ago

2014-04-07 20:00:20,846::INFO::[newsunpack:147] Running external script /Users/USER/Documents/Sabnzbd/Scripts/nzbToCouchPotato.py(/Users/USER/Downloads/_Temp/Movies/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a, Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.nzb, Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a, , movies, alt.binaries.boneless, 0, ) 2014-04-07 20:00:55,460::DEBUG::[interface:421] API-call from 10.10.10.12 [CouchPotato linux - git-685210ae - v2] {'output': 'json', 'apikey': '_API_', 'mode': 'queue'} 2014-04-07 20:00:55,470::DEBUG::[interface:421] API-call from 10.10.10.12 [CouchPotato linux - git-685210ae - v2] {'output': 'json', 'apikey': '_API_', 'limit': '15', 'mode': 'history'} 2014-04-07 20:01:26,685::INFO::[postproc:537] Cleaning up Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a (keep_basic=False) 2014-04-07 20:01:26,686::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_tSgroB removed 2014-04-07 20:01:26,686::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_4qaAsJ removed 2014-04-07 20:01:26,686::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_wiJRqB removed 2014-04-07 20:01:26,686::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_yJ3GQA removed 2014-04-07 20:01:26,686::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_kkoM7F removed 2014-04-07 20:01:26,687::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_NBtTsp removed 2014-04-07 20:01:26,687::INFO::[init:906] /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a/ADMIN/SABnzbd_nzf_vIoStd removed 2014-04-07 20:01:26,688::INFO::[postproc:85] Saving postproc queue 2014-04-07 20:01:26,688::INFO::[init:917] Saving data for postproc1.sab in /Users/USER/Library/Application Support/SABnzbd/admin/postproc1.sab 2014-04-07 20:01:26,689::INFO::[downloader:246] Post-processing finished, resuming download 2014-04-07 20:01:27,691::INFO::[nzbqueue:211] Saving queue 2014-04-07 20:01:27,691::DEBUG::[init:842] Saving data for SABnzbd_nzo_QfO5My in /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.1/ADMIN 2014-04-07 20:01:27,695::DEBUG::[init:842] Saving data for SABnzbd_nzo_QfO5My in /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.1/ADMIN 2014-04-07 20:01:27,698::DEBUG::[init:842] Saving data for SABnzbd_nzo_5CYoKY in /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.2/ADMIN 2014-04-07 20:01:27,701::DEBUG::[init:842] Saving data for SABnzbd_nzo_5CYoKY in /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.2/ADMIN 2014-04-07 20:01:27,703::DEBUG::[init:842] Saving data for SABnzbd_nzo_1V3WWC in /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.3/ADMIN 2014-04-07 20:01:27,706::DEBUG::[init:842] Saving data for SABnzbd_nzo_1V3WWC in /Users/USER/Downloads/_Temp/Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.3/ADMIN 2014-04-07 20:01:27,708::INFO::[init:917] Saving data for queue9.sab in /Users/USER/Library/Application Support/SABnzbd/admin/queue9.sab 2014-04-07 20:01:27,709::INFO::[init:917] Saving data for totals9.sab in /Users/USER/Library/Application Support/SABnzbd/admin/totals9.sab 2014-04-07 20:01:27,709::INFO::[init:917] Saving data for rss_data.sab in /Users/USER/Library/Application Support/SABnzbd/admin/rss_data.sab 2014-04-07 20:01:27,714::INFO::[init:917] Saving data for bookmarks.sab in /Users/USER/Library/Application Support/SABnzbd/admin/bookmarks.sab 2014-04-07 20:01:27,714::INFO::[init:917] Saving data for watched_data.sab in /Users/USER/Library/Application Support/SABnzbd/admin/watched_data.sab 2014-04-07 20:01:27,715::INFO::[postproc:85] Saving postproc queue 2014-04-07 20:01:27,715::INFO::[init:917] Saving data for postproc1.sab in /Users/USER/Library/Application Support/SABnzbd/admin/postproc1.sab 2014-04-07 20:01:27,715::INFO::[postproc:667] Queue has finished, launching: None (None)

echel0n commented 10 years ago

Fixing the status return 1 sec

Tjiet commented 10 years ago

:+1:

echel0n commented 10 years ago

Ok fixed and released, it was returning a bad status incase it was a torrent client download so I added in a check for that so it returns a good status

Tjiet commented 10 years ago

All working now !!!

20:18:47|INFO Waiting for 65.0 seconds to allow CPS to process newly extracted files 20:19:52|INFO CouchPotatoServer returned {u'success': True} 20:19:52|INFO renamer scan started on CouchPotatoServer for Ghost Ship (2002) aanrader 720P NL SUBS k-a-r-m-a.nzb 20:19:52|INFO MAIN: The autoProcessMovie script completed successfully.

Tjiet commented 10 years ago

thx for you're precious time :-)

Tjiet commented 10 years ago

is there a way to config an use for all categories in the CFG ?

i have more categories in sabnzbd, but the end result for nzbtomedia should be the same for me. example: sabnzbd category: movies, anime, docu, etc nzbtomedia cfg: [[movies]] [[anime]] [[docu]]

Now it needs 3 category sections in which the same info is configured...

On the wiki page it is not mentioned, mabye a new feature request ?

clinton-hall commented 10 years ago

Yes, you should be able to add all of these categories. But currently [[movies]] [[anime]] and [[docu]]would all be under [CouchPotato] if these are all "movies".

I used to allow multiple categories, but with the changes to the config style this worked better for multiple versions of SickBeard and Couchpotato etc...

So I guess the question is Why are you using multiple categories for CouchPotato? Are these manual downloads? I thought CouchPotato only sent 1 category when it snatched the torrent/nzb.

If you are using some RSS feed, is it possible to actually define aliases for the categories (this is possible in nzbget, but haven't looked specifically in SAB). Or again is there a specific reason to use different categories for downlaods that will be handled the same by CouchPotato anyway?

@echel0n Would it be possible to define "aliases" for the single category?... I think where this might get complicated is you now need to test if category is a sub-section, or if the category is defined as an alias for that sub-section... or have a "global" (category/alias) section in the config, that first parses the input category against the specific aliases and then returns the specific category that is defined...

[Aliases]
movies = movies,anime,docu

inputCategory = [key for key,value in config().get_items("Aliases") if inputCategory in value][0]

This probably isn't the correct method for returning the key,value tuples from the config... but hopefully makes sense.

echel0n commented 10 years ago

This sounds to me simply something for labeling sake as I don't see how these aliases could be used for anything else since couch and sick both can only handle one category currently.

Now there are a few ways to do this but here's one for example:

` [[movie]] this is our Parent category

[[anime]] alias = movie

[[docu]] alias = movie `

or

[[movie]] aliases = movies, anime, etc

clinton-hall commented 10 years ago

Agreed... I believe this is happening when using RSS in SABnzbd or otherwise manually downloading and setting these different categories.

Originally the intention of allowing multiple categories, was to support multiple instances of SickBeard, and not all going to the same instance.

Tjiet commented 10 years ago

I use SpotWeb, that gives the categories with the manual download, anime, tv, movies, book

Perhaps a [[default]] category is a better solution ? if a category is defined in the cfg it will be used, else it wil use the [[default]].

clinton-hall commented 10 years ago

so are you having nzbToMedia called as the default (i.e for all categories) or are you specifying which categories call the script?

Really, if you have multiple categories to be processed by CouchPotato, list these all under the [CouhcPotato] section. If you have multiple categories to be processed by [SickBeard], list them all under the SickBeard section.

If one of the alias methods suggested above are implemented, this should help keep the .cfg a bit cleaner, but for now, doing it this way should work.

Tjiet commented 10 years ago

different categories in sabnzbd call nzbToCouchpotato or nzbToSickbeard Couch and Sickbeard arre not configured to use multiple categories.

The manual download from spotweb sends a category with it. But you would still like to have it processed as a movie or serie

thats why i think a default cat should fix it...

clinton-hall commented 10 years ago

Yeah, so the issue here is in NZBGet and SABnzbd (or any where we call nzbToCouichPotato, or nzbToSickBeard) we have already decided what we want to do with that download... So testing the category is really only to decide if we are sending to a specific instance of Couchpotato / Sickbeard etc.

For TorrentToMedia and nzbToMedia, these checks are very important, but for the sperate nzbToSickBeard and nzbToCouchPotato scripts we probably need to just default to the main category?... Otheriwse use the aliases... I like the following idea.

[[movie]]
    aliases = movies, anime, etc

[[series]]
    aliases = tv, cartoons, etc
Tjiet commented 10 years ago

Like that as well :-) Makes my life easier...

echel0n commented 10 years ago

Ok well its 1:20am here so gonna get some sleep and once I have a coffee I'll take a look at adding this as a feature.

Tjiet commented 10 years ago

thx for the time :-) enjoy the sleep