[Schd-Script] DirWatch - Multiple NZB-File Drop Support

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
zombiehoffa
Posts: 8
Joined: 22 Jan 2017, 16:09

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by zombiehoffa » 25 Jan 2017, 01:40

oh, it would be super great if I didn't have to keep the name the same ie /pathtomycustomcategorydir and then specify it goes in categoryx

zombiehoffa
Posts: 8
Joined: 22 Jan 2017, 16:09

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by zombiehoffa » 25 Jan 2017, 01:48

like it would be awesome if I could specify a dir and specify a category, not having to keep the last directory name the name of the category. That being said, I can make that work as well.

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by l2g » 29 Jan 2017, 20:40

Okay zombiehoffa,

I think I've got a working version; I didn't make a full release yet as i'd like your feedback first. Here is the link to download it.

With this new release everything looks the same, however now the paths you specify in the WatchDir can support category assignments. If you don't specify a category, then the tool works as it has in the past.

Now here is how categories work; consider the following WatchDir path:
/path/to/joes/downloads, /path/to/nzb-category/favoritemovies?c=movie, /path/to/nzb-category/shows?c=tv

Here is how the paths identified above would be processed:
  • /path/to/joes/downloads: NZB-Files (and Zipped NZB-Files) get moved to the core NZB File processing directory as normal (no change here).
  • /path/to/nzb-category/favoritemovies?c=movie: The NZB-Files found in this directory (/path/to/nzb-category/favoritemovies) will be assigned the category movie and loaded directly into NZBGet (regardless of the category detected in the NZB-File). The category assignment is much like a URL argument on a website. You simply just add ?c=<category> to add it.
  • /path/to/nzb-category/shows?c=tv: I think you get the point, but the only reason for this last entry is to show that you can identify more than one path (there is no limit to the number of paths) and to also point out that the category has to be in no way related to the directory name. In this example content found in /path/to/nzb-category/shows would be assigned the category tv.
Some other things worth noting:
  • I wanted to also handle ZipFiles. So if you have a ZipFile containing multiple NZB-Files (or just 1), this new enhancement will still support that. It will load every single ZipFile within a category assigned directory and load it into NZB-Get as such.
  • If you don't like specifying ?c= for the category, you can also use ?cat= and ?category=
If your category has a space in it. just substitute the space with %20. Thus a category 'HD MOVIE' would become c=HD%20MOVIE if you had to identify it.

I believe this will cover all of your requests! :)

Let me know how it goes!
Last edited by l2g on 01 Feb 2017, 23:49, edited 1 time in total.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by hugbug » 29 Jan 2017, 21:17

In a case you missed this post https://github.com/nzbget/nzbget/issues ... -268363155.
It's about easier config for scheduler scripts in v18.

zombiehoffa
Posts: 8
Joined: 22 Jan 2017, 16:09

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by zombiehoffa » 04 Feb 2017, 19:17

sorry, for whatever reason the forum doesn't email me when a new post shows up so I missed this. I will read the posts, try the link and give feed back as soon as I can.

zombiehoffa
Posts: 8
Joined: 22 Jan 2017, 16:09

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by zombiehoffa » 04 Feb 2017, 20:23

ok, I'm pretty sure I'm running into permission errors since I'm running this in docker on a synology nas but the debugging switch isn't working so I don't know have any information yet. will keep pounding on it until I have something.

zombiehoffa
Posts: 8
Joined: 22 Jan 2017, 16:09

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by zombiehoffa » 04 Feb 2017, 21:16

so as near as I can tell, it's messing up the permissions somehow, probably related to docker weirdness. If I copy the file over to my directory it is owned by 1024:abc, if I manually copy it into the nzbwatch dir via the synology web interface, it maintains that ownership and nzbget adds the nzb no problem. It won't give me any error information even if I turn the debugging on, so I don't know what it's doing inside nzbget. If I go into docker and run a cli on the nzbget container and run the script manually it changes the ownership to root:root and that fails to import giving me parsing errors in nzbget. If I use the same cli to move the file manually it moves, the permissions look ok but it fails to import on parse errors again. if I change the watch dir to the file I'm copying nzbs into via smb, those files load into nzbget.

I'm going to have to do a bunch more work on my end to figure out why synology and docker are being such a pain in the butt, since it seems like an issue with that first, possibly this script second.

l2g
Posts: 228
Joined: 27 Jun 2014, 22:13
Contact:

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by l2g » 19 Feb 2017, 21:54

Release v0.2.0 (Direct Download Link) in place.

The release details can be found at the head of this thread (quick link).

In short though, this release adds some pretty big features:
  1. Remote Mode: Now you can push content directly to NZBGet via it's API. This makes the script useful if ran on multiple servers across your network. Each script can be set up to watch for NZB-Files and post them directly to your central NZBGet server.
  2. Category Assignments: You can now associate as many directories (optionally) as you like and all NZB-Files found within them will be assigned a category in addition to being pushed to your NZBGet server. This also works for all NZB-Files found within compressed archives in the search path. You simply just have to add ?category=name to assign a category to the directory. All category assignments can also work from the command line too. So when paired with the Remote Mode above, the power of this script gets a little better!
I updated the entire first thread entry to describe it's setup in more detail.

Please feel free to let me know if there is anything I should add or if you find any bugs!

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by hugbug » 19 Feb 2017, 22:48

Great work!
I like the idea of remote mode.

nzbget_fan
Posts: 6
Joined: 28 Feb 2017, 19:43

Re: [Schd-Script] DirWatch - Multiple NZB-File Drop Support

Post by nzbget_fan » 01 Mar 2017, 09:19

Hi all,

I've an issue with the script within nzbget on a Windows 7 PC. I'm not sure if it has something to do with two installled versions of Python (V. 2.7 an 3.4) or with my windows path-variables.

When I start the script manually from command line it works flawlessly. But it doesn't work within nzbget. On startup of nzbget I get the following messages:
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,229 - 4196 - DEBUG - Exiting with return code: 93
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,229 - 4196 - WARNING - Source directory C:\Windows\system32\* was not found.
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - INFO - Target directory set to: F:\!Downloads\Anwendungen\Netzwerk Tools\nzbget\downloads\nzb
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(system) NZBDIR="F:\!Downloads\Anwendungen\Netzwerk Tools\nzbget\downloads/nzb"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(config) MODE="Move"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(config) WATCHPATHS="*"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(default) PROCESSMINAGE="30"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(config) MAXARCHIVESIZEKB="150"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(config) WATCHPATHS="*"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - get(system) NZBDIR="F:\!Downloads\Anwendungen\Netzwerk Tools\nzbget\downloads/nzb"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - set(environment) WATCHPATHS="*"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - set(config) WATCHPATHS="*"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - set(environment) MODE="Move"
info Wed Mar 01 2017 09:16:31 DirWatch: 2017-03-01 09:16:31,165 - 4196 - DEBUG - set(config) MODE="Move"
info Wed Mar 01 2017 09:16:31 DirWatch: [DEBUG] Script mode forced off.
info Wed Mar 01 2017 09:16:15 Executing scheduler-script DirWatch.py for Task1
My nzbget root-directory (where nzbget.exe is located) is "F:\!Downloads\Anwendungen\Netzwerk Tools\nzbget".

I hope you can help me. I was excited about how well it works when I started it from command line.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests