Page 1 of 1

[Scan-script] MetaCategory - set category from nzb-file meta-tag

Posted: 16 Aug 2017, 19:49
by hugbug
This scan-script reads category information from nzb-file (if it's present in meta-tag) and sets the category for nzb-file when adding to queue.

How to use: save the script into ScriptDir and select it in option "Extensions".

Re: [Scan-script] MetaCategory - set category from nzb-file meta-tag

Posted: 18 Aug 2017, 17:47
by hugbug
Renamed script to MetaCategory.

Re: [Scan-script] MetaCategory - set category from nzb-file meta-tag

Posted: 12 Jan 2019, 16:43
by Identifier
I know this is an old thread, but is there a way to make nzbget automatically run this script on .nzb files that are manually placed in the ${MainDir}/nzb directory? (Rather than from RSS feeds). Thanks.

Re: [Scan-script] MetaCategory - set category from nzb-file meta-tag

Posted: 12 Jan 2019, 17:56
by hugbug
What makes you think the script is somehow RSS related?

Re: [Scan-script] MetaCategory - set category from nzb-file meta-tag

Posted: 18 Jan 2019, 20:11
by Identifier
[Sorry for the late reply - I forgot to subscribe to this thread to get notifications]

Ahh, ok, you're right - I have it listed in the global Extensions script list and it does get run on NZBs that I drop in the nzbs folder. However, it seems to be run after NZBGet does its category matching, so it's not matching my categories with wildcards. For example, I have a "Movies" category with alias "Movies*" so it catches things like Movies > SD, Movies > HD, etc.

Normally, when I get NZBs from a RSS feed, the item initially shows up in the Downloads with category "Movies > SD" in the Category column (with the blue 'URL' icon next to the NZB name), but then the category changes to just "Movies" a couple seconds later (presumably after it downloads the NZB from the URL). And the rules in my "Movies" category get applied, such as putting it in my "Shared Movies" folder (since I have Category1.DestDir set to "/shares/Public/Shared Movies") and running videoSort and the other scripts in Category1.Extensions.

But for NZBs dropped in the nzbs folder, MetaCategory does run now and correctly assigns the category (for example "Movies > HD"), but the category just stays that way during the whole download & post processing and never switches to "Movies". The rules in my "Movies" category never get applied, and the resulting files end up in the "${MainDir}/completed/Movies _ HD" folder (since I have AppendCategoryDir set to Yes), and videoSort doesn't run etc.

Is there any way to make NZBGet do category wildcard matching after scan scripts have been run?

Re: [Scan-script] MetaCategory - set category from nzb-file meta-tag

Posted: 23 Jan 2019, 22:18
by hugbug
This is indeed a problem. Nzbget considers category set by a script as final one and doesn't map it. A correct solution would be to extend the script to perform necessary category mapping.

A quick fix for you would be to add a few simple if-commands at the end of the script to change category from "Movies -> HD" to "Movies". Can you try this yourself? Please post your version of the script if you have troubles making it work.